import{_ as a}from"./index.js?v=1753954525509";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import{b as t,h as n,d as s,c as l,e as i,f as o}from"./public.js?v=1753954525509";import{dw as r,dx as d,dy as p,dz as u,c as m}from"./page_layout.js?v=1753954525509";import{_}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{_ as c}from"./index.vue_vue_type_script_setup_true_lang14.js?v=1753954525509";import{aq as g,cA as f,c5 as x,ay as h}from"./naive.js?v=1753954525509";import{k as v,P as w,r as b,e as y,U as S,V as k,Q as j,a2 as $,X as C,N as U,j as L,a3 as P}from"./vue.js?v=1753954525509";const R={class:"p-20px"},T=v({__name:"form",props:{data:{}},setup(a,{expose:e}){const{t:t}=w(),n=a,{getList:s,name:l}=n.data,i=b(null),o=y({name:l,args_name:"",ps:"",args:"",init:t("Soft.index_48")}),d={args_name:{required:!0,message:t("Soft.index_43"),trigger:["blur","input"]},args:{required:!0,message:t("Soft.index_46"),trigger:["blur","input"]}};return e({onConfirm:async({hide:a})=>{var e;await(null==(e=i.value)?void 0:e.validate()),await r(U(o)),null==s||s(),a()}}),(a,e)=>{const t=g,n=f,s=_;return S(),k("div",R,[j(s,{ref_key:"formRef",ref:i,model:C(o),rules:d},{default:$((()=>[j(n,{label:a.$t("Site.TableRow.index_2"),path:"args_name"},{default:$((()=>[j(t,{class:"w-280px!",value:C(o).args_name,"onUpdate:value":e[0]||(e[0]=a=>C(o).args_name=a),placeholder:a.$t("Soft.index_43")},null,8,["value","placeholder"])])),_:1},8,["label"]),j(n,{label:a.$t("Docker.Container.config.image.index_11"),path:"ps"},{default:$((()=>[j(t,{class:"w-280px!",maxlength:"30","show-count":"",value:C(o).ps,"onUpdate:value":e[1]||(e[1]=a=>C(o).ps=a),placeholder:a.$t("Soft.index_44")},null,8,["value","placeholder"])])),_:1},8,["label"]),j(n,{label:a.$t("Soft.index_45"),path:"args"},{default:$((()=>[j(t,{class:"w-280px!",value:C(o).args,"onUpdate:value":e[2]||(e[2]=a=>C(o).args=a),placeholder:a.$t("Soft.index_46")},null,8,["value","placeholder"])])),_:1},8,["label"]),j(n,{label:a.$t("Soft.index_47"),path:"init"},{default:$((()=>[j(c,{value:C(o).init,"onUpdate:value":e[3]||(e[3]=a=>C(o).init=a),height:300,"show-tips":!1,class:"w-350px"},null,8,["value"])])),_:1},8,["label"])])),_:1},8,["model"])])}}}),q={class:"p-20px"},D=v({__name:"index",props:{data:{}},setup(r,{expose:_}){const{t:c}=w(),g=r,{name:f,callback:v}=g.data,b=()=>{W.show=!0},U=y({args_names:""}),{keys:R,table:D,columns:z}=t([{key:"name",title:c("Site.TableRow.index_2"),ellipsis:{tooltip:{width:"trigger"}}},{key:"name",title:c("Docker.Container.config.image.index_11"),ellipsis:{tooltip:{width:"trigger"}}},{key:"name",title:c("WP.TableRow.index_8"),render:a=>j(x,{value:A(a.name),"onUpdate:value":e=>B(a.name,e)},null)},n({width:100,align:"center",options:a=>[{label:c("Public.Btn.Del"),onClick:()=>{s({title:"".concat(c("Site.TableOP.index_6")," [").concat(a.name,"]"),content:c("Soft.index_50",[a.name]),onConfirm:async({hide:e})=>{await d({name:f,args_name:a.name}),V(),e()}})}}]})]),A=a=>U.args_names.split("\n").includes(a),B=async(a,e)=>{let t;t=e?U.args_names.trim().length>0?U.args_names+"\n"+a:a:N(a),await p({name:f,args_names:t}),V()},N=a=>U.args_names.split("\n").filter((e=>e!==a)).join("\n"),{loading:O,setLoading:Q}=l(),V=async()=>{try{Q(!0);const{message:a}=await u({name:f});m(a)&&(D.data=a.args,U.args_names=a.config)}finally{R.value=[],Q(!1)}},W=i(c("Soft.index_49"),{getList:V,name:f});V();return _({onConfirm:async()=>{null==v||v()}}),(t,n)=>{const s=h,l=o,i=e,r=a;return S(),k("div",q,[j(i,null,{toolsLeft:$((()=>[j(s,{type:"primary",onClick:b},{default:$((()=>[L(P(t.$t("Soft.index_49")),1)])),_:1})])),table:$((()=>[j(l,{"max-height":250,loading:C(O),data:C(D).data,columns:C(z)},null,8,["loading","data","columns"])])),_:1}),j(r,{show:C(W).show,"onUpdate:show":n[0]||(n[0]=a=>C(W).show=a),title:C(W).title,data:C(W).data,width:550,footer:!0,component:T},null,8,["show","title","data"])])}}});export{D as _};
