import{_ as a}from"./index.js?v=1753954525509";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{w as t,m as s}from"./page_layout.js?v=1753954525509";import{e as l,b as i,h as n,d as o}from"./public.js?v=1753954525509";import{r as d,g as r,t as m,u}from"./planned.js?v=1753954525509";import{aq as c,ay as p,bY as _,c2 as v,cA as f}from"./naive.js?v=1753954525509";import{k as x,P as h,r as w,e as P,U as b,V as j,Q as y,a2 as g,W as H,X as S,ah as k,j as C,a3 as U,N as $}from"./vue.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const q={class:"p-20px"},B={class:"flex-1"},D={class:"mt-12px"},A={class:"px-20px pt-24px pb-8px"},E={class:"w-150px"},N=x({__name:"set",props:{data:{}},setup(x){const{t:N}=h(),O=x,{setOptions:Q}=O.data,R=w(""),V=async()=>{const a=R.value.trim();""!==a?(await m({name:a}),R.value="",await J(),null==Q||Q(G.data)):s.error(N("Site.PHP.index_46"))},W=l(),X=w(null),Y=P({id:-1,name:""}),z={name:{required:!0,message:N("Site.PHP.index_46"),trigger:["blur","change"]}},F=async({hide:a})=>{var e;await(null==(e=X.value)?void 0:e.validate()),await u($(Y)),await J(),null==Q||Q(G.data),a()},{table:G,columns:I}=i([{key:"name",title:N("Docker.Compose.form.index_3")},n({width:80,options:a=>[{label:N("Public.Btn.Edit"),disabled:0===a.id,onClick:()=>{(a=>{Y.id=a.id,Y.name=a.name,W.title="".concat(N("Site.PHP.index_48")," [").concat(a.name,"]"),W.show=!0})(a)}},{label:N("Public.Btn.Del"),disabled:0===a.id,onClick:()=>{o({title:"".concat(N("Site.PHP.index_49")," [").concat(a.name,"]"),content:N("Site.PHP.index_50"),onConfirm:async({hide:e})=>{await d({id:a.id}),await J(),null==Q||Q(G.data,a.id),e()}})}}]})]),J=async()=>{const{message:a}=await r();G.data=t(a)?a:[]};return J(),(t,s)=>{const l=c,i=p,n=_,o=v,d=f,r=e,m=a;return b(),j("div",q,[y(n,null,{default:g((()=>[H("div",B,[y(l,{value:S(R),"onUpdate:value":s[0]||(s[0]=a=>k(R)?R.value=a:null),placeholder:t.$t("Site.PHP.index_46")},null,8,["value","placeholder"])]),H("div",null,[y(i,{type:"primary",onClick:V},{default:g((()=>[C(U(t.$t("Site.Cert.index_62")),1)])),_:1})])])),_:1}),H("div",D,[y(o,{"max-height":300,data:S(G).data,columns:S(I)},null,8,["data","columns"])]),y(m,{show:S(W).show,"onUpdate:show":s[2]||(s[2]=a=>S(W).show=a),title:S(W).title,width:350,footer:!0,onConfirm:F},{default:g((()=>[H("div",A,[y(r,{ref_key:"formRef",ref:X,model:S(Y),rules:z},{default:g((()=>[y(d,{label:t.$t("Site.PHP.index_47"),path:"name"},{default:g((()=>[H("div",E,[y(l,{value:S(Y).name,"onUpdate:value":s[1]||(s[1]=a=>S(Y).name=a),placeholder:""},null,8,["value"])])])),_:1},8,["label"])])),_:1},8,["model"])])])),_:1},8,["show","title"])])}}});export{N as default};
