import{c as a,f as t,h as n,_ as l,u as e,a as o}from"./public.js?v=1764233927359";import{k as i,P as s,r as u,R as r,V as c,S as f,W as p,aj as d,ak as m,U as g,a3 as _,j as v,a4 as y}from"./vue.js?v=1764233927359";import{x as j,m as x,he as S}from"./page_layout.js?v=1764233927359";import{K as W,L as h,M as w,N as b,O as C}from"./setting.js?v=1764233927359";import{_ as k}from"./index99.js?v=1764233927359";import{au as $,aC as P,da as B}from"./naive.js?v=1764233927359";import"./common.js?v=1764233927359";import"./__commonjsHelpers__.js?v=1764233927359";const U={class:"p-20px"},L={class:"flex mb-16px"},E={class:"flex-1 mr-16px"},K="uri_find",R=i({__name:"config",setup(i){const{t:R}=s(),A=u(""),D=async()=>{""!==A.value.trim()?(await w({url_find:A.value}),A.value="",q()):x.error(R("Waf.Setting.config_176"))},H=()=>{const a=u("");e({title:R("Waf.Setting.config_177"),width:440,footer:!0,content:()=>p("div",{class:"p-20px"},[p(k,{value:a.value,"onUpdate:value":t=>a.value=t,rows:14,placeholder:R("Waf.Setting.config_178")},null)]),onConfirm:async()=>{if(""===a.value.trim())return x.error(R("Waf.Setting.config_179")),!1;await b({pdata:a.value,json:1}),q()}})},I=()=>{const a=u(N.data.map(a=>a.url).join("\n"));e({title:R("Waf.Setting.config_177"),width:440,footer:!0,content:()=>p("div",{class:"p-20px"},[p(k,{value:a.value,"onUpdate:value":t=>a.value=t,rows:14,readonly:!0},null)]),onConfirm:()=>(S(a.value,"".concat(K,".json")),!1)})},M=()=>{o({title:R("Waf.Setting.config_180"),content:R("Waf.Setting.config_181"),onConfirm:async()=>{await C({type:K}),q()}})},{table:N,columns:O,setLoading:V}=a([{key:"url",title:"URL"},t({width:80,options:a=>[{label:R("Public.Btn.Del"),onClick:async()=>{await W({url_find:a.url}),q()}}]})]),q=async()=>{try{V(!0);const{message:a}=await h();j(a)&&(N.data=a.map(a=>({url:a})))}finally{V(!1)}};return q(),(a,t)=>{const e=$,o=P,i=n,s=B,u=l;return c(),r("div",U,[f("div",L,[f("div",E,[p(e,{value:g(A),"onUpdate:value":t[0]||(t[0]=a=>m(A)?A.value=a:null),placeholder:a.$t("Waf.Setting.config_173"),onKeyup:d(D,["enter"])},null,8,["value","placeholder"])]),p(o,{type:"primary",onClick:D},{default:_(()=>[v(y(a.$t("Public.Btn.Add")),1)]),_:1})]),p(i,{"max-height":258,loading:g(N).loading,data:g(N).data,columns:g(O)},null,8,["loading","data","columns"]),p(s,{class:"mt-16px"},{default:_(()=>[p(o,{onClick:H},{default:_(()=>[v(y(a.$t("Public.Btn.Import")),1)]),_:1}),p(o,{onClick:I},{default:_(()=>[v(y(a.$t("Public.Btn.Export")),1)]),_:1}),p(o,{onClick:M},{default:_(()=>[v(y(a.$t("Public.Btn.Empty")),1)]),_:1})]),_:1}),p(u,{class:"mt-16px"},{default:_(()=>[f("li",null,y(a.$t("Waf.Setting.config_174")),1),f("li",null,y(a.$t("Waf.Setting.config_175")),1)]),_:1})])}}});export{R as default};
