(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/smb/dns-zone/records-list"],{1135:(e,t,n)=>{"use strict";n.r(t);var s=n(144);t.default=({name:e,dnsRecordsList:t,urls:n,applyButton:a,manageDns:o,dnsZoneStatus:l,isZoneCreated:r,syncZone:d})=>{const i=s.Locale.getSection("smb.components.lists.dnsrecords"),c=e=>{e&&"success"!==e.status||((0,s.addStatusMessage)("warning","".concat(i.lmsg("applyChanges"),"<br><br><button id='btn-apply' class='btn'></button><button id='btn-revert' class='btn'></button>"),[]),new s.CommandButton({applyTo:"btn-apply",title:i.lmsg("updateButtonTitle"),name:"send",description:i.lmsg("updateButtonDescription"),disabled:!1,handler(){(0,s.redirectPost)(n.update)}}),new s.CommandButton({applyTo:"btn-revert",title:i.lmsg("revertButtonTitle"),name:"cancel",description:i.lmsg("revertButtonDescription"),handler(){(0,s.redirectPost)(n.revert)}}))},m=(e,t)=>{const a=(0,s.prepareUrl)(n["edit-record"].replace("%%id%%",e.id));return"old"===e.status?"<a href=".concat(a,">").concat((0,s.escapeHtml)(e[t]),"</a>"):"<span>"+"<a href=".concat(a,' class="s-btn sb-dns-records-changed list-item-').concat(e.status,'">')+"<i><i><i><span>".concat((0,s.escapeHtml)(e[t]),"</span></i></i></i>")+"</a></span>"};a&&c(),new s.Panel({cls:"list-box",renderTo:"main",items:[new s.List({...t,id:"dns-zone-records",isDisabledItem:e=>e.readOnly,columns:[o?s.list.COLUMN_SELECTION:null,"off"===l?{header:i.lmsg("nameServer"),sortable:!0,dataIndex:"ns",renderer:e=>m(e,"ns")}:null,"off"===l?{header:"",sortable:!1,cls:"min",renderer:e=>'<span class="tooltipData">'.concat(i.lmsg("buttonCheckHint"),"</span>")+"<a href=".concat((0,s.prepareUrl)(n.check.replace("%%id%%",e.id)),' class="s-btn sb-dns-zone-check"><span></span></a>')}:null,"master"===l?{header:i.lmsg("host"),sortable:!0,dataIndex:"host",renderer:e=>m(e,"host")}:null,"master"===l?{header:i.lmsg("ttl"),headerParams:{width:100},sortable:!0,dataIndex:"ttl"}:null,"master"===l?{header:i.lmsg("type"),headerParams:{width:100},sortable:!0,dataIndex:"type"}:null,"master"===l?{header:i.lmsg("value"),sortable:!0,dataIndex:"value"}:null,"slave"===l?{header:i.lmsg("ipAddress"),sortable:!0,dataIndex:"ip",renderer:e=>m(e,"ip")}:null].filter((e=>e)),operations:o?["off"===l&&r?{componentType:s.SmallButton,id:"buttonTurnOn",attrs:{"data-method":"post"},title:i.lmsg("turnOn"),description:i.lmsg("hintTurnOn",{name:e}),addCls:"sb-turn-on",href:n["turn-on"]}:null,"off"===l&&r?{componentType:s.SmallButton,id:"buttonToggleType",attrs:{"data-method":"post"},title:i.lmsg("toggleTypeTo".concat("master"===l?"Slave":"Master"),{name:e}),description:i.lmsg("hintToggleTypeDisabled",{name:e}),addCls:"sb-refresh",disabled:!0}:null,"off"===l?{componentType:s.SmallButton,id:"buttonAddRecord",title:i.lmsg("addRecord"),description:i.lmsg("hintSpecifyNameServer",{name:e}),addCls:"sb-dns-record-add",href:n["add-record"]}:null,"off"!==l&&r?{componentType:s.SmallButton,id:"buttonTurnOff",attrs:{"data-method":"post"},title:i.lmsg("turnOff"),description:i.lmsg("hintTurnOff",{name:e}),addCls:"sb-turn-off",href:n["turn-off"]}:null,"off"!==l&&r?{componentType:s.SmallButton,id:"buttonToggleType",attrs:{"data-method":"post"},title:i.lmsg("toggleTypeTo".concat("master"===l?"Slave":"Master"),{name:e}),description:i.lmsg("hintToggleTypeTo".concat("master"===l?"Slave":"Master"),{name:e}),addCls:"sb-refresh",href:n["toggle-type"]}:null,"off"!==l?{componentType:s.SmallButton,id:"buttonAddRecord",title:i.lmsg("addRecord"),description:i.lmsg("master"===l?"hintAddRecord":"hintAddPrimaryDns",{name:e}),addCls:"sb-dns-record-add",href:n["add-record"]}:null,"master"===l?{componentType:s.SmallButton,id:"buttonRestoreDefault",title:i.lmsg("restoreDefault"),description:i.lmsg("hintRestoreDefault",{name:e}),addCls:"sb-restore-defaults",href:n["restore-default"]}:null,"off"!==l&&d?{componentType:s.SmallButton,id:"buttonSyncZone",attrs:{"data-method":"post"},title:i.lmsg("syncZone"),description:i.lmsg("hintSyncZone"),addCls:"sb-dns-zone-sync",href:n["sync-zone"]}:null,{componentType:s.bar.Separator},{componentType:s.SmallButton,id:"buttonRemoveRecord",title:i.lmsg("remove"),description:i.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(e){(0,s.getComponent)("dns-zone-records").execGroupOperation({url:n.delete,subtype:"delete",mouseEvent:e,locale:{confirmOnGroupOperation:i.lmsg("confirmOnDelete")},onSuccess:c})}}]:[]})]})}}}]);
//# sourceMappingURL=records-list.js.map?85b6658e95c04d5404fd