import{_ as a}from"./index.js?v=1763625242172";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1763625242172";import{c as t,f as n,a as l,d as s,e as i,h as o}from"./public.js?v=1763625242172";import{Y as r,Z as d,$ as m,a0 as p,c as u}from"./page_layout.js?v=1763625242172";import{_}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import c from"./index100.js?v=1763625242172";import{k as g,P as f,r as x,e as h,R as v,S as w,X as b,a3 as y,V as S,N as j,j as k,a4 as $}from"./vue.js?v=1763625242172";import{au as C,dP as U,dj as P,aC as R}from"./naive.js?v=1763625242172";const L={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=C,n=U,l=_;return v(),w("div",L,[b(l,{ref_key:"formRef",ref:i,model:S(o),rules:d},{default:y((()=>[b(n,{label:a.$t("Site.TableRow.index_2"),path:"args_name"},{default:y((()=>[b(t,{class:"w-280px!",value:S(o).args_name,"onUpdate:value":e[0]||(e[0]=a=>S(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:y((()=>[b(t,{class:"w-280px!",maxlength:"30","show-count":"",value:S(o).ps,"onUpdate:value":e[1]||(e[1]=a=>S(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:y((()=>[b(t,{class:"w-280px!",value:S(o).args,"onUpdate:value":e[2]||(e[2]=a=>S(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:y((()=>[b(c,{value:S(o).init,"onUpdate:value":e[3]||(e[3]=a=>S(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:L,table:q,columns:B}=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(P,{value:N(a.name),"onUpdate:value":e=>O(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}),Y(),e()}})}}]})]),N=a=>U.args_names.split("\n").includes(a),O=async(a,e)=>{let t;t=e?U.args_names.trim().length>0?U.args_names+"\n"+a:a:V(a),await m({name:x,args_names:t}),Y()},V=a=>U.args_names.split("\n").filter((e=>e!==a)).join("\n"),{loading:W,setLoading:X}=s(),Y=async()=>{try{X(!0);const{message:a}=await p({name:x});u(a)&&(q.data=a.args,U.args_names=a.config)}finally{L.value=[],X(!1)}},Z=i(c("Soft.index_49"),{getList:Y,name:x});Y();return _({onConfirm:async()=>{null==j||j()}}),(t,n)=>{const l=R,s=o,i=e,r=a;return v(),w("div",D,[b(i,null,{toolsLeft:y((()=>[b(l,{type:"primary",onClick:C},{default:y((()=>[k($(t.$t("Soft.index_49")),1)])),_:1})])),table:y((()=>[b(s,{"max-height":250,loading:S(W),data:S(q).data,columns:S(B)},null,8,["loading","data","columns"])])),_:1}),b(r,{show:S(Z).show,"onUpdate:show":n[0]||(n[0]=a=>S(Z).show=a),title:S(Z).title,data:S(Z).data,width:550,footer:!0,component:T},null,8,["show","title","data"])])}}});export{q as _};
