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