(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/app/usage"],{778:(e,t,a)=>{"use strict";a.r(t);var s=a(153),n=a(260),l=a.n(n),r=a(154),i=a(143),p=a(582);const o=({items:e})=>(0,s.createElement)(r.Tabs,{active:e.findIndex((({containerCls:e})=>"active"===e))+1},e.map((({title:e,href:t},a)=>(0,s.createElement)(r.Tab,{key:a,title:e,component:p.default,to:(0,i.prepareUrl)(t)}))));o.propTypes={items:l().arrayOf(l().shape({title:l().string.isRequired,href:l().string.isRequired,containerCls:l().string})).isRequired},t.default=o},777:(e,t,a)=>{"use strict";a.r(t);var s=a(153),n=a(555),l=a(260),r=a.n(l),i=a(143),p=a(608),o=a(576),d=a(778),c=a(582);const u=i.Locale.getSection("admin.controllers.app.usage"),m=i.Locale.getSection("admin.components.lists.appusage"),g=({isAdmin:e,appsList:t,tabs:a})=>{const l=(0,n.useHistory)(),r=(0,c.createNavigateHandler)(l);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(d.default,{items:a}),(0,s.createElement)(o.default,null,(()=>new i.Hint({hint:u.lmsg(e?"hint":"hintReseller")}))),(0,s.createElement)(o.default,null,(()=>new i.Panel({cls:"list-box",items:[new i.List({...t,id:"admin-app-usage-list",operations:e?[{componentType:i.SmallButton,id:"buttonCleanApplicationCache",attrs:{"data-method":"post"},title:m.lmsg("buttonCleanApplicationCache"),description:m.lmsg("buttonCleanApplicationCacheDescription"),addCls:"sb-clean-app-cache",href:"/app/clear-cache"},t.data.data.length?{componentType:i.SmallButton,id:"buttonCheckForUpdates",title:m.lmsg("buttonCheckForUpdates"),description:m.lmsg("buttonCheckForUpdatesDescription"),addCls:"sb-upload-new-app",handler(){new Ajax.Request((0,i.prepareUrl)("/app/get-updates-data/"),{method:"post",onSuccess:({responseText:e})=>{(0,i.clearStatusMessages)();const t=JSON.parse(e);let a=m.lmsg(t.length?"foundUpdates":"noUpdates");t.forEach((({name:e,version:t})=>{a+=`<br>${e} ${t}`})),(0,i.addStatusMessage)("info",a)},onFailure:()=>{(0,i.addStatusMessage)("error",m.lmsg("updateFailed"))}})}}:null,{componentType:i.bar.Separator},{componentType:i.SmallButton,id:"buttonUpdateSettings",title:m.lmsg("buttonUpdateSettings"),description:m.lmsg("buttonUpdateSettingsDescription"),addCls:"sb-app-configure",href:"/app/update-settings"}]:null,columns:[{header:m.lmsg("name"),sortable:!0,dataIndex:"name",renderer:({id:e,name:t,version:a,release:s})=>(0,i.createElement)("a",{href:(0,i.prepareUrl)(`/app/info/id/${e}`),onclick:r},`${(0,i.escapeHtml)(t)} (${(0,i.escapeHtml)(a)}-${(0,i.escapeHtml)(s)})`)},{header:m.lmsg("numberOfInstances"),sortable:!0,dataIndex:"numberOfInstances",renderer:({numberOfInstances:e})=>(0,i.escapeHtml)(e)}]})]}))))};g.propTypes={isAdmin:r().bool.isRequired,appsList:r().object.isRequired,tabs:r().array},g.defaultProps={tabs:[]},t.default=(0,p.withPageLayout)(g)},776:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>s.default});var s=a(777)}}]);
//# sourceMappingURL=usage.js.map?f402cc1ecdc45cca4943