(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/smb/dns-zone/records-list"],{1010:(e,t,n)=>{"use strict";n.r(t);var l=n(153),a=n.n(l),r=n(154),s=n(155),o=n(144),i=n(1011);const d=o.Locale.getTranslate("smb.components.dns-helper");t.default=e=>{const[t,n]=(0,r.useState)(!1);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.StatusMessage,{intent:"warning"},(0,r.createElement)(s.Paragraph,null,(0,r.createElement)(d,{content:"domainUnresolvedMessage"})),(0,r.createElement)(s.Paragraph,null,(0,r.createElement)(d,{content:"warningActionMessage",params:{warningActionLink:(0,r.createElement)(s.Text,{bold:!0},(0,r.createElement)(s.Link,{onClick:()=>n(!0)},(0,r.createElement)(d,{content:"warningActionLink"})))}})),(0,r.createElement)("br",null),(0,r.createElement)(s.Text,{italic:!0},(0,r.createElement)(d,{content:"changesLagWarning"}))),(0,r.createElement)(i.default,a()({isOpen:t,onClose:()=>n(!1)},e)))}},1011:(e,t,n)=>{"use strict";n.r(t);var l=n(155),a=n(154),r=n(261),s=n.n(r),o=n(144),i=n(302),d=n(405);const c=o.Locale.getTranslate("smb.components.dns-helper"),m=i.gql`
    query getDnsSettings($id: ID!) {
        node(id: $id) {
            ... on Domain {
                name(idn: false)
                ipAddresses {
                    ipAddress(publicIp: true)
                }    
                dnsZone {
                    nsRecords: records(filter: {type: [NS]}, orderBy: {value: asc}) {
                        host
                        value
                        type
                    }
                    aRecords: records(filter: {type: [A]}) {
                        host
                        value
                        type
                    }
                }        
            }
            ... on DomainAlias {
                name(idn: false)
                domain {
                    ipAddresses {
                        ipAddress
                    }                   
                }
                dnsZone {
                    nsRecords: records(filter: {type: [NS]}, orderBy: {value: asc}) {
                        host
                        value
                        type
                    }
                    aRecords: records(filter: {type: [A]}) {
                        host
                        value
                        type
                    }
                }               
            }
        }
        viewer {
            type
        }
        config {
            dns {
                enableResolveChecking
            }
        }
        dnsRegistrars {
            name
            url
        }
        dnsExtensions {
            name
            url
        }
        mode {
            isDnsServiceSupported
        }        
    }
`,u=({isOpen:e,onClose:t,id:n,isAlias:r})=>{var s,o,i,u;const{loading:p,data:g}=(0,d.useQuery)(m,{variables:{id:btoa(`${r?"DomainAlias":"Domain"}:${n}`)}});if(p)return null;const{dnsRegistrars:E,dnsExtensions:f}=g,h="ADMIN"===g.viewer.type,b=g.node.name,v=null!==(s=null===(o=g.node.dnsZone)||void 0===o?void 0:o.nsRecords)&&void 0!==s?s:[],y=null!==(i=null===(u=g.node.dnsZone)||void 0===u?void 0:u.aRecords)&&void 0!==i?i:[],T=v.map((e=>y.find((t=>t.host===e.value)))).filter((e=>!!e)),{ipv4:k,ipv6:S}=(r?g.node.domain.ipAddresses:g.node.ipAddresses).reduce(((e,{ipAddress:t})=>(e[t.includes(":")?"ipv6":"ipv4"]=t,e)),{}),R=g.config.dns.enableResolveChecking&&g.mode.isDnsServiceSupported;return(0,a.createElement)(l.Drawer,{title:(0,a.createElement)(c,{content:"drawerTitle",params:{domainName:b}}),size:"sm",isOpen:e,onClose:t,"data-type":"dns-helper"},R?(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,(0,a.createElement)(c,{content:"pleskResolve"})),(0,a.createElement)("p",null,(0,a.createElement)(c,{content:"domainSetup0"})),(0,a.createElement)("ol",null,(0,a.createElement)("li",null,(0,a.createElement)(c,{content:"domainSetup1"})),T.length>0?(0,a.createElement)("li",null,(0,a.createElement)(c,{content:"domainSetup2",params:{glueLink:(0,a.createElement)(l.Link,{"data-action":"glueLink",href:"https://en.wikipedia.org/wiki/Domain_Name_System#Circular_dependencies_and_glue_records",target:"_blank"},(0,a.createElement)("b",null,(0,a.createElement)(c,{content:"glueRecords"})))}}),(0,a.createElement)(l.Alert,null,T.map((({host:e,value:t})=>(0,a.createElement)("div",{key:t},e," ",t))))):null,(0,a.createElement)("li",null,(0,a.createElement)("p",null,(0,a.createElement)(c,{content:"domainSetup3"})),(0,a.createElement)(l.Alert,null,v.map((({value:e})=>(0,a.createElement)("div",{key:e},"NS"," ",e)))))),(0,a.createElement)("p",null,(0,a.createElement)(c,{content:"primaryDNS"})),(0,a.createElement)("p",null,(0,a.createElement)(c,{content:"forExample"})),k?(0,a.createElement)(l.Alert,null,`A @ ${k}`,(0,a.createElement)("br",null),`A www ${k}`):null,S?(0,a.createElement)(l.Alert,null,`AAAA @ ${S}`,(0,a.createElement)("br",null),`AAAA www ${S}`):null):null,(0,a.createElement)(l.Paragraph,null,(0,a.createElement)(c,{content:"chooseRegistrar"})),(0,a.createElement)(l.Text,{italic:!0,bold:!0},(0,a.createElement)(l.Link,{"data-action":"chooseRegistrar",href:"https://www.icann.org/resources/pages/who-2013-05-03-en",target:"_blank"},(0,a.createElement)(c,{content:"chooseRegistrarLink"}))),(0,a.createElement)("br",null),(0,a.createElement)("br",null),(0,a.createElement)(l.Cuttable,{maxHeight:160},(()=>{const e=[...E,{name:(0,a.createElement)(c,{content:"registrarSurveyLink"}),url:"https://pt-research.typeform.com/to/FkcDot10"}];return(0,a.createElement)(l.ItemList,{minColumnWidth:250,gap:"xs"},e.map((({name:e,url:t})=>(0,a.createElement)(l.Item,{"data-action":e,key:e,icon:(0,a.createElement)(l.Icon,{name:"chevron-right",size:"12"}),title:(0,a.createElement)("span",null,(0,a.createElement)(l.Link,{href:t,target:"_blank"},e))}))))})()),h&&R?(0,a.createElement)(l.Alert,{intent:"default"},(0,a.createElement)(l.Status,{intent:"warning"},(0,a.createElement)(c,{content:"adminHintTitle"}),(0,a.createElement)("ol",null,(0,a.createElement)("li",null,(0,a.createElement)(c,{content:"addIpOption",params:{useIpLink:(0,a.createElement)(l.Text,{bold:!0},(0,a.createElement)(l.Link,{"data-action":"addSecondIpGuide",href:"http://docs.plesk.com/en-US/obsidian/administrator-guide/dns/providing-redundant-dns-servers.74239/#configure-at-least-two-ip-addresses-on-your-plesk-server",target:"_blank"},(0,a.createElement)(c,{content:"useIpLink"})))}}),(0,a.createElement)(l.Text,{bold:!0},(0,a.createElement)(c,{content:"example"})),(0,a.createElement)("ul",null,(0,a.createElement)("li",null,(0,a.createElement)(l.Text,{italic:!0},"ns1.example.com 123.123.123.123")),(0,a.createElement)("li",null,(0,a.createElement)(l.Text,{italic:!0},"ns2.example.com 124.124.124.124")))),(0,a.createElement)("li",null,(0,a.createElement)(c,{content:"slaveDnsOption",params:{slaveExtensionLink:(0,a.createElement)(l.Text,{bold:!0},(0,a.createElement)(l.Link,{"data-action":"slaveDnsExtension",href:"https://www.plesk.com/extensions/slave-dns-manager/",target:"_blank"},(0,a.createElement)(c,{content:"slaveExtensionLink"})))}})),(0,a.createElement)("li",null,(0,a.createElement)(c,{content:"extensionOption",params:{extensions:(0,a.createElement)(a.Fragment,null,f.map((({name:e,url:t},n)=>(0,a.createElement)(a.Fragment,{key:e},(0,a.createElement)(l.Link,{href:t,target:"_blank","data-action":e},e),n<f.length-1?", ":""))))}}))))):null)};u.propTypes={isOpen:s().bool.isRequired,onClose:s().func.isRequired,id:s().number.isRequired,isAlias:s().bool},u.defaultProps={isAlias:!1},t.default=u},1009:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l.default});var l=n(1010)},797:(e,t,n)=>{"use strict";n.r(t);var l=n(154),a=n(261),r=n.n(a),s=n(155),o=n(144),i=n(582);const d=({items:e})=>(0,l.createElement)(s.Tabs,{active:e.findIndex((({containerCls:e})=>"active"===e))+1},e.map((({title:e,href:t},n)=>(0,l.createElement)(s.Tab,{key:n,title:e,component:i.default,to:(0,o.prepareUrl)(t)}))));d.propTypes={items:r().arrayOf(r().shape({title:r().string.isRequired,href:r().string.isRequired,containerCls:r().string.isRequired})).isRequired},t.default=d},1007:(e,t,n)=>{"use strict";n.r(t);var l=n(154),a=n(602),r=n(648),s=n(155),o=n(1008),i=n(261),d=n.n(i),c=n(1009),m=n(797);const u=({tabs:e,dnsHelper:t,...n})=>(0,l.createElement)(s.Fragment,null,t?(0,l.createElement)(c.default,t):null,e.length>1?(0,l.createElement)(m.default,{items:e}):null,(0,l.createElement)(o.default,n));u.propTypes={tabs:d().array.isRequired,dnsHelper:d().object},u.defaultProps={dnsHelper:null},t.default=(0,a.withPageLayout)((0,r.withPageContent)(u))},1008:(e,t,n)=>{"use strict";n.r(t);var l=n(154),a=n(144),r=n(576),s=n(261),o=n.n(s);const i=({name:e,dnsRecordsList:t,urls:n,applyButton:s,manageDns:o,dnsZoneStatus:i,isZoneCreated:d,syncZone:c})=>{const m=a.Locale.getSection("smb.components.lists.dnsrecords"),u=e=>{e&&"success"!==e.status||((0,a.addStatusMessage)("warning",`${m.lmsg("applyChanges")}<br><br><button id='btn-apply' class='btn'></button><button id='btn-revert' class='btn'></button>`,[]),new a.CommandButton({applyTo:"btn-apply",title:m.lmsg("updateButtonTitle"),name:"send",description:m.lmsg("updateButtonDescription"),disabled:!1,handler(){(0,a.redirectPost)(n.update)}}),new a.CommandButton({applyTo:"btn-revert",title:m.lmsg("revertButtonTitle"),name:"cancel",description:m.lmsg("revertButtonDescription"),handler(){(0,a.redirectPost)(n.revert)}}))},p=(e,t)=>{const l=(0,a.prepareUrl)(n["edit-record"].replace("%%id%%",e.id));return"old"===e.status?`<a href=${l}>${(0,a.escapeHtml)(e[t])}</a>`:`<span><a href=${l} class="s-btn sb-dns-records-changed list-item-${e.status}"><i><i><i><span>${(0,a.escapeHtml)(e[t])}</span></i></i></i></a></span>`};return(0,l.useEffect)((()=>{s&&u()}),[s]),(0,l.createElement)(r.default,null,(()=>new a.Panel({cls:"list-box",items:[new a.List({...t,id:"dns-zone-records",isDisabledItem:({readOnly:e})=>e,columns:[o?a.list.COLUMN_SELECTION:null,"off"===i?{header:m.lmsg("nameServer"),sortable:!0,dataIndex:"ns",renderer:e=>p(e,"ns")}:null,"off"===i?{header:"",sortable:!1,cls:"min",renderer:e=>`<span class="tooltipData">${m.lmsg("buttonCheckHint")}</span><a href=${(0,a.prepareUrl)(n.check.replace("%%id%%",e.id))} class="s-btn sb-dns-zone-check"><span></span></a>`}:null,"master"===i?{header:m.lmsg("host"),sortable:!0,dataIndex:"host",renderer:e=>p(e,"host")}:null,"master"===i?{header:m.lmsg("ttl"),headerParams:{width:100},sortable:!0,dataIndex:"ttl"}:null,"master"===i?{header:m.lmsg("type"),headerParams:{width:100},sortable:!0,dataIndex:"type"}:null,"master"===i?{header:m.lmsg("value"),sortable:!0,dataIndex:"value"}:null,"slave"===i?{header:m.lmsg("ipAddress"),sortable:!0,dataIndex:"ip",renderer:e=>p(e,"ip")}:null].filter((e=>e)),operations:o?["off"===i&&d?{componentType:a.SmallButton,id:"buttonTurnOn",attrs:{"data-method":"post"},title:m.lmsg("turnOn"),description:m.lmsg("hintTurnOn",{name:e}),addCls:"sb-turn-on",href:n["turn-on"]}:null,"off"===i&&d?{componentType:a.SmallButton,id:"buttonToggleType",attrs:{"data-method":"post"},title:m.lmsg("toggleTypeTo"+("master"===i?"Slave":"Master"),{name:e}),description:m.lmsg("hintToggleTypeDisabled",{name:e}),addCls:"sb-refresh",disabled:!0}:null,"off"===i?{componentType:a.SmallButton,id:"buttonAddRecord",title:m.lmsg("addRecord"),description:m.lmsg("hintSpecifyNameServer",{name:e}),addCls:"sb-dns-record-add",href:n["add-record"]}:null,"off"!==i&&d?{componentType:a.SmallButton,id:"buttonTurnOff",attrs:{"data-method":"post"},title:m.lmsg("turnOff"),description:m.lmsg("hintTurnOff",{name:e}),addCls:"sb-turn-off",href:n["turn-off"]}:null,"off"!==i&&d?{componentType:a.SmallButton,id:"buttonToggleType",attrs:{"data-method":"post"},title:m.lmsg("toggleTypeTo"+("master"===i?"Slave":"Master"),{name:e}),description:m.lmsg("hintToggleTypeTo"+("master"===i?"Slave":"Master"),{name:e}),addCls:"sb-refresh",href:n["toggle-type"]}:null,"off"!==i?{componentType:a.SmallButton,id:"buttonAddRecord",title:m.lmsg("addRecord"),description:m.lmsg("master"===i?"hintAddRecord":"hintAddPrimaryDns",{name:e}),addCls:"sb-dns-record-add",href:n["add-record"]}:null,"master"===i?{componentType:a.SmallButton,id:"buttonRestoreDefault",title:m.lmsg("restoreDefault"),description:m.lmsg("hintRestoreDefault",{name:e}),addCls:"sb-restore-defaults",href:n["restore-default"]}:null,"off"!==i&&c?{componentType:a.SmallButton,id:"buttonSyncZone",attrs:{"data-method":"post"},title:m.lmsg("syncZone"),description:m.lmsg("hintSyncZone"),addCls:"sb-dns-zone-sync",href:n["sync-zone"]}:null,{componentType:a.bar.Separator},{componentType:a.SmallButton,id:"buttonRemoveRecord",title:m.lmsg("remove"),description:m.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(e){var t;const l=(0,a.getComponent)("dns-zone-records"),r=l.getSelectedItems(),s="off"!==i?"host":"ns";l.execGroupOperation({url:n.delete,subtype:a.messageBox.SUBTYPE_DELETE,mouseEvent:e,text:m.formatMessage("confirmOnDelete",{host:`<b>${(0,a.escapeHtml)(null===(t=r[0])||void 0===t?void 0:t[s])}</b>`,count:r.length}),onSuccess:u})}}]:[]})]})))};i.propTypes={name:o().string.isRequired,dnsRecordsList:o().object.isRequired,urls:o().object.isRequired,applyButton:o().bool.isRequired,manageDns:o().bool.isRequired,dnsZoneStatus:o().string.isRequired,isZoneCreated:o().bool.isRequired,syncZone:o().bool.isRequired},t.default=i},1006:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l.default});var l=n(1007)}}]);
//# sourceMappingURL=records-list.js.map?d81c26c29b4c004777fb