import{c as e,aA as a,r as s,o as l,v as t,x as o,y as r,N as u,B as m,e as d,C as _,z as i,D as n,G as p,ab as c,U as v,a9 as f}from"./base-lib.js?v=1761009159";import{P as y,hf as h,ax as b,b as j}from"./utils-lib.js?v=1761009159";import{_ as g}from"./container-terminal-dialog.vue_vue_type_script_setup_true_lang.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index.vue_vue_type_style_index_0_lang.js?v=1761009159";import"./add-host.vue_vue_type_script_setup_true_lang.js?v=1761009159";import"./form-item.js?v=1761009159";import"./index106.js?v=1761009159";import"./useController2.js?v=1761009159";const x={class:"h-[60rem]"},V={key:1,class:"h-full"},k=e({__name:"container-shell",props:{compData:{default:()=>({})}},setup(e){const k=j(),C=a("currentConDetail"),D=s(),S=l({type:"bash",sudo:!1}),U=s(!1),B=s({cmd:""}),q=async()=>{"running"===C.value.State.Status?D.value.validate(async e=>{e&&y({request:h({id:C.value.Id,shell:S.type,sudo_i:S.sudo?1:0}),data:{msg:[String,e=>{B.value={cmd:e},U.value=!0}]}})}):k.error("容器未运行")};return(e,a)=>{const s=b,l=p,y=c,h=v,j=f;return t(),o("div",x,[r(U)?n("",!0):(t(),u(j,{key:0,ref_key:"shellFormRef",ref:D,class:"p-[2rem]",model:r(S)},{default:m(()=>[d(y,{label:"请选择shell"},{default:m(()=>[d(s,{modelValue:r(S).type,"onUpdate:modelValue":a[0]||(a[0]=e=>r(S).type=e),options:[{label:"Bash",value:"bash"},{label:"sh",value:"sh"}],class:"!w-[20rem]"},null,8,["modelValue"]),d(l,{class:"!ml-[2rem]",type:"primary",onClick:q},{default:m(()=>a[2]||(a[2]=[_("开启终端",-1)])),_:1,__:[2]})]),_:1}),d(y,{label:" "},{default:m(()=>[d(h,{modelValue:r(S).sudo,"onUpdate:modelValue":a[1]||(a[1]=e=>r(S).sudo=e)},{default:m(()=>a[3]||(a[3]=[i("div",{class:"flex items-center"},"使用root权限执行",-1)])),_:1,__:[3]},8,["modelValue"])]),_:1})]),_:1},8,["model"])),r(U)?(t(),o("div",V,[d(g,{"comp-data":r(B)},null,8,["comp-data"])])):n("",!0)])}}});export{k as default};
