← Back
Editing: index-legacy218.js
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(r){f=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),i=new G(n||[]);return u(a,"_invoke",{value:S(e,r,i)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p="suspendedStart",m="suspendedYield",v="executing",y="completed",g={};function b(){}function w(){}function _(){}var x={};f(x,c,(function(){return this}));var L=Object.getPrototypeOf,k=L&&L(L(N([])));k&&k!==o&&a.call(k,c)&&(x=k);var E=_.prototype=b.prototype=Object.create(x);function j(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function O(t,r){function n(o,u,i,c){var l=h(t[o],t,u);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==e(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):r.resolve(f).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var o;u(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function S(e,t,n){var o=p;return function(a,u){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===a)throw u;return{value:r,done:!0}}for(n.method=a,n.arg=u;;){var i=n.delegate;if(i){var c=V(i,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=h(e,t,n);if("normal"===l.type){if(o=n.done?y:m,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function V(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,V(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,g;var u=a.arg;return u?u.done?(t[e.resultName]=u.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,g):u:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function G(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function N(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,u=function e(){for(;++o<t.length;)if(a.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return u.next=u}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=_,u(E,"constructor",{value:_,configurable:!0}),u(_,"constructor",{value:w,configurable:!0}),w.displayName=f(_,s,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,f(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},n.awrap=function(e){return{__await:e}},j(O.prototype),f(O.prototype,l,(function(){return this})),n.AsyncIterator=O,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var u=new O(d(e,t,r,o),a);return n.isGeneratorFunction(t)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},j(E),f(E,s,"Generator"),f(E,c,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},n.values=N,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return i.type="throw",i.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],i=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var c=a.call(u,"catchLoc"),l=a.call(u,"finallyLoc");if(c&&l){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(e,t,r,n,o,a,u){try{var i=e[a](u),c=i.value}catch(e){return void r(e)}i.done?t(c):Promise.resolve(c).then(n,o)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var u=e.apply(t,n);function i(e){r(u,o,a,i,c,"next",e)}function c(e){r(u,o,a,i,c,"throw",e)}i(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy116.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER"],(function(e,r){"use strict";var o,a,u,i,c,l,s,f,d,h,p,m,v,y,g,b,w,_,x,L,k,E,j,O,S,V,P,T,G,N;return{setters:[function(e){o=e.ay,a=e.K,u=e.c7,i=e.M,c=e.ah,l=e.gD,s=e.ag,f=e.al,d=e.e},function(e){h=e.r,p=e.k,m=e.c,v=e.p,y=e.a4,g=e.q,b=e.v,w=e.e,_=e.A,x=e.x,L=e.Q,k=e.O,E=e.B,j=e.y,O=e.P,S=e.a9,V=e.D,P=e.S,T=e.a7,G=e.aA},function(e){N=e._},null],execute:function(){var r=o().refs.isRefreshTableList,C=null,F=h(!1),A=h(""),I=h("common"),U=p({name:"",image:"",cmd:""}),q={model_index:"btdocker",mod_name:"image",def_name:"pull_from_some_registry",ws_callback:111,name:"",image:""},K=function(){A.value=""},R=function(e,t){try{var n=t.data;if(A.value+="".concat(n),n.includes("bt_successful")||n.includes("bt_failed")){var o,a={status:n.includes("bt_successful"),msg:n.includes("bt_successful")?"拉取成功":"拉取失败"};i.request(a),a.status&&(r.value=!0),null===(o=C)||void 0===o||o.close(),F.value=!1}}catch(u){}},z=function(){var e,t;null===(e=C)||void 0===e||e.close(),A.value="",null===(t=C=c({route:"/ws_model",onMessage:R}))||void 0===t||t.send(q)},D={image:[{validator:function(e,t,r){""===t?r(new Error("请输入镜像名")):r()},trigger:["blur"]}]},M=function(){r.value=!0},Y=h([]),B=function(){var e=n(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,""!==U.cmd){e.next=4;break}return i.error("请输入命令"),e.abrupt("return");case 4:return F.value=!0,q.name="",q.url="",q.image="",q.def_name="get_cmd_log",e.next=11,l({cmd:U.cmd},"image");case 11:(r=e.sent).status?z():(i.error(r.msg),F.value=!1),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0);case 18:return e.prev=18,e.finish(18);case 20:case"end":return e.stop()}}),e,null,[[0,15,18,20]])})));return function(){return e.apply(this,arguments)}}(),H=function(){var e=n(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"cmd"!==I.value){e.next=4;break}return B(),e.abrupt("return");case 4:if(""!==U.name){e.next=7;break}return i.error("请选择仓库名"),e.abrupt("return");case 7:return F.value=!0,e.next=10,r.value.validate(function(){var e=n(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r?(q.name=Y.value.find((function(e){return e.url==U.name})).name,q.url=Y.value.find((function(e){return e.url==U.name})).url,q.image=U.image,q.def_name="pull_from_some_registry",z()):F.value=!1;case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0);case 15:return e.prev=15,e.finish(15);case 17:case"end":return e.stop()}}),e,null,[[0,12,15,17]])})));return function(t){return e.apply(this,arguments)}}(),Q=function(){var e=n(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a({request:u(),data:Array,success:function(e){var t;e.forEach((function(e){Y.value.push({value:e.url,label:"".concat(e.name).concat("docker.io"===e.url?"":"(".concat(e.url,")")),url:e.url,name:e.name})})),U.name=null===(t=Y.value[0])||void 0===t?void 0:t.value}});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J={class:"flex flex-col p-[1.6rem] lib-box"},W={class:"rounded-default bg-[#333] h-[45.6rem]"},X={class:"rounded-default bg-[#333] h-[45.6rem]"};e("default",d(m({__name:"index",setup:function(e,t){var r=t.expose,n=h(),o=function(){H(n)};return v((function(){Q()})),y((function(){var e;null===(e=C)||void 0===e||e.close(),C=null,Y.value=[],U.name="",U.image="",U.cmd="",K()})),r({onConfirm:o,onCancel:M}),function(e,t){var r=s,a=S,u=V,i=P,c=N,l=T,d=G,h=f;return g(),b("div",J,[w(h,{modelValue:x(I),"onUpdate:modelValue":t[5]||(t[5]=function(e){return O(I)?I.value=e:null}),type:"card",onChange:x(K)},{default:_((function(){return[w(d,{name:"common",label:"常规拉取"},{default:_((function(){return[w(l,{ref_key:"cmdFormRef",ref:n,size:"default",model:x(U),rules:x(D),disabled:x(F),class:"relative w-full","label-position":"right",onSubmit:t[2]||(t[2]=L((function(){}),["prevent"]))},{default:_((function(){return[w(a,{prop:"name",label:"仓库名"},{default:_((function(){return[w(r,{modelValue:x(U).name,"onUpdate:modelValue":t[0]||(t[0]=function(e){return x(U).name=e}),options:x(Y),class:"!w-[32rem]"},null,8,["modelValue","options"])]})),_:1}),w(a,{prop:"image",label:"镜像名"},{default:_((function(){return[w(i,{class:"!w-[32rem]",modelValue:x(U).image,"onUpdate:modelValue":t[1]||(t[1]=function(e){return x(U).image=e}),onKeydown:k(o,["enter"]),placeholder:"请输入镜像名,按回车拉取,如:image:v1"},{append:_((function(){return[w(u,{type:"default",onClick:o},{default:_((function(){return t[6]||(t[6]=[E("拉取")])})),_:1})]})),_:1},8,["modelValue"])]})),_:1}),t[7]||(t[7]=j("div",{class:"resultTitle px-[.2rem] py-[.4rem] mt-[1.6rem]"},"拉取结果:",-1)),j("div",W,[w(c,{class:"h-[45.6rem] !rounded-none",content:x(A)},null,8,["content"])])]})),_:1},8,["model","rules","disabled"])]})),_:1}),w(d,{name:"cmd",label:"命令拉取"},{default:_((function(){return[w(l,{ref:"cmdRef",size:"large",model:x(U),rules:x(D),disabled:x(F),class:"relative w-full","label-position":"right",onSubmit:t[4]||(t[4]=L((function(){}),["prevent"]))},{default:_((function(){return[w(a,{prop:"cmd"},{default:_((function(){return[w(i,{autofocus:"",modelValue:x(U).cmd,"onUpdate:modelValue":t[3]||(t[3]=function(e){return x(U).cmd=e}),onKeyup:k(o,["enter"]),placeholder:"请输入需要执行的命令,docker pull redis:latest,按回车执行"},{append:_((function(){return[w(u,{type:"default",onClick:o},{default:_((function(){return t[8]||(t[8]=[E("执行命令")])})),_:1})]})),_:1},8,["modelValue"])]})),_:1}),t[9]||(t[9]=j("div",{class:"resultTitle px-[.2rem] py-[.4rem] mt-[1.6rem]"},"拉取结果:",-1)),j("div",X,[w(c,{class:"h-[45.6rem] !rounded-none",content:x(A)},null,8,["content"])])]})),_:1},8,["model","rules","disabled"])]})),_:1})]})),_:1},8,["modelValue","onChange"])])}}}),[["__scopeId","data-v-f6707562"]]))}}}))}();
Save File
Cancel