1import{r as Y,a as y,s as H,u as R,_ as j,b as J,c as O,d as W,n as x,e as G,f as K,g as Q,m as X,h as Z}from"./index-mGgJqOFQ.js";import{d as ee,y as se,ak as ae,aU as te,E as d,J as ne,i as oe,at as le,o as p,c as b,F as $,b as s,w as o,q as i,t as u,au as F,g,u as w,f as re,aa as ie,a as ue,a8 as me,j as de,bk as pe,bl as ce,V as _e}from"./core-Cu1dlvv4.js";import{u as fe}from"./useAutoModal-CaK8mTFj.js";import{_ as ve}from"./DomainForm.vue_vue_type_script_setup_true_lang-Bppg_2GX.js";const be={class:"post-install"},ge=["innerHTML"],we={class:"alert alert-info"},ye={class:"alert alert-success"},Ve=ee({__name:"PostInstall",setup($e){const{t:n}=se(),D=fe(),{installed:E}=ae();E.value?Y.push({name:"home"}):te().init();const l=d("start"),c=d(""),k=d(!1),h=d(""),P=d(),_=d({username:"",fullname:"",password:"",confirmation:""}),S={alert:{component:"ReadOnlyAlertItem",cProps:{label:n("postinstall.user.first_user_help"),type:"info"}},username:{component:"InputItem",label:n("user_username"),rules:{required:y,alphalownumdot_:G},cProps:{id:"username",placeholder:n("placeholder.username"),autocapitalize:"off",spellcheck:"false"}},fullname:{component:"InputItem",label:n("user_fullname"),rules:{required:y,name:x},cProps:{id:"fullname",placeholder:n("placeholder.fullname"),spellcheck:"false"}},password:{component:"InputItem",label:n("password"),description:n("good_practices_about_admin_password"),descriptionVariant:"warning",rules:{required:y,passwordLenght:X(8)},cProps:{id:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",type:"password"}},confirmation:ne({component:"InputItem",label:n("password_confirmation"),rules:oe(()=>({required:y,passwordMatch:H(_.value.password)})),cProps:{id:"confirmation",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",type:"password"}})},{v:L,onSubmit:N,serverErrors:T}=R(_,S);function f(e){c.value="",l.value=e}function U(e){h.value=e.domain,P.value=e.dyndns_recovery_password,f("user")}const q=N(async()=>{await D(n("confirm_postinstall",{domain:h.value}))&&A()});async function A(e=!1){const{username:a,fullname:v,password:I}=_.value,C=await pe({domain:h.value,dyndns_recovery_password:P.value,username:a,fullname:v,password:I},{removeEmpty:!0});ce.post({uri:"postinstall"+(e?"?force_diskspace":""),data:C}).then(()=>{E.value=!0,f("login")}).catch(t=>{const m=V=>V.some(B=>(t.key||t.message).includes(B));if(!(t instanceof _e))throw t;t.key==="postinstall_low_rootfsspace"?(l.value="rootfsspace-error",c.value=t.message):m(["domain","dyndns"])?(l.value="domain",c.value=t.message):(l.value="user",T.global=[t.message])})}return(e,a)=>{const v=j,I=J,C=O,t=re,m=W,V=K,B=me,z=Z,M=le("t");return p(),b("div",be,[l.value==="start"?(p(),b($,{key:0},[s(v,{variant:"success",icon:"thumbs-up"},{default:o(()=>[i(u(e.$t("postinstall_intro_1")),1)]),_:1}),s(v,{variant:"info"},{default:o(()=>[F(g("span",null,null,512),[[M,"postinstall_intro_2"]]),a[6]||(a[6]=g("br",null,null,-1)),g("span",{innerHTML:e.$t("postinstall_intro_3")},null,8,ge)]),_:1}),s(v,{variant:"warning"},{default:o(()=>[s(I,{label:w(n)("tos.postinstall_acknowledgement"),class:"mb-2"},null,8,["label"]),s(C,{modelValue:k.value,"onUpdate:modelValue":a[0]||(a[0]=r=>k.value=r),label:w(n)("tos.i_agree")},null,8,["modelValue","label"])]),_:1}),s(t,{size:"lg",variant:"success",disabled:!k.value,onClick:a[1]||(a[1]=r=>f("domain"))},{default:o(()=>[i(u(e.$t("begin")),1)]),_:1},8,["disabled"])],64)):l.value==="domain"?(p(),b($,{key:1},[s(w(ve),{postinstall:"","submit-text":e.$t("next"),"server-error":c.value,title:e.$t("postinstall_set_domain"),onSubmit:U},{disclaimer:o(()=>[F(g("p",we,null,512),[[M,"postinstall_domain"]])]),_:1},8,["submit-text","server-error","title"]),s(t,{variant:"primary",class:"mt-3",onClick:a[2]||(a[2]=r=>f("start"))},{default:o(()=>[s(m,{iname:"chevron-left"}),i(" "+u(e.$t("previous")),1)]),_:1})],64)):l.value==="user"?(p(),b($,{key:2},[s(V,{modelValue:_.value,"onUpdate:modelValue":a[3]||(a[3]=r=>_.value=r),fields:S,icon:"user-plus","submit-text":e.$t("next"),title:e.$t("postinstall.user.title"),validations:w(L),onSubmit:ie(w(q),["prevent"])},null,8,["modelValue","submit-text","title","validations","onSubmit"]),s(t,{variant:"primary",class:"mt-3",onClick:a[4]||(a[4]=r=>f("domain"))},{default:o(()=>[s(m,{iname:"chevron-left"}),i(" "+u(e.$t("previous")),1)]),_:1})],64)):l.value==="rootfsspace-error"?(p(),ue(z,{key:3,"no-body":"","header-class":"d-none","footer-bg-variant":"danger"},{buttons:o(()=>[s(t,{variant:"light",size:"sm",onClick:a[5]||(a[5]=r=>A(!0))},{default:o(()=>[s(m,{iname:"warning"}),i(" "+u(e.$t("postinstall.force")),1)]),_:1})]),default:o(()=>[s(B,{class:"alert alert-danger m-0"},{default:o(()=>[i(u(c.value),1)]),_:1})]),_:1})):l.value==="login"?(p(),b($,{key:4},[g("p",ye,[s(m,{iname:"thumbs-up"}),i(" "+u(e.$t("installation_complete")),1)]),s(Q)],64)):de("",!0)])}}});
1export{Ve as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.