(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["app/pum"],{3042:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>n});var a=s(3043),i=s(3049);const n={List:a.default,PopupPackagesUpdate:i.default}},3043:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>p});var a=s(297),i=s(90),n=s(3044),o=s(3045),l=s(3047),r=s(3049),c=s(296);const d=i.Locale.getSection("admin.components.lists.pumpackages"),p=class extends i.List{_initConfiguration({updatesOnly:t=!1,...e}){super._initConfiguration({dataUrl:`/admin/pum/${t?"updates-":""}list-data`,searchOveral:"name",emptyViewMode:t?"all":void 0,onRedraw:()=>{this._renderAlert()},...e}),this._urls=this._getConfigParam("urls",{}),this._updatesOnly=t,this._initActions(),this._initOperations(),this._initColumns()}_initActions(){this._itemActions.packageInfo=({name:t})=>{new n.default({url:this._urls.packageInfo,packageName:t})},this._itemActions.packageUpdate=t=>{new r.default({urls:this._urls,packages:[t]})},this._itemActions.packageLock=t=>{new o.default({urls:this._urls,packages:[t],list:this})},this._itemActions.packageUnlock=t=>{new l.default({urls:this._urls,packages:[t],list:this})}}_initOperations(){this._operations=[],this._urls.updatePackages&&(this._operations.push({componentType:i.SmallButton,id:"buttonUpdate",title:d.lmsg("buttonUpdate"),description:d.lmsg("buttonUpdateDescription"),addCls:"sb-upgrade",handler:t=>{this.execGroupOperation({url:this._urls.updatePackages,mouseEvent:t,confirmationPopup:()=>{new r.default({urls:this._urls,packages:this.getSelectedItems()})}})}}),this._operations.push({componentType:i.bar.Separator})),this._urls.lock&&this._urls.unlock&&(this._operations.push({componentType:i.SmallButton,id:"buttonLock",title:d.lmsg("buttonLock"),description:d.lmsg("buttonLockDescription"),addCls:"sb-lock",handler:t=>{this.execGroupOperation({url:this._urls.lock,mouseEvent:t,confirmationPopup:()=>{new o.default({urls:this._urls,packages:this.getSelectedItems(),list:this})}})}}),this._operations.push({componentType:i.SmallButton,id:"buttonUnlock",title:d.lmsg("buttonUnlock"),description:d.lmsg("buttonUnlockDescription"),addCls:"sb-unlock",handler:t=>{this.execGroupOperation({url:this._urls.unlock,mouseEvent:t,confirmationPopup:()=>{new l.default({urls:this._urls,packages:this.getSelectedItems(),list:this})}})}}),this._operations.push({componentType:i.bar.Separator})),this._operations.push({componentType:i.SmallButton,id:"buttonCheckUpdates",title:d.lmsg("buttonCheckUpdates"),description:d.lmsg("buttonCheckUpdatesDescription"),addCls:"sb-refresh",handler:this.checkUpdates.bind(this)})}_initColumns(){this._columns.push(i.list.COLUMN_SELECTION),this._columns.push({header:d.lmsg("name"),sortable:!0,dataIndex:"name",renderer:({name:t,version_from:e,repo_from:s})=>`${(0,i.escapeHtml)(t)} ${(0,i.escapeHtml)(e)} (${s?(0,i.escapeHtml)(s):d.lmsg("unknownRepo")})`}),this._columns.push({header:d.lmsg("summary"),sortable:!0,dataIndex:"summary"}),this._columns.push({header:d.lmsg("lockedCut"),sortable:!0,dataIndex:"locked",cls:"min",renderer:({locked:t})=>t?`${d.lmsg("lockedHint")}`:`${d.lmsg("unlockedHint")}`}),this._columns.push({header:d.lmsg("updates"),sortable:!0,dataIndex:"update",renderer:({update:t,version_to:e,repo_to:s})=>{if(!t)return d.lmsg("updated");return`${d.lmsg("update",{version:(0,i.escapeHtml)(e)})} (${(0,i.escapeHtml)(s)})`}})}emptyView(){return this._updatesOnly?(0,c.jsx)(a.ListEmptyView,{title:d.lmsg("allUpToDate"),description:this._additionalData.lastChecked?d.lmsg("allUpToDateLastChecked",{date:this._additionalData.lastChecked}):null,image:s(3048),actions:(0,c.jsx)(a.Button,{intent:"primary",size:"lg",icon:"refresh",onClick:t=>this.checkUpdates(t),children:d.lmsg("recheckUpdates")})}):super.emptyView()}_renderAlert(){this._additionalData.availableUpdates.length&&(this._componentElement.parentNode.querySelectorAll(".alert").forEach(t=>{t.parentNode.removeChild(t)}),(0,i.render)(this._componentElement,(0,i.createElement)(".alert.alert-info",{role:"alert"},[(0,i.createElement)("i.icon-update-light")," ",d.lmsg("updatesAvailable",{count:this._additionalData.availableUpdates.length}),this._additionalData.lastChecked?(0,i.createElement)("span.text-muted",` ${d.lmsg("lastedChecked",{date:(0,i.escapeHtml)(this._additionalData.lastChecked)})}`):""," ",(0,i.createElement)("button.btn.btn-primary",{onclick:t=>{t.preventDefault(),new r.default({urls:this._urls,packages:this._additionalData.availableUpdates})}},d.lmsg("updateAll"))]),"before"))}checkUpdates(t){t&&t.preventDefault(),this.reload("?check-updates=true")}}},3044:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>i});var a=s(90);const i=class extends a.PopupForm{_initConfiguration(t){super._initConfiguration({singleRowButtons:!0,locale:a.Locale.getSection("admin.components.lists.pumpackages"),...t}),this._url=this._getConfigParam("url"),this._packageName=this._getConfigParam("packageName")}render(){super.render(),this.setBoxType("form-box"),this.setTitle(this.lmsg("popupInfoTitle",{package:(0,a.escapeHtml)(this._packageName)})),document.getElementById(this._contentAreaId).innerHTML=`
${(0,a.escapeHtml)(e.data)}`}}),this.addRightButton(a.Locale.getSection("components.buttons").lmsg("ok"),()=>{this.hide()})}hide(){this._request&&this._request.abort(),super.hide()}}},3045:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>n});var a=s(90),i=s(3046);const n=class extends i.default{render(){super.render(),this.setBoxType("form-box"),this.setTitle(this.lmsg("popupLockTitle")),this.setHint(this.lmsg("popupLockDescription")),document.getElementById(this._contentAreaId).innerHTML=`${this.lmsg("popupLockPackagesListTitle")}
${this.lmsg("popupUnlockPackagesListTitle")}
${this.lmsg("popupUpdatePackagesListTitle")}
${this.lmsg("popupUpdateLockedPackagesListTitle")}