← Back
Editing: config13.js
import{b as a,h as t,f as n,_ as l,u as e,d as o}from"./public.js?v=1753755607904";import{k as i,P as s,r,U as u,X as c,V as f,Q as p,at as d,ah as m,W as g,a2 as _,j as v,a3 as y}from"./vue.js?v=1753755607904";import{w as j,m as x,g4 as b}from"./page_layout.js?v=1753755607904";import{K as w,L as W,M as h,N as S,O as C}from"./setting.js?v=1753755607904";import{_ as k}from"./index100.js?v=1753755607904";import{aq as $,ay as P,bZ as B}from"./naive.js?v=1753755607904";import"./common.js?v=1753755607904";import"./__commonjsHelpers__.js?v=1753755607904";const U={class:"p-20px"},L={class:"flex mb-16px"},E={class:"flex-1 mr-16px"},K="uri_find",q=i({__name:"config",setup(i){const{t:q}=s(),A=r(""),D=async()=>{""!==A.value.trim()?(await h({url_find:A.value}),A.value="",R()):x.error(q("Waf.Setting.config_176"))},H=()=>{const a=r("");e({title:q("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:q("Waf.Setting.config_178")},null)]),onConfirm:async()=>{if(""===a.value.trim())return x.error(q("Waf.Setting.config_179")),!1;await S({pdata:a.value,json:1}),R()}})},I=()=>{const a=r(N.data.map((a=>a.url)).join("\n"));e({title:q("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:()=>(b(a.value,"".concat(K,".json")),!1)})},M=()=>{o({title:q("Waf.Setting.config_180"),content:q("Waf.Setting.config_181"),onConfirm:async()=>{await C({type:K}),R()}})},{table:N,columns:O,setLoading:Q}=a([{key:"url",title:"URL"},t({width:80,options:a=>[{label:q("Public.Btn.Del"),onClick:async()=>{await w({url_find:a.url}),R()}}]})]),R=async()=>{try{Q(!0);const{message:a}=await W();j(a)&&(N.data=a.map((a=>({url:a}))))}finally{Q(!1)}};return R(),(a,t)=>{const e=$,o=P,i=n,s=B,r=l;return c(),u("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(r,{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{q as default};
Save File
Cancel