← Back
Editing: index472.js
import{at as e,b as t,a2 as a,L as s,e as r}from"./utils-lib.js?v=VERSION_NUMBER";import{r as o,o as n,c as l,k as c,Z as u,q as i,v as m,e as _,x as p}from"./base-lib.js?v=VERSION_NUMBER";import{getProxyConfigFile as v,saveProxyConfigFile as d}from"./site.js?v=VERSION_NUMBER";import{u as f}from"./useStore4.js?v=VERSION_NUMBER";const b=t(),{siteInfo:g}=f(),h=o("master"),y=o("server_block"),x=[{label:"server块",value:"server_block"},{label:"HTTP块",value:"http_block"}],k=[{content:"主配置文件不允许修改,如需自定义配置请到上方自定义配置文件中操作"}],j=[{content:"保存前请检查输入的配置文件是否正确,错误的配置可能会导致网站访问异常"},{content:"如果您对此配置不熟悉,请勿添加自定义配置"},{isHtml:!0,content:'server块的nginx官方配置文档:<a class="text-primary cursor-pointer" href="https://nginx.org/en/docs/http/ngx_http_core_module.html#server" target="_blank" rel="noreferrer noopener">点击跳转</a>'}],T=[{content:"保存前请检查输入的配置文件是否正确,错误的配置可能会导致网站访问异常"},{content:"如果您对此配置不熟悉,请勿添加自定义配置"},{isHtml:!0,content:'http块的nginx官方配置文档:<a class="text-primary cursor-pointer" href="https://nginx.org/en/docs/http/ngx_http_core_module.html#http" target="_blank" rel="noreferrer noopener">点击跳转</a>'}],L=o(j),E=o(""),H=o(!1),I=async()=>{try{H.value=!0;const{data:e}=await v({site_name:g.value.name});return e.status?"master"===h.value?E.value=e.data.site_conf:(E.value=e.data[y.value],L.value="server_block"===y.value?j:T):b.error(e.msg),{data:E.value}}catch(e){return{data:""}}finally{H.value=!1}};n((()=>{b.error("主配置文件不允许修改,如需自定义配置请到上方自定义配置文件中操作")}),3e3);const O=async()=>{if("master"===h.value)return{status:!1,msg:"主配置文件不允许修改,如需自定义配置请到上方自定义配置文件中操作"};let t=b.load("正在保存内容,请稍候...");try{const e=await d({site_name:g.value.name,conf_type:y.value,body:E.value});b.msg({dangerouslyUseHTMLString:!0,message:e.msg,type:e.status?"success":"error",duration:e.status?2e3:0,showClose:!e.status})}catch(a){return e(a),{status:!1,msg:"保存文件失败"}}finally{t.close()}},P=r(l({__name:"index",props:{compData:{default:()=>({})}},setup(e){const t=c({site_conf:"",http_block:"",server_block:""});u("configList",t),u("tabActive",h);const{BtTabs:r}=a({type:"card",value:h,options:[{label:"主配置文件",name:"master",lazy:!0,render:()=>s((()=>import("./files2.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url)},{label:"自定义配置文件",name:"custom",lazy:!0,render:()=>s((()=>import("./files2.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url)}]}),o=e=>{h.value=e};return(e,t)=>(i(),m("div",null,[_(p(r),{onChange:o})]))}}),[["__scopeId","data-v-25f9fcdd"]]),S=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"}));export{x as a,H as b,O as c,L as d,y as f,I as g,k as h,S as i,E as s,h as t}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel