Submit
Path:
~
/
/
opt
/
psa
/
admin
/
cp
/
public
/
javascript
/
app
/
File Content:
change-customers-owner.js
"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/change-customers-owner"],{3050:(e,t,s)=>{s.r(t),s.d(t,{default:()=>d});var i=s(89);class n extends i.ConfirmationPopupManager.PopupForm{_initConfiguration(e){super._initConfiguration({locale:i.Locale.getSection("admin.components.confirmations.change-customer-owner"),...e})}_onSuccessPreparePopup(e){if(this._clearMessages(),this._owners=$H(),this._response=e,"success"===this._response.status){document.getElementById(this._formBoxAreaId).innerHTML=`<p>${this.lmsg("ownerHint")}</p>${this.getOwnerSelectorHtml()}`,document.getElementById("owners").addEventListener("change",this.onOwnerChange.bind(this)),document.getElementById(this._formListAreaId).innerHTML=`<table cellspacing="0" width="100%"><tbody id="${this._formListItemsAreaId}"></tbody></table>`;let e=!1;$H(this._response.customers).each((({value:t})=>{0!==t.subscriptions.length&&(e=!0),this.addCustomer(t)})),e||(document.getElementById(this._formDescriptionId).innerHTML="")}else this._addErrorMessage(this._response.message)}getOwnerSelectorHtml(){let e='<select class="owners" name="owners" id="owners">';return(this._response.owners||[]).forEach((t=>{e+=`<option value="${t.id}">${(0,i.escapeHtml)(t.name)}</option>`,this._owners.set(t.id,t)})),e+="</select>",e}onOwnerChange(){$H(this._response.customers).each((({value:e})=>{0!==e.subscriptions.length&&$H(e.subscriptions).each((({value:e})=>{document.getElementById(`plans-box-${e.id}`).innerHTML=this.getPlanSelectorHtml(e),document.getElementById(`ipV4-box-${e.id}`).innerHTML=this.getIpAddressSelectorHtml(e,"ipV4"),document.getElementById(`ipV6-box-${e.id}`).innerHTML=this.getIpAddressSelectorHtml(e,"ipV6")}))}))}addCustomer(e){if(0===e.subscriptions.length){this._itemClass="odd"===this._itemClass?"even":"odd";const t=`<tr class="${this._itemClass}"><td><b>${(0,i.escapeHtml)(e.name)}</b></td><td> </td><td> </td><td> </td><td> </td></tr>`;(0,i.render)(document.getElementById(this._formListItemsAreaId),t)}else{let t=e.name;$H(e.subscriptions).each((({value:e})=>{this.addSubscription(e,t),t=" "}))}}addSubscription(e,t){this._itemClass="odd"===this._itemClass?"even":"odd";const s=`<tr class="${this._itemClass}"><td><b>${(0,i.escapeHtml)(t)}</b></td><td>${(0,i.escapeHtml)(e.name)}</td><td id="plans-box-${e.id}">${this.getPlanSelectorHtml(e)}</td><td id="ipV4-box-${e.id}">${this.getIpAddressSelectorHtml(e,"ipV4")}</td><td id="ipV6-box-${e.id}">${this.getIpAddressSelectorHtml(e,"ipV6")}</td></tr>`;(0,i.render)(document.getElementById(this._formListItemsAreaId),s)}getPlanSelectorHtml({id:e}){const t=this.getSelectedOwner();if(0===t.plans.length)return"";let s=`<select class="plans" name="plans[${e}]" id="plans-${e}">`;return $H(t.plans).each((({value:e})=>{void 0!==e.id&&(s+=`<option value="${e.id}">${(0,i.escapeHtml)(e.name)}</option>`)})),s+="</select>",s}getIpAddressSelectorHtml(e,t){const s=this.getSelectedOwner();if(void 0===s[t])return"";const{id:i}=e;let n=`<select class="${t}" name="${t}[${i}]" id="${t}-${i}">`;return $H(s[t]).each((({value:s})=>{if(void 0!==s.id){const i=s.id==e[t].id?"selected":"";n+=`<option value="${s.id}" ${i}>${s.description}</option>`}})),n+="</select>",e[t].isDedicated&&(n+=`<div class="hint-sub hint-attention">${this.lmsg("ipAddressHint")}</div>`),n}getSelectedOwner(){return this._owners.get(document.getElementById("owners").value)}_isValid(){return this._valid=!0,this.getSelectedOwner().id?($H(this._response.customers).each((({value:e})=>{0!==e.subscriptions.length&&$H(e.subscriptions).each((({value:e})=>{if(this._valid){const{id:t}=e,s=document.getElementById(`ipV4-${t}`)?document.getElementById(`ipV4-${t}`).value:0,i=document.getElementById(`ipV6-${t}`)?document.getElementById(`ipV6-${t}`).value:0;s||i||(this._addErrorMessage(this.lmsg("ipAddressNotSelected")),this._valid=!1)}}))})),this._valid):(this._addErrorMessage(this.lmsg("ownerNotSelected")),!1)}_getAdditionalParams(e){return e.set("owner-id",document.getElementById("owners").value),document.querySelectorAll(".plans").forEach((({id:t,value:s})=>{e.set(`plans[${t.replace("plans-","")}]`,s)})),document.querySelectorAll(".ipV4").forEach((({id:t,value:s})=>{e.set(`ipV4[${t.replace("ipV4-","")}]`,s)})),document.querySelectorAll(".ipV6").forEach((({id:t,value:s})=>{e.set(`ipV6[${t.replace("ipV6-","")}]`,s)})),e}}const d=n}}]); //# sourceMappingURL=change-customers-owner.js.map?2f5229967d7af5edfb1b
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
app
---
0755
app-image
---
0755
backup
---
0755
dns-helper
---
0755
domain
---
0755
email-address
---
0755
file-manager
---
0755
hosting-settings
---
0755
log-browser
---
0755
login
---
0755
mail-settings
---
0755
profile
---
0755
ssl-certificate
---
0755
user
---
0755
web-app-firewall
---
0755
aha.js
3589 bytes
0644
aha.js.map
9540 bytes
0644
change-customers-owner.js
4454 bytes
0644
change-customers-owner.js.map
12664 bytes
0644
convert-customers-to-resellers.js
1536 bytes
0644
convert-customers-to-resellers.js.map
4093 bytes
0644
convert-resellers-to-customers.js
2106 bytes
0644
convert-resellers-to-customers.js.map
5962 bytes
0644
dns-helper.js
16867 bytes
0644
dns-helper.js.map
46896 bytes
0644
editlist.js
7443 bytes
0644
editlist.js.map
22413 bytes
0644
eula.js
801 bytes
0644
eula.js.map
1971 bytes
0644
newsletter-subscription.js
6037 bytes
0644
newsletter-subscription.js.map
20263 bytes
0644
progress-dialog.js
2097 bytes
0644
progress-dialog.js.map
7209 bytes
0644
pum.js
12274 bytes
0644
pum.js.map
35446 bytes
0644
rating.js
5375 bytes
0644
rating.js.map
13432 bytes
0644
server-mail-antivirus-promo.js
610 bytes
0644
server-mail-antivirus-promo.js.map
1568 bytes
0644
service-sidebar.js
989 bytes
0644
service-sidebar.js.map
2284 bytes
0644
show-output-popup.js
814 bytes
0644
show-output-popup.js.map
2248 bytes
0644
task-progress-bar.js
3449 bytes
0644
task-progress-bar.js.map
11037 bytes
0644
N4ST4R_ID | Naxtarrr