"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/app/usage"],{924:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});var s=a(233),n=a.n(s),r=a(85),i=a(925);const d={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},l={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(d));o.displayName="JswList",o.propTypes=d,o.defaultProps=l;const p=o},928:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});var s=a(233),n=a.n(s),r=a(232),i=a(85),d=a(518),l=a(231);const o=({items:e})=>e&&e.length>1?(0,l.jsx)(r.Tabs,{active:e.findIndex((({containerCls:e})=>"active"===e))+1,children:e.map((({title:e,href:t},a)=>(0,l.jsx)(r.Tab,{title:e,component:d.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};const p=o},925:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var s=a(231),n=a(85);const r=(e,t=[],a={})=>r=>{const i=(0,s.useRef)(),d=(0,s.useRef)(),[l,o]=Object.entries(r).reduce(((e,[a,s])=>(e[t.includes(a)?0:1][a]=s,e)),[{},{}]),p=t.map((e=>{const t=l[e];return a[e]?(d.current?.[a[e]](t),null):t}));return(0,s.useLayoutEffect)((()=>(d.current=new e(l),(0,n.render)(i.current,d.current),()=>{d.current.remove(),d.current=null})),[o.key,...p]),(0,s.jsx)("div",{ref:i,...o})}},927:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var s=a(233),n=a.n(s),r=a(85),i=a(924),d=a(928),l=a(790),o=a(518),p=a(231);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)(d.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:d.default.propTypes.items,data:i.default.propTypes.data.isRequired,searchFilters:i.default.propTypes.searchFilters.isRequired},m.defaultProps={tabs:[]};const h=(0,l.withPageLayout)(m)},926:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s.default});var s=a(927)}}]);
//# sourceMappingURL=usage.js.map?2d632318c7eb303101c9