import{v as D,h as L,n as N,x as R,m as A}from"./index-BTglIPU2.js?v=1773287522785";import{_ as E}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{u as T}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as U}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{t as V,g as M,u as j,v as q}from"./planned-URJGV2nd.js?v=1773287522785";import{b as I,B as X,k as Z,at as z,a1 as F}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as G,R as J,r as x,e as K,$ as Q,Z as W,a0 as s,a9 as _,_ as c,X as Y,S as n,j as O,aa as tt,N as at}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const et={class:"p-20px"},nt={class:"flex-1"},ot={class:"mt-12px"},st={class:"px-20px pt-24px pb-8px"},it={class:"w-150px"},ht=G({__name:"set",props:{data:{}},setup(v){const{t:o}=J(),g=v,{setOptions:e}=g.data,l=x(""),b=async()=>{const t=l.value.trim();if(t===""){A.error(o("Site.PHP.index_46"));return}await j({name:t}),l.value="",await u(),e==null||e(m.data)},d=D(),p=x(null),i=K({id:-1,name:""}),h={name:{required:!0,message:o("Site.PHP.index_46"),trigger:["blur","change"]}},P=t=>{i.id=t.id,i.name=t.name,d.title="".concat(o("Site.PHP.index_48")," [").concat(t.name,"]"),d.show=!0},y=async({hide:t})=>{var a;await((a=p.value)==null?void 0:a.validate()),await q(at(i)),await u(),e==null||e(m.data),t()},{table:m,columns:C}=U([{key:"name",title:o("Docker.Compose.form.index_3")},T({width:80,options:t=>[{label:o("Public.Btn.Edit"),disabled:t.id===0,onClick:()=>{P(t)}},{label:o("Public.Btn.Del"),disabled:t.id===0,onClick:()=>{L({title:"".concat(o("Site.PHP.index_49")," [").concat(t.name,"]"),content:o("Site.PHP.index_50"),onConfirm:async({hide:a})=>{await V({id:t.id}),await u(),e==null||e(m.data,t.id),a()}})}}]})]),u=async()=>{const{message:t}=await M();m.data=N(t)?t:[]};return u(),(t,a)=>{const f=I,w=X,k=Z,S=z,$=F,B=E,H=R;return Q(),W("div",et,[s(k,null,{default:_(()=>[c("div",nt,[s(f,{value:n(l),"onUpdate:value":a[0]||(a[0]=r=>Y(l)?l.value=r:null),placeholder:t.$t("Site.PHP.index_46")},null,8,["value","placeholder"])]),c("div",null,[s(w,{type:"primary",onClick:b},{default:_(()=>[O(tt(t.$t("Site.Cert.index_62")),1)]),_:1})])]),_:1}),c("div",ot,[s(S,{"max-height":300,data:n(m).data,columns:n(C)},null,8,["data","columns"])]),s(H,{show:n(d).show,"onUpdate:show":a[2]||(a[2]=r=>n(d).show=r),title:n(d).title,width:350,footer:!0,onConfirm:y},{default:_(()=>[c("div",st,[s(B,{ref_key:"formRef",ref:p,model:n(i),rules:h},{default:_(()=>[s($,{label:t.$t("Site.PHP.index_47"),path:"name"},{default:_(()=>[c("div",it,[s(f,{value:n(i).name,"onUpdate:value":a[1]||(a[1]=r=>n(i).name=r),placeholder:""},null,8,["value"])])]),_:1},8,["label"])]),_:1},8,["model"])])]),_:1},8,["show","title"])])}}});export{ht as default};
