(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/app/info"],{1135:(e,t,n)=>{"use strict";n.r(t);var a=n(144);t.default=({packageId:e,updatesList:t,appsList:n,hasSettings:s,isClassicMode:r})=>{const i=a.Locale.getSection("admin.controllers.app.info"),o=a.Locale.getSection("admin.components.lists.appinfo");(0,a.render)(document.getElementById("main"),[new a.Hint({hint:i.lmsg("hint")}),new a.Panel({cls:"list-box",items:[new a.List({...n,id:"admin-app-info-list",searchOveral:"installedAt",operations:[s?{componentType:a.SmallButton,title:o.lmsg("buttonChangeSettings"),description:o.lmsg("buttonChangeSettingsDescription"),addCls:"sb-app-configure",href:"/app/configure/id/".concat(e)}:null,n.data.data.length?{componentType:a.SmallButton,id:"buttonCheckForUpdates",title:o.lmsg("buttonCheckForUpdates"),description:o.lmsg("buttonCheckForUpdatesDescription"),addCls:"sb-upload-new-app",handler:()=>{new Ajax.Request((0,a.prepareUrl)("/app/get-updates-data/"),{method:"post",parameters:{ids:e},onSuccess:({responseText:e})=>{(0,a.clearStatusMessages)(),t=JSON.parse(e);let n=o.lmsg(t.length?"foundUpdates":"noUpdates");document.querySelectorAll(".update-available").forEach((e=>{e.style.display="none"})),t.forEach((({resourceId:e,name:t,version:a})=>{n+="<br>".concat(t," ").concat(a);const s=document.getElementById("app-info-update-".concat(e));s&&(s.style.display="")})),(0,a.addStatusMessage)("info",n)},onFailure:()=>{(0,a.addStatusMessage)("error",o.lmsg("updateFailed"))}})}}:null],columns:[{header:o.lmsg("installedAt"),sortable:!0,dataIndex:"installedAt",renderer(n){const s="/app-update/index/resourceId/".concat(n.resourceId),r=(0,a.prepareUrl)("/app/info/id/".concat((0,a.escapeHtml)(e))),i=(0,a.prepareUrl)("/subscription/login/id/".concat(n.subscriptionId,"?pageUrl=").concat(s,"&returnUrl=").concat(r)),l=n.installedAt?'<a href="'.concat((0,a.escapeHtml)(n.installedAt),'" target="_top">').concat((0,a.escapeHtml)(n.installedAt),"</a>"):o.lmsg("noInstallationUrlAvailable"),c=(p=n.resourceId,t.some((({resourceId:e})=>e===p))?"":' style="display:none"');var p;const d='<div id="app-info-update-'.concat((0,a.escapeHtml)(n.resourceId),'" class="hint-attention update-available" ').concat(c)+'<a href="'.concat(i,'" target="').concat("admin"!==n.subscriptionOwnerType?"_blank":"_top",'">').concat(o.lmsg("update"),"</a>")+"</div>";let u="";return n.notConfigured&&(u=' <span class="hint-attention ">'.concat(o.lmsg("appNotConfigured"),"</span>")),l+d+u}},{header:o.lmsg("subscriptionName"),sortable:!0,dataIndex:"subscriptionName",renderer:e=>'<a href="'.concat((0,a.prepareUrl)("/subscription/overview/id/".concat(e.subscriptionId)),'">').concat((0,a.escapeHtml)(e.subscriptionName),"</a>")},r?{header:o.lmsg("subscriptionOwner"),sortable:!0,dataIndex:"subscriptionOwner",renderer(e){if("admin"===e.subscriptionOwnerType)return(0,a.escapeHtml)(e.subscriptionOwner);let t="";return t="reseller"===e.subscriptionOwnerType?(0,a.prepareUrl)("/reseller/overview/id/"):(0,a.prepareUrl)("/customer/overview/id/"),'<a href="'.concat(t).concat(e.subscriptionOwnerId,'">').concat((0,a.escapeHtml)(e.subscriptionOwner),"</a>")}}:null,r?{header:"",sortable:!1,renderer(t){let n="hintLoginClassicMode";return r||(n="admin"===t.subscriptionOwnerType?"hintAdminLogin":"hintLogin"),(0,a.getControlPanelLoginHtml)(t.subscriptionId,{openInNew:"admin"!==t.subscriptionOwnerType,label:o.lmsg(r?"buttonLoginClassicMode":"buttonLogin"),hint:o.lmsg(n),returnUrl:"admin"===t.subscriptionOwnerType?"/app/info/id/".concat(e):null,isClassicUi:r?"true":"false"})}}:null].filter((e=>e))})]})])}}}]);
//# sourceMappingURL=info.js.map?e76d3feab221d1341abd