(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/app/usage"],{1113:(e,t,a)=>{"use strict";a.r(t);var n=a(144);t.default=({isAdmin:e,appsList:t})=>{const a=n.Locale.getSection("admin.controllers.app.usage"),s=n.Locale.getSection("admin.components.lists.appusage");(0,n.render)(document.getElementById("main"),[new n.Hint({hint:a.lmsg(e?"hint":"hintReseller")}),new n.Panel({cls:"list-box",items:[new n.List({...t,id:"admin-app-usage-list",operations:e?[{componentType:n.SmallButton,id:"buttonCleanApplicationCache",attrs:{"data-method":"post"},title:s.lmsg("buttonCleanApplicationCache"),description:s.lmsg("buttonCleanApplicationCacheDescription"),addCls:"sb-clean-app-cache",href:"/app/clear-cache"},t.data.data.length?{componentType:n.SmallButton,id:"buttonCheckForUpdates",title:s.lmsg("buttonCheckForUpdates"),description:s.lmsg("buttonCheckForUpdatesDescription"),addCls:"sb-upload-new-app",handler(){new Ajax.Request((0,n.prepareUrl)("/app/get-updates-data/"),{method:"post",onSuccess:({responseText:e})=>{(0,n.clearStatusMessages)();const t=JSON.parse(e);let a=s.lmsg(t.length?"foundUpdates":"noUpdates");t.forEach((({name:e,version:t})=>{a+="<br>".concat(e," ").concat(t)})),(0,n.addStatusMessage)("info",a)},onFailure:()=>{(0,n.addStatusMessage)("error",s.lmsg("updateFailed"))}})}}:null,{componentType:n.bar.Separator},{componentType:n.SmallButton,id:"buttonUpdateSettings",title:s.lmsg("buttonUpdateSettings"),description:s.lmsg("buttonUpdateSettingsDescription"),addCls:"sb-app-configure",href:"/app/update-settings"}]:null,columns:[{header:s.lmsg("name"),sortable:!0,dataIndex:"name",renderer:({id:e,name:t,version:a,release:s})=>'<a href="'.concat((0,n.prepareUrl)("/app/info/id/".concat(e)),'">')+"".concat((0,n.escapeHtml)(t)," (").concat((0,n.escapeHtml)(a),"-").concat((0,n.escapeHtml)(s),")")+"</a>"},{header:s.lmsg("numberOfInstances"),sortable:!0,dataIndex:"numberOfInstances",renderer:({numberOfInstances:e})=>(0,n.escapeHtml)(e)}]})]})])}}}]);
//# sourceMappingURL=usage.js.map?ed4c90e5d69d42c40bad