import{L as P,a7 as q,a8 as G,a9 as H,_ as J,x as K,m as O,aa as Q,h as W,ab as Y,c as tt}from"./index-BTglIPU2.js?v=1773287522785";import{_ as et}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{k as C,a6 as h,$ as g,Z as st,a0 as t,a9 as e,_ as c,aa as u,S as n,j as r,r as A,a8 as y,X as k,R as nt,c as ot,L as at,ak as lt}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{_ as ut}from"./index-CZps0rIN.js?v=1773287522785";import{k as I,B as R,a1 as V,_ as it,b as ct,a2 as rt}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const _t={class:"p-10"},pt={class:"w-48%"},dt={class:"mb-8px"},mt={class:"w-48%"},ft={class:"mb-8px"},vt=C({__name:"SslForm",setup(B){const i=P(),{certInfo:o}=h(i);return(l,a)=>{const m=ut,p=I,f=R;return g(),st("div",_t,[t(p,{class:"mb-16px",size:10,justify:"space-between"},{default:e(()=>[c("div",pt,[c("div",dt,u(l.$t("Site.Cert.index_50")),1),t(m,{value:n(o).private_key,"onUpdate:value":a[0]||(a[0]=d=>n(o).private_key=d),rows:10},null,8,["value"])]),c("div",mt,[c("div",ft,u(l.$t("Site.Cert.index_51")),1),t(m,{value:n(o).certificate,"onUpdate:value":a[1]||(a[1]=d=>n(o).certificate=d),rows:10},null,8,["value"])])]),_:1}),t(p,{class:"mb-12px"},{default:e(()=>[t(f,{type:"primary",onClick:a[2]||(a[2]=d=>n(q)(n(o).certificate,n(o).private_key))},{default:e(()=>[r(u(l.$t("Public.Btn.Save")),1)]),_:1})]),_:1})])}}}),St={class:"w-300px host-modify"},bt=C({__name:"server-port",setup(B){const i=P(),{port:o}=h(i),l=A(o.value),a=o.value,m=async()=>{try{await G(l.value),o.value=l.value}catch(p){l.value=a}};return(p,f)=>{const d=it,v=R,w=V;return g(),y(w,{label:p.$t("Site.TableRow.index_16"),"show-feedback":!1},{default:e(()=>[c("div",St,[t(d,{"show-button":!1,value:n(l),"onUpdate:value":f[0]||(f[0]=b=>k(l)?l.value=b:null),placeholder:""},null,8,["value"])]),t(v,{type:"primary",class:"ml-8px",onClick:m},{default:e(()=>[r(u(p.$t("Public.Btn.Modify")),1)]),_:1})]),_:1},8,["label"])}}}),$t={class:"flex items-center"},xt={class:"mr-4px text-13px"},gt={class:"w-300px host-modify"},wt=C({__name:"index",setup(B){const{t:i}=nt(),o=P(),{isRunning:l,serverIP:a,serverProtocol:m,version:p,port:f}=h(o),d=ot(()=>H(p.value,"2.1.9")),v=A(!1),w=new Map([["start",i("Public.Status.Start")],["stop",i("Public.Status.Stop")],["reload",i("Public.Status.Reload")],["restart",i("Public.Status.Restart")]]),b=s=>{const _=w.get(s)||"";W({title:i("Account.Settings.index_11",[_]),content:i("Account.Settings.index_12",[_.toLocaleLowerCase()]),onConfirm:async()=>{await Y(s),o.getInfo()}})},L=()=>{b(l.value?"stop":"start")},M=()=>{b("reload")},U=()=>{b("restart")},N=async()=>{if(a.value===""){O.error(i("Account.Settings.index_13"));return}await Q(a.value)},T=()=>{o.resetServerIP()};o.getCertInfo(),o.getServerIP();function j(){window.open("".concat(m.value,"://").concat(a.value,":").concat(f.value,"/account/login"))}return(s,_)=>{const z=I,S=R,$=V,E=ct,D=J,F=et,X=K,Z=rt;return g(),y(Z,{class:"p-16px px-24px"},{default:e(()=>[t(F,null,{default:e(()=>[t($,{label:s.$t("Account.Settings.index_14")},{default:e(()=>[c("div",$t,[c("span",xt,u(s.$t("Account.Settings.index_10")),1),t(z,{class:"items-center",size:4},{default:e(()=>[c("span",null,u(n(l)?s.$t("Public.Status.Enable"):s.$t("Public.Status.Stopped")),1),c("span",{class:at(["text-14px","".concat(n(l)?"i-mage:play-fill text-primary":"i-mage:pause-fill text-error")])},null,2)]),_:1})]),t(S,{class:"ml-24px",onClick:L},{default:e(()=>[r(u(n(l)?s.$t("Public.Status.Stop"):s.$t("Public.Status.Start")),1)]),_:1}),t(S,{class:"ml-8px",onClick:U},{default:e(()=>[r(u(s.$t("Public.Status.Restart")),1)]),_:1}),t(S,{class:"ml-8px",onClick:M},{default:e(()=>[r(u(s.$t("Public.Status.Reload")),1)]),_:1})]),_:1},8,["label"]),t($,{label:"SSL"},{default:e(()=>[t(S,{type:"primary",onClick:_[0]||(_[0]=x=>v.value=!0)},{default:e(()=>[r(u(s.$t("Public.Btn.Modify")),1)]),_:1})]),_:1}),t($,{label:s.$t("Account.Settings.index_15")},{default:e(()=>[c("div",gt,[t(E,{value:n(a),"onUpdate:value":_[1]||(_[1]=x=>k(a)?a.value=x:null),placeholder:""},null,8,["value"])]),t(S,{type:"primary",class:"ml-8px",onClick:N},{default:e(()=>[r(u(s.$t("Public.Btn.Modify")),1)]),_:1}),t(S,{class:"ml-8px",onClick:T},{default:e(()=>[r(u(s.$t("Public.Btn.Reset")),1)]),_:1})]),_:1},8,["label"]),n(d)?(g(),y(bt,{key:0})):lt("",!0),t($,{label:" ","show-feedback":!1},{default:e(()=>[c("div",null,[r(u(s.$t("Account.Settings.index_9"))+" ",1),t(D,{onClick:j},{default:e(()=>[r(u("".concat(n(m),"://").concat(n(a),":").concat(n(f),"/account/login")),1)]),_:1})])]),_:1})]),_:1}),t(X,{show:n(v),"onUpdate:show":_[2]||(_[2]=x=>k(v)?v.value=x:null),title:s.$t("Account.Settings.index_16"),width:700,component:vt},null,8,["show","title"])]),_:1})}}}),Bt=tt(wt,[["__scopeId","data-v-c4d3835c"]]);export{Bt as default};
