"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/app/usage"],{879:(e,t,a)=>{a.r(t);var s=a(210),n=a.n(s),r=a(88),i=a(880);const l={id:n().string,dataUrl:n().string,operations:n().array,itemActions:n().object,columns:n().array,data:n().shape({data:n().array,state:n().object,pager:n().object,locale:n().object,additional:n().object,pathbar:n().any}),searchFilters:n().object,searchOveral:n().string,disabledSelectHint:n().string,isDisabledItem:n().func,onRedraw:n().func,emptyViewMode:n().oneOf(["all","items"]),emptyView:n().any},d={id:void 0,dataUrl:void 0,operations:void 0,itemActions:void 0,columns:void 0,data:void 0,searchFilters:void 0,searchOveral:void 0,disabledSelectHint:void 0,isDisabledItem:void 0,onRedraw:void 0,emptyViewMode:void 0,emptyView:void 0},o=(0,i.default)(r.List,Object.keys(l));o.displayName="JswList",o.propTypes=l,o.defaultProps=d,t.default=o},883:(e,t,a)=>{a.r(t);var s=a(210),n=a.n(s),r=a(209),i=a(88),l=a(489),d=a(208);const o=({items:e})=>e&&e.length>1?(0,d.jsx)(r.Tabs,{active:e.findIndex((({containerCls:e})=>"active"===e))+1,children:e.map((({title:e,href:t},a)=>(0,d.jsx)(r.Tab,{title:e,component:l.default,to:(0,i.prepareUrl)(t)},a)))}):null;o.propTypes={items:n().arrayOf(n().shape({title:n().string.isRequired,href:n().string.isRequired,containerCls:n().string}))},o.defaultProps={items:void 0},t.default=o},880:(e,t,a)=>{a.r(t);var s=a(208),n=a(88);t.default=(e,t=[],a={})=>r=>{const i=(0,s.useRef)(),l=(0,s.useRef)(),[d,o]=Object.entries(r).reduce(((e,[a,s])=>(e[t.includes(a)?0:1][a]=s,e)),[{},{}]),p=t.map((e=>{const t=d[e];return a[e]?(l.current?.[a[e]](t),null):t}));return(0,s.useLayoutEffect)((()=>(l.current=new e(d),(0,n.render)(i.current,l.current),()=>{l.current.remove(),l.current=null})),[o.key,...p]),(0,s.jsx)("div",{ref:i,...o})}},882:(e,t,a)=>{a.r(t);var s=a(210),n=a.n(s),r=a(88),i=a(879),l=a(883),d=a(748),o=a(489),p=a(208);const c=r.Locale.getTranslate("admin.controllers.app.usage"),u=r.Locale.getSection("admin.components.lists.appusage"),m=({isAdmin:e,tabs:t,data:a,searchFilters:s})=>{const n=(0,o.useNavigateCallback)();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(l.default,{items:t}),(0,p.jsx)("p",{children:e?(0,p.jsx)(c,{content:"hint"}):(0,p.jsx)(c,{content:"hintReseller"})}),(0,p.jsx)(i.default,{id:"admin-app-usage-list",data:a,dataUrl:"/admin/app/usage-data",searchFilters:s,operations:e?[{componentType:r.SmallButton,id:"buttonCleanApplicationCache",attrs:{"data-method":"post"},title:u.lmsg("buttonCleanApplicationCache"),description:u.lmsg("buttonCleanApplicationCacheDescription"),addCls:"sb-clean-app-cache",href:"/app/clear-cache"},a.data.length?{componentType:r.SmallButton,id:"buttonCheckForUpdates",title:u.lmsg("buttonCheckForUpdates"),description:u.lmsg("buttonCheckForUpdatesDescription"),addCls:"sb-upload-new-app",handler(){r.api.post((0,r.prepareUrl)("/app/get-updates-data/")).then((e=>{(0,r.clearStatusMessages)();let t=u.lmsg(e.length?"foundUpdates":"noUpdates");e.forEach((({name:e,version:a})=>{t+=`<br>${e} ${a}`})),(0,r.addStatusMessage)("info",t)})).catch((()=>(0,r.addStatusMessage)("error",u.lmsg("updateFailed"))))}}:null,{componentType:r.bar.Separator},{componentType:r.SmallButton,id:"buttonUpdateSettings",title:u.lmsg("buttonUpdateSettings"),description:u.lmsg("buttonUpdateSettingsDescription"),addCls:"sb-app-configure",href:"/app/update-settings"}]:null,columns:[{header:u.lmsg("name"),sortable:!0,dataIndex:"name",renderer:({id:e,name:t,version:a,release:s})=>(0,r.createElement)("a",{href:(0,r.prepareUrl)(`/app/info/id/${e}`),onclick:n},`${(0,r.escapeHtml)(t)} (${(0,r.escapeHtml)(a)}-${(0,r.escapeHtml)(s)})`)},{header:u.lmsg("numberOfInstances"),sortable:!0,dataIndex:"numberOfInstances",renderer:({numberOfInstances:e})=>(0,r.escapeHtml)(e)}]})]})};m.propTypes={isAdmin:n().bool.isRequired,tabs:l.default.propTypes.items,data:i.default.propTypes.data.isRequired,searchFilters:i.default.propTypes.searchFilters.isRequired},m.defaultProps={tabs:[]},t.default=(0,d.withPageLayout)(m)},881:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s.default});var s=a(882)}}]);
//# sourceMappingURL=usage.js.map?e9667fb15d339dc41568