Viewing File: /usr/local/cpanel/whostmgr/docroot/templates/initial-setup-wizard/566.a0bbdbfbcd9bccd3.js
"use strict";(self.webpackChunkinitial_setup_wizard=self.webpackChunkinitial_setup_wizard||[]).push([[566],{6566:(T,c,o)=>{o.r(c),o.d(c,{ServerSetupModule:()=>k});var p=o(6895),i=o(4719),v=o(269),u=o(2777),d=o(2502),g=o(6154),C=o(537);const _=n=>{const{controls:{ns1:a,ns2:t}}=n;if((a.value||t.value)&&(!a.value||!t.value)&&(a.value||t.value))return{both_ns:!0}},f=n=>{if(n.value.trim())return d.Xz.fqdn()(n)};var M=o(1221),e=o(6738),h=o(5419);function P(n,a){if(1&n&&(e.TgZ(0,"div",19),e._UZ(1,"i",20),e._uU(2),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.hij(" ",t.locale.maketext("The email must contain a username and a domain.")," ")}}function O(n,a){if(1&n&&(e.TgZ(0,"div",19),e._UZ(1,"i",20)(2,"span",21),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("innerHTML",t.getError(t.form.controls.ns1).message,e.oJD)}}function x(n,a){if(1&n&&(e.TgZ(0,"div",19),e._UZ(1,"i",20)(2,"span",21),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("innerHTML",t.getError(t.form.controls.ns2).message,e.oJD)}}function Z(n,a){if(1&n&&(e.TgZ(0,"div",19),e._UZ(1,"i",20)(2,"span",21),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("innerHTML",t.locale.maketext("You must either specify [output,strong,both] nameservers, or specify none to configure your nameservers later."),e.oJD)}}let y=(()=>{class n extends u.h{constructor(t,r,s,m,l){super(t),this.locale=t,this.page=r,this.whmapi=s,this.window=m,this.continueLabel=this.locale.maketext("Finish"),this.cancelLabel=this.locale.maketext("Skip"),this.canContinue=!0,this.loading=!1,d.uZ.locale=t,this.form=l.group({ns1:l.control(this.page.nameservers[0],[f]),ns2:l.control(this.page.nameservers[1],[f]),email:l.control(this.page.email,[i.kI.email])},{validators:[_]})}next(){if(this.loading||this.form.invalid)return;this.loading=!0;var t=this.page.email!==this.form.get("email").value,r=[this.form.get("ns1").value,this.form.get("ns2").value].some((m,l)=>m!==this.page.nameservers[l]);if(!t&&!r)return void this.exit();const s=[];t&&s.push(this.whmapi.post(new g.r(g.N.JsonApi,{method:"update_contact_email",arguments:[{name:"contact_email",value:this.form.get("email").value}]}))),r&&s.push(this.whmapi.post(new g.r(g.N.JsonApi,{method:"update_nameservers_config",arguments:[{name:"nameserver",value:this.form.get("ns1").value},{name:"nameserver2",value:this.form.get("ns2").value}]}))),(0,M.z)(...s).pipe((0,C.x)(()=>this.loading=!1)).subscribe(()=>this.exit())}exit(){this.window.location.href="./initial_setup_wizard1_do"}getError(t){if(Object.keys(t.errors).length)return t.errors[Object.keys(t.errors)[0]]}cancel(){this.exit()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(v.g),e.Y36(u.q),e.Y36(h.A4),e.Y36(Window),e.Y36(i.qu))},n.\u0275cmp=e.Xpm({type:n,selectors:[["isw-server-setup"]],features:[e.qOj],decls:38,vars:17,consts:[[1,"server-setup"],[1,"form",3,"formGroup","ngSubmit"],[1,"form-group"],["for","email"],[1,"optional"],["href","https://go.cpanel.net/datapolicy","target","privacyPolicy","rel","noopener noreferrer","id","privacy-policy-link"],[1,"ri-external-link-line"],[1,"help-text"],["formControlName","email","id","email","type","email",3,"placeholder"],["class","invalid-feedback",4,"ngIf"],["for","ns1"],["href","https://go.cpanel.net/PrivateNameservers","target","nameserversDocumentation","rel","noopener noreferrer","id","nameservers-documentation-link"],[1,"input-group","mb-2"],["formControlName","ns1","type","text","id","ns1",3,"placeholder"],["id","reset-ns1-button","type","button",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"ri-arrow-go-back-line"],["formControlName","ns2","type","text","id","ns2",3,"placeholder"],["id","reset-ns2-button","type","button",1,"btn","btn-outline-secondary",3,"click"],["type","submit",1,"sr-only"],[1,"invalid-feedback"],["aria-hidden","true",1,"ri-error-warning-line"],[3,"innerHTML"]],template:function(t,r){1&t&&(e.TgZ(0,"div",0)(1,"form",1),e.NdJ("ngSubmit",function(){return r.next()}),e.TgZ(2,"div",2)(3,"label",3),e._uU(4),e.TgZ(5,"span",4),e._uU(6,"(optional)"),e.qZA()(),e.TgZ(7,"a",5),e._uU(8),e._UZ(9,"i",6),e.qZA(),e.TgZ(10,"span",7),e._uU(11),e.qZA(),e._UZ(12,"input",8),e.YNc(13,P,3,1,"div",9),e.qZA(),e.TgZ(14,"div",2)(15,"label",10),e._uU(16),e.TgZ(17,"span",4),e._uU(18,"(optional)"),e.qZA()(),e.TgZ(19,"a",11),e._uU(20),e._UZ(21,"i",6),e.qZA(),e.TgZ(22,"span",7),e._uU(23),e.qZA(),e.TgZ(24,"div",12),e._UZ(25,"input",13),e.TgZ(26,"button",14),e.NdJ("click",function(){return r.form.controls.ns1.reset(r.page.nameservers[0])}),e._UZ(27,"i",15),e._uU(28),e.qZA()(),e.YNc(29,O,3,1,"div",9),e.TgZ(30,"div",12),e._UZ(31,"input",16),e.TgZ(32,"button",17),e.NdJ("click",function(){return r.form.controls.ns2.reset(r.page.nameservers[1])}),e._UZ(33,"i",15),e._uU(34),e.qZA()(),e.YNc(35,x,3,1,"div",9),e.YNc(36,Z,3,1,"div",9),e.qZA(),e._UZ(37,"button",18),e.qZA()()),2&t&&(e.xp6(1),e.Q6J("formGroup",r.form),e.xp6(3),e.hij("",r.locale.maketext("Email Address")," "),e.xp6(4),e.hij(" ",r.locale.maketext("Privacy Policy")," "),e.xp6(3),e.Oqu(r.locale.maketext("Your server will send status and error notifications to this address.")),e.xp6(1),e.Q6J("placeholder",r.locale.maketext("Your contact email address. For example, [asis,user@example.com].")),e.xp6(1),e.Q6J("ngIf",r.form.controls.email.invalid),e.xp6(3),e.hij("",r.locale.maketext("Nameservers")," "),e.xp6(4),e.hij(" ",r.locale.maketext("Learn More")," "),e.xp6(3),e.AsE(" ",r.locale.maketext("Your server requires nameservers before you can create [asis,cPanel] or reseller accounts.")," ",r.locale.maketext("Nameservers convert domain names into server IP addresses so that visitors can access your websites.")," "),e.xp6(2),e.Q6J("placeholder",r.locale.maketext("Your primary nameserver. For example, [asis,ns1.example.com].")),e.xp6(3),e.hij(" ",r.locale.maketext("Reset")," "),e.xp6(1),e.Q6J("ngIf",r.form.controls.ns1.invalid),e.xp6(2),e.Q6J("placeholder",r.locale.maketext("Your secondary nameserver. For example, [asis,ns2.example.com].")),e.xp6(3),e.hij(" ",r.locale.maketext("Reset")," "),e.xp6(1),e.Q6J("ngIf",r.form.controls.ns2.invalid),e.xp6(1),e.Q6J("ngIf",null==r.form.errors?null:r.form.errors.both_ns))},directives:[i._Y,i.JL,i.sg,i.Fj,i.JJ,i.u,p.O5],styles:[".server-setup[_ngcontent-%COMP%]{text-align:center;margin:4em auto}.form[_ngcontent-%COMP%]{display:inline-block;width:400px;max-width:100%}.form-group[_ngcontent-%COMP%]{width:100%;font-size:.9em}html[dir=ltr][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%]{text-align:left}html[dir=rtl][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%]{text-align:right}.form-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{margin:var(--cp-spacer-2) 0}.form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-weight:400}html[dir=ltr][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{float:right}html[dir=rtl][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .form-group[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{float:left}.form-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;width:100%;border-radius:var(--cp-spacer-1);border:1px solid var(--bs-gray-400);padding:var(--cp-spacer-2)}.form-group[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{width:100%;flex-wrap:nowrap;margin:var(--cp-spacer-2) 0}.form-group[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .btn.btn-outline-secondary[_ngcontent-%COMP%]{background-color:var(--bs-gray-300)}.form-group[_ngcontent-%COMP%] .optional[_ngcontent-%COMP%]{color:var(--bs-gray-600);font-weight:300}.form-group[_ngcontent-%COMP%] .help-text[_ngcontent-%COMP%]{display:block;color:var(--bs-gray-600);font-weight:lighter}.invalid-feedback[_ngcontent-%COMP%]{display:block}"]}),n})();var S=o(5812);const b=[{path:"",component:y,data:{animation:"ServerSetup"}}];let k=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[h.A4],imports:[[p.ez,i.UX,S.Bz.forChild(b)]]}),n})()}}]);
Back to Directory
File Manager