Safe3-openresty-manager/frontend/dist/assets/setting-D8SupPZd.js
UUSEC Technology 12467d8fd1 open source
2025-04-30 13:05:17 +08:00

1 line
8.8 KiB
JavaScript

import{B as V,_ as j}from"./index-DF6QHY1m.js";import{C as M}from"./index-CTAcoXCL.js";import{d as B,r as g,L as H,F as S,M as F,c as t,N as n,O as T,i as I,Q as u,R as N,S as v,T as a,U as l,V as b,ab as k,$ as q}from"./index-sY8U2mN5.js";import{F as P,_ as Z,a as D}from"./TextArea-eBr-9_0I.js";import{B as E}from"./Col-CfXYHSRU.js";import"./useRefs-BdmXd5te.js";const O={style:{display:"flex","align-items":"center"}},A={class:"card-title"},Q={style:{display:"flex","align-items":"center"}},W={class:"card-title"},G={style:{color:"gray","margin-top":"15px"}},J={style:{color:"gray","margin-top":"10px"}},K={style:{color:"gray","margin-top":"10px"}},X={style:{color:"gray","margin-top":"15px"}},Y={style:{display:"flex","align-items":"center"}},ee={class:"card-title"},oe={style:{color:"gray","margin-top":"15px"}},te={style:{color:"gray","margin-top":"10px"}},le=B({__name:"setting",setup(se){const p=g(!1),m=I("$http"),f=g(),w=g("0.0.0"),h=g("0.0.0"),s=H({resolver:"",real_ip:"",ssl:"",gzip:"",cache:"",hsts:"",force_ssl:"",proxy:"",proxy_ip:"",websocket:"",error_page:"",log:""}),x={ssl:[{required:!0,message:"不能为空",trigger:"change",transform(e){return e.trim()}}],proxy:[{required:!0,message:"不能为空",trigger:"change",transform(e){return e.trim()}}]},C=()=>{m.get("/admin/version").then(e=>{e.error?u.error(e.error):(w.value=e.latest_version,h.value=e.version)}).catch(e=>{console.log("error",e)})},R=()=>{C(),m.get("/admin/om_config").then(e=>{e.error?u.error(e.error):Object.assign(s,e)}).catch(e=>{console.log("error",e)})},$=()=>{f.value.validate().then(()=>{m({url:"/admin/om_config",method:"PUT",data:s}).then(e=>{e.error?u.error(e.error):u.success("应用成功")}).catch(e=>{console.log("error",e)})}).catch(e=>{console.log("error",e)})},L=()=>{p.value=!0,m.get("/admin/update").then(e=>{e.error?u.error(e.error):(u.success("升级成功"),setTimeout(()=>{window.location.reload()},3e3)),p.value=!1}).catch(e=>{console.log("error",e),p.value=!1})};return S(()=>{R()}),(e,o)=>{const _=j,z=V,d=D,i=Z,y=E,U=P,c=M;return N(),F(T,null,[t(z,{style:{margin:"16px 0"}},{default:n(()=>[t(_,null,{default:n(()=>[v(a(e.$t("common.navigation")),1)]),_:1}),t(_,null,{default:n(()=>[v(a(e.$t("menu.setting")),1)]),_:1})]),_:1}),t(c,{hoverable:"",bordered:!1,style:{"margin-bottom":"24px","min-width":"500px"}},{default:n(()=>[l("div",O,[o[14]||(o[14]=l("div",{style:{display:"flex"}},[l("svg",{width:"18",height:"18",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M36.686 15.171C37.9364 16.9643 38.8163 19.0352 39.2147 21.2727H44V26.7273H39.2147C38.8163 28.9648 37.9364 31.0357 36.686 32.829L40.0706 36.2137L36.2137 40.0706L32.829 36.686C31.0357 37.9364 28.9648 38.8163 26.7273 39.2147V44H21.2727V39.2147C19.0352 38.8163 16.9643 37.9364 15.171 36.686L11.7863 40.0706L7.92939 36.2137L11.314 32.829C10.0636 31.0357 9.18372 28.9648 8.78533 26.7273H4V21.2727H8.78533C9.18372 19.0352 10.0636 16.9643 11.314 15.171L7.92939 11.7863L11.7863 7.92939L15.171 11.314C16.9643 10.0636 19.0352 9.18372 21.2727 8.78533V4H26.7273V8.78533C28.9648 9.18372 31.0357 10.0636 32.829 11.314L36.2137 7.92939L40.0706 11.7863L36.686 15.171Z",fill:"none",stroke:"#2dcecc","stroke-width":"4","stroke-linejoin":"round"}),l("path",{d:"M24 29C26.7614 29 29 26.7614 29 24C29 21.2386 26.7614 19 24 19C21.2386 19 19 21.2386 19 24C19 26.7614 21.2386 29 24 29Z",fill:"none",stroke:"#2dcecc","stroke-width":"4","stroke-linejoin":"round"})])],-1)),l("div",A,a(e.$t("setting.globalConfig")),1)]),t(U,{layout:"vertical",ref_key:"formRef",ref:f,model:s,rules:x,style:{"margin-top":"15px"}},{default:n(()=>[t(i,{label:e.$t("setting.resolver"),name:"resolver"},{default:n(()=>[t(d,{value:s.resolver,"onUpdate:value":o[0]||(o[0]=r=>s.resolver=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1},8,["label"]),t(i,{label:"Real IP",name:"real_ip"},{default:n(()=>[t(d,{value:s.real_ip,"onUpdate:value":o[1]||(o[1]=r=>s.real_ip=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1}),t(i,{label:e.$t("setting.ssl"),name:"ssl"},{default:n(()=>[t(d,{value:s.ssl,"onUpdate:value":o[2]||(o[2]=r=>s.ssl=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1},8,["label"]),t(i,{label:e.$t("setting.gzip"),name:"gzip"},{default:n(()=>[t(d,{value:s.gzip,"onUpdate:value":o[3]||(o[3]=r=>s.gzip=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1},8,["label"]),t(i,{label:e.$t("setting.cache"),name:"cache"},{default:n(()=>[t(d,{value:s.cache,"onUpdate:value":o[4]||(o[4]=r=>s.cache=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1},8,["label"]),t(i,{label:e.$t("setting.forceSsl"),name:"force_ssl"},{default:n(()=>[t(d,{value:s.force_ssl,"onUpdate:value":o[5]||(o[5]=r=>s.force_ssl=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1},8,["label"]),t(i,{label:"HSTS",name:"hsts"},{default:n(()=>[t(d,{value:s.hsts,"onUpdate:value":o[6]||(o[6]=r=>s.hsts=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1}),t(i,{label:e.$t("setting.proxy"),name:"proxy"},{default:n(()=>[t(d,{value:s.proxy,"onUpdate:value":o[7]||(o[7]=r=>s.proxy=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1},8,["label"]),t(i,{label:e.$t("setting.proxyIp"),name:"proxy_ip"},{default:n(()=>[t(d,{value:s.proxy_ip,"onUpdate:value":o[8]||(o[8]=r=>s.proxy_ip=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1},8,["label"]),t(i,{label:"Websocket",name:"websocket"},{default:n(()=>[t(d,{value:s.websocket,"onUpdate:value":o[9]||(o[9]=r=>s.websocket=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1}),t(i,{label:e.$t("setting.errorPage"),name:"error_page"},{default:n(()=>[t(d,{value:s.error_page,"onUpdate:value":o[10]||(o[10]=r=>s.error_page=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1},8,["label"]),t(i,{label:e.$t("setting.log"),name:"log"},{default:n(()=>[t(d,{value:s.log,"onUpdate:value":o[11]||(o[11]=r=>s.log=r),placeholder:"","auto-size":{minRows:3,maxRows:7}},null,8,["value"])]),_:1},8,["label"]),t(i,{style:{"margin-top":"30px"}},{default:n(()=>[t(y,{type:"primary",shape:"round",onClick:o[12]||(o[12]=r=>$())},{icon:n(()=>[t(b(k))]),default:n(()=>[v(" "+a(e.$t("setting.apply")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),t(c,{hoverable:"",bordered:!1,style:{"margin-bottom":"24px",height:"220px","min-width":"500px"}},{default:n(()=>[l("div",Q,[o[15]||(o[15]=l("div",{style:{display:"flex"}},[l("svg",{width:"18",height:"18",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M10.3654 41.6322C6.44902 37.9812 4 32.7766 4 27C4 15.9543 12.9543 7 24 7C35.0457 7 44 15.9543 44 27C44 32.7766 41.551 37.9812 37.6346 41.6322",stroke:"#2dcecc","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M15.1375 36.5109C12.5919 34.1378 11 30.7548 11 27C11 19.8203 16.8203 14 24 14C31.1797 14 37 19.8203 37 27C37 30.7548 35.4081 34.1378 32.8625 36.5109",stroke:"#2dcecc","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M19.9096 31.3897C18.7347 30.2944 18 28.733 18 27C18 23.6863 20.6863 21 24 21C27.3137 21 30 23.6863 30 27C30 28.733 29.2653 30.2944 28.0904 31.3897",stroke:"#2dcecc","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),l("div",W,a(e.$t("setting.sysInfo")),1)]),l("div",G,a(e.$t("setting.model")),1),l("div",J,a(e.$t("setting.latestVersion"))+" v"+a(w.value),1),l("div",K,a(e.$t("setting.version"))+" v"+a(h.value),1),l("div",X,[t(y,{type:"primary",shape:"round",loading:p.value,onClick:o[13]||(o[13]=r=>L())},{icon:n(()=>[t(b(k))]),default:n(()=>[v(" "+a(e.$t("setting.update")),1)]),_:1},8,["loading"])])]),_:1}),t(c,{hoverable:"",bordered:!1,style:{"margin-bottom":"24px",height:"220px","min-width":"500px"}},{default:n(()=>[l("div",Y,[o[16]||(o[16]=l("div",{style:{display:"flex"}},[l("svg",{width:"18",height:"18",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.6364 5H37.3636L45 18.3L24 43L3 18.3L10.6364 5Z",stroke:"#2dcecc","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M10.6362 5L23.9999 43L37.3635 5",stroke:"#2dcecc","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M3 18.3H45",stroke:"#2dcecc","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M15.4092 18.3L24.0001 5L32.591 18.3",stroke:"#2dcecc","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),l("div",ee,a(e.$t("setting.about")),1)]),l("div",oe,a(e.$t("setting.site"))+"https://www.uusec.com/ ",1),l("div",te,a(e.$t("setting.email"))+"[email protected] ",1),o[17]||(o[17]=l("div",{style:{color:"gray","margin-top":"10px"}}," Copyright @ 2022-2025 UUSEC. All Rights Reserved. ",-1))]),_:1})],64)}}}),pe=q(le,[["__scopeId","data-v-86bc19c5"]]);export{pe as default};