import{l as t,x as s,t as e}from"./utils-lib.js?v=20260328163632";import{u as a}from"./index50.js?v=20260328163632";import{a6 as l}from"./wsl.js?v=20260328163632";import{a as i}from"./index192.js?v=20260328163632";import{k as n,r,c as o,o as p,V as m,_ as c,Y as d}from"./base-lib.js?v=20260328163632";import"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index97.js?v=20260328163632";import"./index89.js?v=20260328163632";import"./index91.js?v=20260328163632";import"./index92.js?v=20260328163632";const u=n({__name:"index",setup(n){const{sid:u,rowData:b,isRefreshList:j}=a(),y={labelStyle:"min-width: 100px"},_=r({formAttrs:{labelWidth:"auto"},formItems:[]}),v=r({label:t("启动命令"),attrs:y,children:[{key:"command",type:"input",attrs:{type:"textarea",rows:4,class:"!w-[360px]",placeholder:t("请输入启动命令")}}]}),x=r({label:t("环境变量"),attrs:y,children:[{key:"env_list",type:"input",attrs:{class:"!w-[360px]",rows:4,type:"textarea",placeholder:t("请输入环境变量，1行1个，例如： JAVA_HOME=/usr/local/btjdk/jdk8")}}]}),f=r({label:t("标签"),attrs:y,children:[{key:"lable_list",type:"input",attrs:{class:"!w-[360px]",rows:4,type:"textarea",placeholder:t("请输入标签，1行1个，例如： createdBy=btpanel")}}]}),h=r({label:" ",attrs:y,children:[{type:"button",key:"save",attrs:{type:"primary",buttonText:t("更新容器"),onClick:async()=>{const{command:e,lable_list:a,env_list:i}=g.value;let n={sid:u.value,container_id:b.value.Id,...e?{command:JSON.stringify(e.split("\n"))}:{},...i?{env_list:JSON.stringify(i.split("\n"))}:{}};a&&(n.lable_list={},a.split("\n").map((t=>{const[s,e]=t.split("=");n.lable_list[s]=e})),n.lable_list=JSON.stringify(n.lable_list)),s({loading:t("正在升级容器，请稍后..."),request:l(n),message:!0,success:t=>{j.value=!0}})}}}]}),w=o((()=>(_.value.formItems=[v.value,x.value,f.value,h.value],_.value))),[k,g,O]=e(w);return p((async()=>{const t=await i(),{Config:s}=t.data;Object.assign(g.value,{command:s.Cmd.join(" "),env_list:s.Env.join("\n"),lable_list:Object.entries(s.Labels).map((([t,s])=>"".concat(t,"=").concat(s))).join("\n")})})),(t,s)=>(m(),c(d(k),{class:"p-20px"}))}});export{u as default};
