var e;import{_ as a}from"./index.vue_vue_type_script_setup_true_lang4.js?v=20260328163632";import{aa as s,l as t,ao as o,aB as l,a4 as r,$ as i,ac as n,aq as u,A as c,a7 as p,z as d,x as m,M as v,a3 as f,q as h,a1 as g,a2 as _}from"./utils-lib.js?v=20260328163632";import{B as j}from"./index91.js?v=20260328163632";import{B as k}from"./index98.js?v=20260328163632";import{u as x}from"./index92.js?v=20260328163632";import{u as y,b as C,k as w,f as b,e as R}from"./useMethod4.js?v=20260328163632";import{u as O}from"./store4.js?v=20260328163632";import{k as B,A as I}from"./site.js?v=20260328163632";import{r as S,O as q,k as z,w as E,o as V,J as A,V as U,W as K,a3 as L,Y as D,F,N as H,X as M,Z as P}from"./base-lib.js?v=20260328163632";import{au as T}from"./naive-ui.js?v=20260328163632";import"./index97.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const{siteInfo:W,pluginInfo:X,isRefreshList:J,setSiteInfo:N}=O(),Y=S([]),Z=e=>e.id,$=S(""),G=S(""),Q=(e,a="")=>{N(e,a),c({title:t("反向代理管理[{0}] -- 添加时间[{1}]",[e.name,e.addtime]),area:[840,720],component:()=>p((()=>import("./index177.js?v=20260328163632")),[],import.meta.url)})},ee=S({columns:[s(),{title:t("域名"),key:"name",isCustom:!1,...o(),render:e=>q("span",{class:"bt-link",onClick:()=>Q(e)},[e.name])},{title:t("代理地址"),key:"project_config.to_url"},...y(),l({table:"sites",minWidth:110,width:"auto",request:R}),C({onClick:e=>{Q(e,"ssl")}}),r([{onClick:e=>Q(e),title:t("设置")},{onClick:async e=>{await d({title:t("删除反代项目【{0}】",[e.name]),content:t("风险操作，此操作不可逆，删除【{0}】项目后您将无法管理该项目，是否继续操作？",[e.name])}),m({loading:t("正在删除反代项目，请稍后..."),request:B({siteid:e.id}),success:e=>{v.msg({customClass:"bt-message-error-html",isHtml:!0,message:e.data.msg,type:e.data.status?"success":"error",duration:e.data.status?3e3:0,showClose:!e.data.status}),ce()}})},title:t("删除")}])],data:[]}),ae=S({page:1,pageSize:20,itemCount:0,pageSlot:5}),[se,te]=i(ee),[oe]=f(ae),{BtBatch:le}=n({tableRef:te,checkedRowKeys:Y,options:[{label:t("删除项目"),value:"delete",event:w}]}),{BtColumn:re}=u({tableRef:te,column:ee.value.columns}),{BtOperation:ie}=x({options:[{active:!0,label:t("添加反代"),onClick:()=>{W.value=null,c({title:t("添加反代"),area:"auto",component:()=>p((()=>import("./index176.js?v=20260328163632")),[],import.meta.url),showFooter:!0})}},...b(),{type:"custom",hide:-1===(null==(e=X.value)?void 0:e.status_code),render:()=>q(k,{isRequest:!1,pluginInfo:X.value},null)}]}),ne=e=>{ee.value.columns.forEach((a=>{void 0!==a.sortOrder&&(e&&a.key===e.columnKey?a.sortOrder=e.order:a.sortOrder=!1)}));const{order:a,columnKey:s}=e;G.value=a?"".concat(s," ").concat("descend"===a?"desc":"asc"):"",ce()},ue=()=>{ae.value.page=1,ce()},ce=(e={search_type:"proxy",search:$.value,p:ae.value.page,limit:ae.value.pageSize,order:G.value})=>{m({request:I(e),success:e=>{var a;const{data:s,page:t}=e.data;if(ee.value.data=s||[],ae.value.itemCount=(null==t?void 0:t.total)||0,(null==(a=W.value)?void 0:a.id)&&(null==s?void 0:s.length)){const e=null==s?void 0:s.find((e=>e.id===W.value.id));e&&(W.value=e)}}})},pe=()=>{de(),ce()},de=()=>{$.value="",ee.value.data=[],Y.value=[],Object.assign(ae.value,{page:1,itemCount:0})};t("缓存是一种用于加速网站性能和提高用户体验的技术"),t("开启后资源会被缓存，如果影响网站访问请关闭"),t("缓存键由主机名、URI 和请求参数组成"),t("默认忽略的响应头有：Set-Cookie|Cache-Control|expires|X-Accel-Expires"),t("默认缓存的静态资源有：css|js|jpg|jpeg|gif|png|webp|woff|eot|ttf|svg|ico|css.map|js.map"),t("分钟"),t("小时"),t("天"),t("请输入正确的缓存时间");const me={class:"text-14px text-[var(--text-color-2)]"},ve=z({__name:"index",setup(e){const{isRefreshList:s}=O();return E((()=>s.value),(e=>{e&&(ce(),s.value=!1)})),V(pe),A(de),(e,s)=>{const o=T;return U(),K(F,null,[q(a),q(D(_),null,{"header-left":L((()=>[q(D(ie),{class:"!gap-10px"})])),"header-right":L((()=>[q(o,{class:"!gap-10px"},{default:L((()=>[q(D(h),{modelValue:D($),"onUpdate:modelValue":s[0]||(s[0]=e=>H($)?$.value=e:null),placeholder:D(t)("请输入项目名称或备注"),class:"!w-[220px]",onSearch:D(ue)},null,8,["modelValue","placeholder","onSearch"]),q(D(j),{onRefresh:D(ce)},null,8,["onRefresh"]),q(D(re))])),_:1})])),content:L((()=>[q(D(se),{"checked-row-keys":D(Y),"onUpdate:checkedRowKeys":s[1]||(s[1]=e=>H(Y)?Y.value=e:null),"row-key":D(Z),"onUpdate:sorter":D(ne)},null,8,["checked-row-keys","row-key","onUpdate:sorter"])])),"footer-left":L((()=>[q(D(le))])),"footer-right":L((()=>[q(D(oe),{"show-size-picker":"","page-sizes":D(g)([10,20,50,100]),onRefresh:D(ce)},{suffix:L((()=>[M("span",me,P(D(t)("共 {0} 条",[D(ae).itemCount])),1)])),_:1},8,["page-sizes","onRefresh"])])),_:1})],64)}}});export{ve as default};
