System.register(["./index-legacy107.js?v=1763625242172","./index-legacy104.js?v=1763625242172","./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1763625242172","./vue-legacy.js?v=1763625242172","./page_layout-legacy.js?v=1763625242172","./public-legacy.js?v=1763625242172","./naive-legacy.js?v=1763625242172","./__commonjsHelpers__-legacy.js?v=1763625242172","./common-legacy.js?v=1763625242172"],(function(e,a){"use strict";var l,n,c,s,o,t,d,u,i,r,m,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,r=e.S,m=e.X,p=e.a3,_=e.U,g=e.V,v=e.ak,x=e.j,f=e.a4,k=e.aj},e=>{b=e.bU,y=e.h,D=e.m,I=e.c7,L=e.x,h=e.gl},e=>{j=e.C},e=>{w=e.dV,C=e.dP,$=e.au,U=e.aC,R=e.az},null,null],execute:function(){const a={class:"pt-4px"},E={class:"w-440px"},M={class:"w-440px"},P={class:"px-2px py-4px"},S={class:"h-420px"},V=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"))}},V=d(null),z=d(l("Docker.LocalImage.pull.index_10")),H=d(!1),K=d([]),X=async()=>{await(V.value?.validate()),z.value="",q.value=!0,B(),J()},q=d(!1),A=u((()=>q.value)),{open:B,send:F,close:G}=j("/ws_model",{immediate:!1,onMessage:(e,a)=>{const{data:n}=a;if(y(n)&&(z.value+=a.data,n.includes("successful")||n.includes("failed"))){q.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{H.value=!0;const{message:e}=await I();L(e)&&e.length>0&&(K.value=e.map((e=>({label:e.name,value:e.name}))),k.name=e[0].name)}finally{H.value=!1}})(),(e,l)=>{const s=w,o=C,t=$,d=U,u=R,b=c,y=n;return i(),r("div",a,[m(b,{ref_key:"formRef",ref:V,model:g(k),rules:h},{default:p((()=>[m(o,{label:e.$t("Docker.LocalImage.pull.index_3"),path:"name"},{default:p((()=>[_("div",E,[m(s,{value:g(k).name,"onUpdate:value":l[0]||(l[0]=e=>g(k).name=e),loading:g(H),disabled:g(A),options:g(K)},null,8,["value","loading","disabled","options"])])])),_:1},8,["label"]),m(o,{label:e.$t("Docker.LocalImage.pull.index_4"),path:"image"},{default:p((()=>[_("div",M,[m(u,null,{default:p((()=>[m(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(X,["enter"])},null,8,["value","disabled","placeholder"]),m(d,{type:"primary",disabled:g(A),onClick:X},{default:p((()=>[x(f(e.$t("Docker.LocalImage.pull.index_6")),1)])),_:1},8,["disabled"])])),_:1})])])),_:1},8,["label"])])),_:1},8,["model"]),_("div",P,f(e.$t("Docker.LocalImage.pull.index_7")),1),_("div",S,[m(y,{log:g(z)},null,8,["log"])])])}}}),z={class:"pt-4px"},H={class:"px-2px py-4px"},K={class:"h-456px"},X=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=$,o=U,t=R,d=n;return i(),r("div",z,[m(t,{class:"mb-16px"},{default:p((()=>[m(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"]),m(o,{type:"primary",disabled:g(k),onClick:I},{default:p((()=>[x(f(e.$t("Docker.LocalImage.pull.index_12")),1)])),_:1},8,["disabled"])])),_:1}),_("div",H,f(e.$t("Docker.LocalImage.pull.index_7")),1),_("div",K,[m(d,{log:g(s)},null,8,["log"])])])}}}),q={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:V},{key:"command",label:a("Docker.LocalImage.pull.index_2"),component:X}];return(e,a)=>{const s=l;return i(),r("div",q,[m(s,{value:g(n),"onUpdate:value":a[0]||(a[0]=e=>k(n)?n.value=e:null),options:c},null,8,["value"])])}}}))}}}));
