import{_ as a}from"./index.js?v=1763625242172";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{x as t,m as s}from"./page_layout.js?v=1763625242172";import{e as l,c as i,f as n,a as o}from"./public.js?v=1763625242172";import{r as d,g as r,t as m,u}from"./planned.js?v=1763625242172";import{au as p,aC as c,d9 as _,dg as f,dP as v}from"./naive.js?v=1763625242172";import{k as x,P,r as h,e as w,R as b,S as j,X as g,a3 as y,U as S,V as C,aj as H,j as k,a4 as U,N as $}from"./vue.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const B={class:"p-20px"},D={class:"flex-1"},R={class:"mt-12px"},q={class:"px-20px pt-24px pb-8px"},E={class:"w-150px"},N=x({__name:"set",props:{data:{}},setup(x){const{t:N}=P(),O=x,{setOptions:V}=O.data,X=h(""),z=async()=>{const a=X.value.trim();""!==a?(await m({name:a}),X.value="",await M(),null==V||V(K.data)):s.error(N("Site.PHP.index_46"))},A=l(),F=h(null),G=w({id:-1,name:""}),I={name:{required:!0,message:N("Site.PHP.index_46"),trigger:["blur","change"]}},J=async({hide:a})=>{var e;await(null==(e=F.value)?void 0:e.validate()),await u($(G)),await M(),null==V||V(K.data),a()},{table:K,columns:L}=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=>{G.id=a.id,G.name=a.name,A.title="".concat(N("Site.PHP.index_48")," [").concat(a.name,"]"),A.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 M(),null==V||V(K.data,a.id),e()}})}}]})]),M=async()=>{const{message:a}=await r();K.data=t(a)?a:[]};return M(),(t,s)=>{const l=p,i=c,n=_,o=f,d=v,r=e,m=a;return b(),j("div",B,[g(n,null,{default:y((()=>[S("div",D,[g(l,{value:C(X),"onUpdate:value":s[0]||(s[0]=a=>H(X)?X.value=a:null),placeholder:t.$t("Site.PHP.index_46")},null,8,["value","placeholder"])]),S("div",null,[g(i,{type:"primary",onClick:z},{default:y((()=>[k(U(t.$t("Site.Cert.index_62")),1)])),_:1})])])),_:1}),S("div",R,[g(o,{"max-height":300,data:C(K).data,columns:C(L)},null,8,["data","columns"])]),g(m,{show:C(A).show,"onUpdate:show":s[2]||(s[2]=a=>C(A).show=a),title:C(A).title,width:350,footer:!0,onConfirm:J},{default:y((()=>[S("div",q,[g(r,{ref_key:"formRef",ref:F,model:C(G),rules:I},{default:y((()=>[g(d,{label:t.$t("Site.PHP.index_47"),path:"name"},{default:y((()=>[S("div",E,[g(l,{value:C(G).name,"onUpdate:value":s[1]||(s[1]=a=>C(G).name=a),placeholder:""},null,8,["value"])])])),_:1},8,["label"])])),_:1},8,["model"])])])),_:1},8,["show","title"])])}}});export{N as default};
