import{_ as t}from"./index.js?v=1763625242172";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{a2 as e,ar as s,as as l,at as n,m as o,au as c,o as u,av as i,p as r}from"./page_layout.js?v=1763625242172";import{k as p,a0 as d,R as _,S as v,X as f,a3 as m,U as x,a4 as b,V as S,j as y,r as w,a2 as P,aj as $,P as g,c as k,H as C,an as j}from"./vue.js?v=1763625242172";import{a as h}from"./public.js?v=1763625242172";import{_ as A}from"./index99.js?v=1763625242172";import{d9 as R,aC as I,df as U,dP as B,dS as M,au as L}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const z={class:"p-10"},H={class:"w-48%"},E={class:"mb-8px"},F={class:"w-48%"},T={class:"mb-8px"},V=p({__name:"SslForm",setup(t){const a=e(),{certInfo:l}=d(a);return(t,a)=>{const e=A,n=R,o=I;return _(),v("div",z,[f(n,{class:"mb-16px",size:10,justify:"space-between"},{default:m((()=>[x("div",H,[x("div",E,b(t.$t("Site.Cert.index_50")),1),f(e,{value:S(l).private_key,"onUpdate:value":a[0]||(a[0]=t=>S(l).private_key=t),rows:10},null,8,["value"])]),x("div",F,[x("div",T,b(t.$t("Site.Cert.index_51")),1),f(e,{value:S(l).certificate,"onUpdate:value":a[1]||(a[1]=t=>S(l).certificate=t),rows:10},null,8,["value"])])])),_:1}),f(n,{class:"mb-12px"},{default:m((()=>[f(o,{type:"primary",onClick:a[2]||(a[2]=t=>S(s)(S(l).certificate,S(l).private_key))},{default:m((()=>[y(b(t.$t("Public.Btn.Save")),1)])),_:1})])),_:1})])}}}),X={class:"w-300px host-modify"},q=p({__name:"server-port",setup(t){const a=e(),{port:s}=d(a),n=w(s.value),o=s.value,c=async()=>{try{await l(n.value),s.value=n.value}catch(t){n.value=o}};return(t,a)=>{const e=U,s=I,l=B;return _(),P(l,{label:t.$t("Site.TableRow.index_16"),"show-feedback":!1},{default:m((()=>[x("div",X,[f(e,{"show-button":!1,value:S(n),"onUpdate:value":a[0]||(a[0]=t=>$(n)?n.value=t:null),placeholder:""},null,8,["value"])]),f(s,{type:"primary",class:"ml-8px",onClick:c},{default:m((()=>[y(b(t.$t("Public.Btn.Modify")),1)])),_:1})])),_:1},8,["label"])}}}),D={class:"flex items-center"},G={class:"mr-4px text-13px"},J={class:"mr-4px"},K={class:"w-300px host-modify"},N=r(p({__name:"index",setup(s){const{t:l}=g(),r=e(),{isRunning:p,serverIP:v,serverProtocol:A,version:U,port:z}=d(r),H=k((()=>n(U.value,"2.1.9"))),E=w(!1),F=new Map([["start",l("Public.Status.Start")],["stop",l("Public.Status.Stop")],["reload",l("Public.Status.Reload")],["restart",l("Public.Status.Restart")]]),T=t=>{const a=F.get(t)||"";h({title:l("Account.Settings.index_11",[a]),content:l("Account.Settings.index_12",[a.toLocaleLowerCase()]),onConfirm:async()=>{await i(t),r.getInfo()}})},X=()=>{T(p.value?"stop":"start")},N=()=>{T("reload")},O=()=>{T("restart")},Q=async()=>{""!==v.value?await c(v.value):o.error(l("Account.Settings.index_13"))},W=()=>{r.resetServerIP()};function Y(){window.open("".concat(A.value,"://").concat(v.value,":").concat(z.value,"/account/login"))}return r.getCertInfo(),r.getServerIP(),(e,s)=>{const l=R,n=I,o=B,c=L,i=u,r=a,d=t,w=M;return _(),P(w,{class:"p-16px px-24px"},{default:m((()=>[f(r,null,{default:m((()=>[f(o,{label:e.$t("Account.Settings.index_14")},{default:m((()=>[x("div",D,[x("span",G,b(e.$t("Account.Settings.index_10")),1),f(l,{class:"items-center",size:4},{default:m((()=>[x("span",J,b(S(p)?e.$t("Public.Status.Enable"):e.$t("Public.Status.Stopped")),1),x("span",{class:C(["iconfont","icon-".concat(S(p)?"start":"stop")])},null,2)])),_:1})]),f(n,{class:"ml-24px",onClick:X},{default:m((()=>[y(b(S(p)?e.$t("Public.Status.Stop"):e.$t("Public.Status.Start")),1)])),_:1}),f(n,{class:"ml-8px",onClick:O},{default:m((()=>[y(b(e.$t("Public.Status.Restart")),1)])),_:1}),f(n,{class:"ml-8px",onClick:N},{default:m((()=>[y(b(e.$t("Public.Status.Reload")),1)])),_:1})])),_:1},8,["label"]),f(o,{label:"SSL"},{default:m((()=>[f(n,{type:"primary",onClick:s[0]||(s[0]=t=>E.value=!0)},{default:m((()=>[y(b(e.$t("Public.Btn.Modify")),1)])),_:1})])),_:1}),f(o,{label:e.$t("Account.Settings.index_15")},{default:m((()=>[x("div",K,[f(c,{value:S(v),"onUpdate:value":s[1]||(s[1]=t=>$(v)?v.value=t:null),placeholder:""},null,8,["value"])]),f(n,{type:"primary",class:"ml-8px",onClick:Q},{default:m((()=>[y(b(e.$t("Public.Btn.Modify")),1)])),_:1}),f(n,{class:"ml-8px",onClick:W},{default:m((()=>[y(b(e.$t("Public.Btn.Reset")),1)])),_:1})])),_:1},8,["label"]),S(H)?(_(),P(q,{key:0})):j("",!0),f(o,{label:" ","show-feedback":!1},{default:m((()=>[x("div",null,[y(b(e.$t("Account.Settings.index_9"))+" ",1),f(i,{onClick:Y},{default:m((()=>[y(b("".concat(S(A),"://").concat(S(v),":").concat(S(z),"/account/login")),1)])),_:1})])])),_:1})])),_:1}),f(d,{show:S(E),"onUpdate:show":s[2]||(s[2]=t=>$(E)?E.value=t:null),title:e.$t("Account.Settings.index_16"),width:700,component:V},null,8,["show","title"])])),_:1})}}}),[["__scopeId","data-v-f1439041"]]);export{N as default};
