(window.webpackJsonpPlesk=window.webpackJsonpPlesk||[]).push([["views/smb/dns-zone/records-list"],{1123:function(e,t,n){"use strict";n.r(t);var s=n(145);t.default=({name:e,dnsRecordsList:t,urls:n,applyButton:a,manageDns:o,dnsZoneStatus:l,isZoneCreated:r,syncZone:d})=>{const c=s.Locale.getSection("smb.components.lists.dnsrecords"),i=e=>{e&&"success"!==e.status||(Object(s.addStatusMessage)("warning","".concat(c.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:c.lmsg("updateButtonTitle"),name:"send",description:c.lmsg("updateButtonDescription"),disabled:!1,handler(){Object(s.redirectPost)(n.update)}}),new s.CommandButton({applyTo:"btn-revert",title:c.lmsg("revertButtonTitle"),name:"cancel",description:c.lmsg("revertButtonDescription"),handler(){Object(s.redirectPost)(n.revert)}}))},m=(e,t)=>{const a=Object(s.prepareUrl)(n["edit-record"].replace("%%id%%",e.id));return"old"===e.status?"<a href=".concat(a,">").concat(Object(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(Object(s.escapeHtml)(e[t]),"</span></i></i></i>")+"</a></span>"};a&&i(),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:c.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(c.lmsg("buttonCheckHint"),"</span>")+"<a href=".concat(Object(s.prepareUrl)(n.check.replace("%%id%%",e.id)),' class="s-btn sb-dns-zone-check"><span></span></a>')}:null,"master"===l?{header:c.lmsg("host"),sortable:!0,dataIndex:"host",renderer:e=>m(e,"host")}:null,"master"===l?{header:c.lmsg("ttl"),headerParams:{width:100},sortable:!0,dataIndex:"ttl"}:null,"master"===l?{header:c.lmsg("type"),headerParams:{width:100},sortable:!0,dataIndex:"type"}:null,"master"===l?{header:c.lmsg("value"),sortable:!0,dataIndex:"value"}:null,"slave"===l?{header:c.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:c.lmsg("turnOn"),description:c.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:c.lmsg("toggleTypeTo".concat("master"===l?"Slave":"Master"),{name:e}),description:c.lmsg("hintToggleTypeDisabled",{name:e}),addCls:"sb-refresh",disabled:!0}:null,"off"===l?{componentType:s.SmallButton,id:"buttonAddRecord",title:c.lmsg("addRecord"),description:c.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:c.lmsg("turnOff"),description:c.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:c.lmsg("toggleTypeTo".concat("master"===l?"Slave":"Master"),{name:e}),description:c.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:c.lmsg("addRecord"),description:c.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:c.lmsg("restoreDefault"),description:c.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:c.lmsg("syncZone"),description:c.lmsg("hintSyncZone"),addCls:"sb-dns-zone-sync",href:n["sync-zone"]}:null,{componentType:s.bar.Separator},{componentType:s.SmallButton,id:"buttonRemoveRecord",title:c.lmsg("remove"),description:c.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(e){Object(s.getComponent)("dns-zone-records").execGroupOperation({url:n.delete,subtype:"delete",mouseEvent:e,locale:{confirmOnGroupOperation:c.lmsg("confirmOnDelete")},onSuccess:i})}}]:[]})]})}}}]);
//# sourceMappingURL=records-list.js.map?f4294143f595f2d019bc