import{_ as a}from"./index.js?v=1764830988434";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1764830988434";import{c as t,f as n,a as l,d as s,e as i,h as o}from"./public.js?v=1764830988434";import{Y as r,Z as d,$ as m,a0 as p,d as u}from"./page_layout.js?v=1764830988434";import{_}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import c from"./index98.js?v=1764830988434";import{k as g,P as f,r as x,e as h,R as v,V as w,W as b,U as y,a3 as S,N as j,j as k,a4 as $}from"./vue.js?v=1764830988434";import{dR as C,au as U,dj as R,aC as L}from"./naive.js?v=1764830988434";const P={class:"p-20px"},T=g({__name:"form",props:{data:{}},setup(a,{expose:e}){const{t:t}=f(),n=a,{getList:l,name:s}=n.data,i=x(null),o=h({name:s,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(j(o)),null==l||l(),a()}}),(a,e)=>{const t=U,n=C,l=_;return w(),v("div",P,[b(l,{ref_key:"formRef",ref:i,model:y(o),rules:d},{default:S(()=>[b(n,{label:a.$t("Site.TableRow.index_2"),path:"args_name"},{default:S(()=>[b(t,{class:"w-280px!",value:y(o).args_name,"onUpdate:value":e[0]||(e[0]=a=>y(o).args_name=a),placeholder:a.$t("Soft.index_43")},null,8,["value","placeholder"])]),_:1},8,["label"]),b(n,{label:a.$t("Docker.Container.config.image.index_11"),path:"ps"},{default:S(()=>[b(t,{class:"w-280px!",maxlength:"30","show-count":"",value:y(o).ps,"onUpdate:value":e[1]||(e[1]=a=>y(o).ps=a),placeholder:a.$t("Soft.index_44")},null,8,["value","placeholder"])]),_:1},8,["label"]),b(n,{label:a.$t("Soft.index_45"),path:"args"},{default:S(()=>[b(t,{class:"w-280px!",value:y(o).args,"onUpdate:value":e[2]||(e[2]=a=>y(o).args=a),placeholder:a.$t("Soft.index_46")},null,8,["value","placeholder"])]),_:1},8,["label"]),b(n,{label:a.$t("Soft.index_47"),path:"init"},{default:S(()=>[b(c,{value:y(o).init,"onUpdate:value":e[3]||(e[3]=a=>y(o).init=a),height:300,"show-tips":!1,class:"w-350px"},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),D={class:"p-20px"},q=g({__name:"index",props:{data:{}},setup(r,{expose:_}){const{t:c}=f(),g=r,{name:x,callback:j}=g.data,C=()=>{z.show=!0},U=h({args_names:""}),{keys:P,table:q,columns:W}=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=>b(R,{value:B(a.name),"onUpdate:value":e=>N(a.name,e)},null)},n({width:100,align:"center",options:a=>[{label:c("Public.Btn.Del"),onClick:()=>{l({title:"".concat(c("Site.TableOP.index_6")," [").concat(a.name,"]"),content:c("Soft.index_50",[a.name]),onConfirm:async({hide:e})=>{await d({name:x,args_name:a.name}),Z(),e()}})}}]})]),B=a=>U.args_names.split("\n").includes(a),N=async(a,e)=>{let t;t=e?U.args_names.trim().length>0?U.args_names+"\n"+a:a:O(a),await m({name:x,args_names:t}),Z()},O=a=>U.args_names.split("\n").filter(e=>e!==a).join("\n"),{loading:V,setLoading:Y}=s(),Z=async()=>{try{Y(!0);const{message:a}=await p({name:x});u(a)&&(q.data=a.args,U.args_names=a.config)}finally{P.value=[],Y(!1)}},z=i(c("Soft.index_49"),{getList:Z,name:x});Z();return _({onConfirm:async()=>{null==j||j()}}),(t,n)=>{const l=L,s=o,i=e,r=a;return w(),v("div",D,[b(i,null,{toolsLeft:S(()=>[b(l,{type:"primary",onClick:C},{default:S(()=>[k($(t.$t("Soft.index_49")),1)]),_:1})]),table:S(()=>[b(s,{"max-height":250,loading:y(V),data:y(q).data,columns:y(W)},null,8,["loading","data","columns"])]),_:1}),b(r,{show:y(z).show,"onUpdate:show":n[0]||(n[0]=a=>y(z).show=a),title:y(z).title,data:y(z).data,width:550,footer:!0,component:T},null,8,["show","title","data"])])}}});export{q as _};
