System.register(["./index-legacy107.js?v=1764233927359","./index-legacy104.js?v=1764233927359","./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1764233927359","./vue-legacy.js?v=1764233927359","./page_layout-legacy.js?v=1764233927359","./public-legacy.js?v=1764233927359","./naive-legacy.js?v=1764233927359","./__commonjsHelpers__-legacy.js?v=1764233927359","./common-legacy.js?v=1764233927359"],function(e,a){"use strict";var l,n,c,s,o,t,d,u,i,m,r,p,_,g,v,x,f,k,b,y,D,I,L,h,j,w,C,$,U,R;return{setters:[e=>{l=e._},e=>{n=e._},e=>{c=e._},e=>{s=e.k,o=e.P,t=e.e,d=e.r,u=e.c,i=e.R,m=e.V,r=e.W,p=e.S,_=e.a3,g=e.U,v=e.aj,x=e.j,f=e.a4,k=e.ak},e=>{b=e.bU,y=e.h,D=e.m,I=e.c5,L=e.x,h=e.gm},e=>{j=e.C},e=>{w=e.dR,C=e.dV,$=e.av,U=e.au,R=e.aC},null,null],execute:function(){const a={class:"pt-4px"},E={class:"w-440px"},M={class:"w-440px"},S={class:"px-2px py-4px"},V={class:"h-420px"},H=s({__name:"index",setup(e){const{t:l}=o(),s=b(),k=t({name:null,image:""}),h={name:{trigger:"change",validator:()=>null!==k.name||new Error(l("Docker.LocalImage.pull.index_8"))},image:{trigger:["input","blur"],validator:()=>""!==k.image||new Error(l("Docker.LocalImage.pull.index_9"))}},H=d(null),K=d(l("Docker.LocalImage.pull.index_10")),P=d(!1),W=d([]),q=async()=>{await(H.value?.validate()),K.value="",z.value=!0,B(),J()},z=d(!1),A=u(()=>z.value),{open:B,send:F,close:G}=j("/ws_model",{immediate:!1,onMessage:(e,a)=>{const{data:n}=a;if(y(n)&&(K.value+=a.data,n.includes("successful")||n.includes("failed"))){z.value=!1;const e={status:n.includes("successful"),msg:n.includes("successful")?l("Docker.Container.create.command_7"):l("Docker.Container.create.command_6")};e.status?(D.success(e.msg),s.setRefresh(!0)):D.error(e.msg),G()}}}),J=()=>{F({model_index:"btdocker",mod_name:"image",def_name:"pull_from_some_registry",ws_callback:111,name:k.name,image:k.image})};return(async()=>{try{P.value=!0;const{message:e}=await I();L(e)&&e.length>0&&(W.value=e.map(e=>({label:e.name,value:e.name})),k.name=e[0].name)}finally{P.value=!1}})(),(e,l)=>{const s=C,o=w,t=U,d=R,u=$,b=c,y=n;return m(),i("div",a,[r(b,{ref_key:"formRef",ref:H,model:g(k),rules:h},{default:_(()=>[r(o,{label:e.$t("Docker.LocalImage.pull.index_3"),path:"name"},{default:_(()=>[p("div",E,[r(s,{value:g(k).name,"onUpdate:value":l[0]||(l[0]=e=>g(k).name=e),loading:g(P),disabled:g(A),options:g(W)},null,8,["value","loading","disabled","options"])])]),_:1},8,["label"]),r(o,{label:e.$t("Docker.LocalImage.pull.index_4"),path:"image"},{default:_(()=>[p("div",M,[r(u,null,{default:_(()=>[r(t,{value:g(k).image,"onUpdate:value":l[1]||(l[1]=e=>g(k).image=e),disabled:g(A),placeholder:e.$t("Docker.LocalImage.pull.index_5"),onKeyup:v(q,["enter"])},null,8,["value","disabled","placeholder"]),r(d,{type:"primary",disabled:g(A),onClick:q},{default:_(()=>[x(f(e.$t("Docker.LocalImage.pull.index_6")),1)]),_:1},8,["disabled"])]),_:1})])]),_:1},8,["label"])]),_:1},8,["model"]),p("div",S,f(e.$t("Docker.LocalImage.pull.index_7")),1),p("div",V,[r(y,{log:g(K)},null,8,["log"])])])}}}),K={class:"pt-4px"},P={class:"px-2px py-4px"},W={class:"h-456px"},q=s({__name:"index",setup(e){const{t:a}=o(),l=b(),c=t({cmd:""}),s=d(a("Docker.LocalImage.pull.index_10")),v=d(!1),k=u(()=>v.value),I=async()=>{if(""!==c.cmd.trim())try{v.value=!0,s.value=a("Docker.Container.create.command_8"),await h({cmd:c.cmd}),L(),E()}catch(e){v.value=!1,console.error(e)}else D.error(a("Docker.LocalImage.pull.index_13"))},{open:L,send:w,close:C}=j("/ws_model",{immediate:!1,onMessage:(e,n)=>{const{data:c}=n;if(y(c)&&(s.value+=n.data,c.includes("bt_successful")||c.includes("bt_failed"))){v.value=!1;const e={status:c.includes("bt_successful"),msg:c.includes("bt_successful")?a("Docker.Container.create.command_7"):a("Docker.Container.create.command_6")};e.status?(D.success(e.msg),l.setRefresh(!0)):D.error(e.msg),C()}}}),E=()=>{w({model_index:"btdocker",mod_name:"image",def_name:"get_cmd_log",ws_callback:111,name:"",image:""})};return(e,a)=>{const l=U,o=R,t=$,d=n;return m(),i("div",K,[r(t,{class:"mb-16px"},{default:_(()=>[r(l,{value:g(c).cmd,"onUpdate:value":a[0]||(a[0]=e=>g(c).cmd=e),disabled:g(k),placeholder:e.$t("Docker.LocalImage.pull.index_11")},null,8,["value","disabled","placeholder"]),r(o,{type:"primary",disabled:g(k),onClick:I},{default:_(()=>[x(f(e.$t("Docker.LocalImage.pull.index_12")),1)]),_:1},8,["disabled"])]),_:1}),p("div",P,f(e.$t("Docker.LocalImage.pull.index_7")),1),p("div",W,[r(d,{log:g(s)},null,8,["log"])])])}}}),z={class:"p-16px"};e("default",s({__name:"index",setup(e){const{t:a}=o(),n=d("normal"),c=[{key:"normal",label:a("Docker.LocalImage.pull.index_1"),component:H},{key:"command",label:a("Docker.LocalImage.pull.index_2"),component:q}];return(e,a)=>{const s=l;return m(),i("div",z,[r(s,{value:g(n),"onUpdate:value":a[0]||(a[0]=e=>k(n)?n.value=e:null),options:c},null,8,["value"])])}}}))}}});
