import{fO as a,n as e,aC as l,$ as s,V as t}from"./utils-lib.js?v=1761009159";import{c as n,q as o,H as i,v as r,x as u,y as d,N as p,Q as c,D as m,z as x,I as f,e as v,B as y,C as b,G as h,b1 as C}from"./base-lib.js?v=1761009159";import{aL as g}from"./validator.js?v=1761009159";import{i as k,c as w,d as V,t as _,a as j,b as B,e as S,s as F,h as N,r as O,v as U,f as q}from"./useController17.js?v=1761009159";import{u as E,S as H}from"./useStore4.js?v=1761009159";import{B as T}from"./index115.js?v=1761009159";const z={class:"h-full"},D={key:0},G={class:"w-full"},I={class:"my-[12px]"},L={key:1,class:"bg-[var(--el-base-tertiary)] flex items-center justify-center h-full",style:{"min-height":"600px"}},Q={class:"bg-lighter px-[48px] py-[16px] text-default flex"},$=n({__name:"index",setup(n,{expose:$}){const{isBindExtranet:A}=E(),{jumpTabEvent:J}=H(),K=()=>{let l;const{BtTable:s}=a({request:()=>({data:N.value,total:N.value.length}),columns:[{label:"文件名",render:a=>t(Number(a))},{label:"操作",align:"right",render:a=>{let e=Number(a);return v("div",null,[v("span",{class:"cursor-pointer bt-link",onClick:()=>{M(a)}},[b("查看")]),v(C,{direction:"vertical"},null),v("span",{class:"cursor-pointer bt-link",onClick:async()=>{if(await O(e)){const a=await l;null==a||a.unmount()}}},[b("恢复")])])}}]});l=e({title:"配置文件历史版本",area:42,showFooter:!1,component:()=>v("div",{class:"p-[20px]"},[v(s,{"max-height":400},null)])})},M=async a=>{await U(a);const l=e({title:"查看文件历史版本",area:64,showFooter:!1,component:()=>v("div",{class:"p-[20px]"},[v(h,{type:"primary",onClick:async()=>{if(await O(a)){const a=await l;null==a||a.unmount()}}},{default:()=>[b("恢复文件")]}),v(T,{class:"!h-[50rem] !w-full my-[12px]",modelValue:q.value,"onUpdate:modelValue":a=>q.value=a,editorOption:g({readonly:!0})},null)])})};return o(k),$({init:k}),(a,e)=>{const t=l,n=s,o=i("bt-loading");return r(),u("div",z,[d(A)?(r(),u("div",D,[d(w)?(r(),p(t,{key:0,type:"card",modelValue:d(V),"onUpdate:modelValue":e[0]||(e[0]=a=>c(V)?V.value=a:null),options:d(_),onChange:d(j)},null,8,["modelValue","options","onChange"])):m("",!0),x("div",G,[e[7]||(e[7]=x("span",{class:"my-[4px] text-secondary"},"提示：Ctrl+F 搜索关键字，Ctrl+S 保存，Ctrl+H 查找替换",-1)),x("div",I,[f(v(d(T),{class:"!h-[54rem] border-[1px] border-dark rounded-base",modelValue:d(S),"onUpdate:modelValue":e[1]||(e[1]=a=>c(S)?S.value=a:null),onSave:e[2]||(e[2]=a=>d(F)()),id:"configContent",editorOption:{mode:"ace/mode/nginx"}},null,8,["modelValue"]),[[o,d(B)]])]),x("div",null,[v(d(h),{type:"primary",onClick:e[3]||(e[3]=a=>d(F)())},{default:y(()=>e[5]||(e[5]=[b("保存",-1)])),_:1,__:[5]}),v(d(h),{onClick:K,type:"default"},{default:y(()=>e[6]||(e[6]=[b("历史文件",-1)])),_:1,__:[6]})]),v(n,{options:[{content:"此处为站点主配置文件，若您不了解配置规则，请勿随意修改."}],"list-style":"disc",class:"ml-[20px] mt-[20px]"})])])):(r(),u("div",L,[x("div",Q,[e[8]||(e[8]=b(" 请开启 ",-1)),x("span",{class:"mx-[.4rem] bt-link",onClick:e[4]||(e[4]=a=>d(J)("mapping"))},"外网映射"),e[9]||(e[9]=b(" 后查看配置信息 ",-1))])]))])}}});export{$ as _};
