"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/app/usage"],{869:(e,t,a)=>{a.r(t);var s=a(210),n=a.n(s),r=a(88),i=a(870);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},o={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},d=(0,i.default)(r.List,Object.keys(l));d.displayName="JswList",d.propTypes=l,d.defaultProps=o,t.default=d},873:(e,t,a)=>{a.r(t);var s=a(210),n=a.n(s),r=a(209),i=a(88),l=a(667),o=a(208);const d=({items:e})=>e&&e.length>1?(0,o.jsx)(r.Tabs,{active:e.findIndex((({containerCls:e})=>"active"===e))+1,children:e.map((({title:e,href:t},a)=>(0,o.jsx)(r.Tab,{title:e,component:l.default,to:(0,i.prepareUrl)(t)},a)))}):null;d.propTypes={items:n().arrayOf(n().shape({title:n().string.isRequired,href:n().string.isRequired,containerCls:n().string}))},d.defaultProps={items:void 0},t.default=d},870:(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)(),[o,d]=Object.entries(r).reduce(((e,[a,s])=>(e[t.includes(a)?0:1][a]=s,e)),[{},{}]),p=t.map((e=>{const t=o[e];return a[e]?(l.current?.[a[e]](t),null):t}));return(0,s.useLayoutEffect)((()=>(l.current=new e(o),(0,n.render)(i.current,l.current),()=>{l.current.remove(),l.current=null})),[d.key,...p]),(0,s.jsx)("div",{ref:i,...d})}},872:(e,t,a)=>{a.r(t);var s=a(210),n=a.n(s),r=a(88),i=a(869),l=a(873),o=a(697),d=a(667),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,d.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(){new Ajax.Request((0,r.prepareUrl)("/app/get-updates-data/"),{method:"post",onSuccess:({responseText:e})=>{(0,r.clearStatusMessages)();const t=JSON.parse(e);let a=u.lmsg(t.length?"foundUpdates":"noUpdates");t.forEach((({name:e,version:t})=>{a+=`<br>${e} ${t}`})),(0,r.addStatusMessage)("info",a)},onFailure:()=>{(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,o.withPageLayout)(m)},871:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s.default});var s=a(872)}}]);
//# sourceMappingURL=usage.js.map?a1e557f4526a50069051