← Back
Editing: index-legacy29.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function n(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return r};var e,r={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new T(n||[]);return a(i,"_invoke",{value:S(t,r,u)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var m="suspendedStart",v="suspendedYield",d="executing",y="completed",g={};function b(){}function w(){}function x(){}var _={};f(_,c,(function(){return this}));var O=Object.getPrototypeOf,j=O&&O(O(H([])));j&&j!==o&&i.call(j,c)&&(_=j);var k=x.prototype=b.prototype=Object.create(_);function L(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(e,r){function n(o,a,u,c){var l=h(e[o],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):r.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return n("throw",t,u,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function S(t,r,n){var o=m;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,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===m)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=h(t,r,n);if("normal"===l.type){if(o=n.done?y:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function H(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(i.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return w.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},r.awrap=function(t){return{__await:t}},L(E.prototype),f(E.prototype,l,(function(){return this})),r.AsyncIterator=E,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new E(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(k),f(k,s,"Generator"),f(k,c,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=H,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function o(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function u(t){o(a,n,i,u,c,"next",t)}function c(t){o(a,n,i,u,c,"throw",t)}u(void 0)}))}}System.register(["./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./useMethods-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER"],(function(t,o){"use strict";var a,u,c,l,s,f,p,h,m,v,d,y,g,b,w,x,_,O,j,k,L,E,S,P,N,D,T,H,R,C,F,G,q,A,M,I,V;return{setters:[function(t){a=t.k,u=t.r,c=t.ar,l=t.c,s=t.ay,f=t.p,p=t.a4,h=t.q,m=t.v,v=t.e,d=t.A,y=t.y,g=t.x,b=t.O,w=t.F,x=t.a_,_=t.Q,O=t.ao,j=t.an,k=t.a7,L=t.z,E=t.ap},function(t){S=t._},function(t){P=t.K,N=t.bY,D=t.n,T=t.L,H=t.p,R=t.bZ,C=t.M,F=t.ah,G=t.u,q=t.a6,A=t.k},function(t){M=t.a},function(t){I=t.u},function(t){V=t._}],execute:function(){var Y=a({name:"",description:"暂无数据",isRefresh:!0}),z=a({loading:!1,list:[],total:0,tableHeight:"410px"}),B=u(!0);u([]);var J=u(""),K=function(t,e,r,n){var o=t.data;e.value+="".concat(o),o.includes("bt_successful")&&(C.success("拉取成功"),r()),o.includes("bt_failed")&&(C.error("拉取失败"),r())},W=function(){var t=i(n().mark((function t(e,r){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,D({title:"".concat(e.is_pull?"更新":"拉取","镜像"),area:50,component:function(){return T((function(){return o.import("./pull-image-details-dialog-legacy.js?v=VERSION_NUMBER")}),void 0,o.meta.url)},compData:{name:e.name,refresh:r}});case 2:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),Q=(t("p",function(){var t=i(n().mark((function t(e,r){var i;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={model_index:"btdocker",mod_name:"image",def_name:"pull_from_some_registry",ws_callback:111,name:"docker官方库",image:"".concat(e.name,":").concat(e.tag),registry_mirrors:"noSpeed"==J.value?"":J.value},t.next=3,D({title:"拉取镜像",area:65,component:function(){return T((function(){return o.import("./pull-image-log-dialog-legacy.js?v=VERSION_NUMBER")}),void 0,o.meta.url)},compData:{url:"/ws_model",params:i,onWSReceive:K,onRefresh:function(){return r()}}});case 3:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()),function(){var t=i(n().mark((function t(e){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:M({image:e.name});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),U=function(){var t=i(n().mark((function t(e,r){var o;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o={id:e.id,name:e.name,force:"0"},t.prev=1,t.next=4,H({type:"calc",title:"删除镜像【".concat(e.name,"】"),content:"您真的要删除镜像【".concat(e.name,"】吗?")});case 4:P({request:R({data:JSON.stringify(o)}),message:!0,success:r}),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1);case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e,r){return t.apply(this,arguments)}}(),Z=function(t){return{data:z.list.slice((t.p-1)*t.limit,t.p*t.limit),total:z.total}},X=function(){var t=i(n().mark((function t(e){var r;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0===z.list.length||Y.isRefresh){t.next=4;break}return t.abrupt("return",Z(e));case 4:return Y.isRefresh=!1,t.next=7,P({request:N({data:JSON.stringify({name:Y.name})}),data:Array,loading:c(z,"loading")});case 7:return 0===(r=t.sent).length&&(Y.description="没有搜索到".concat(Y.name,"相关的镜像")),z.list=r,z.total=r.length,t.abrupt("return",Z(e));case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),$=function(t){Y.description="暂无数据",Y.name=Y.name.replace(/\s+/g,"")},tt=t("s",null),et=t("l",u("开始拉取镜像...\n")),rt=function(e,r){t("s",tt=F({route:e.compData.url,onMessage:function(t,n){e.compData.onWSReceive(n,et,ot,r)}}))},nt=function(t){var n,o=function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){r(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},t.compData.params);null===(n=tt)||void 0===n||n.send(o)},ot=function(e){tt&&(tt.socket.close(),t("s",tt=null)),e&&e()},it=(t("i",function(){var t=i(n().mark((function t(e,r){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,rt(e,r);case 2:nt(e);case 3:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()),t("u",(function(t){ot(t||!1),et.value="开始拉取镜像...\n"})),{class:"container-dialog p-[2.4rem]"}),at={class:"flex items-center relative"},ut={class:"py-[1rem]"},ct=l({__name:"index",setup:function(t){var e=G().mainHeight,r=s("popupSetFooter",!1),n=u("1ms加速站搜索"),o=function(t){Y.isRefresh=!0,t&&!isNaN(t)&&(D.value.p=t),N()},i=[{value:"1ms",text:"1ms加速站搜索"},{value:"dockerHub",text:"Docker Hub搜索"}],a=function(t){n.value=t.text,function(t){if(""===Y.name)return C.error("请输入需要搜索的镜像名");var e=0===t?"https://1ms.run/search?query=":"https://hub.docker.com/search?type=image&q=";window.open(e+Y.name,"_blank","noopener,noreferrer")}("Docker Hub搜索"==t.text?1:0)},c=q({request:function(t){return X(t)},columns:[{label:"镜像名",prop:"name",width:200},{label:"Start数",prop:"star_count",width:70},{label:"来源",width:60,render:function(t){return t.is_official?"官方":"非官方"}},{label:"描述/说明",prop:"description",showOverflowTooltip:!0},I([{onClick:Q,width:80,title:"创建容器"},{onClick:function(t){var e="https://1ms.run/r/"+(t.is_official?"library/":"");window.open("".concat(e+t.name),"_blank","noopener noreferrer")},title:"简介"},{title:"拉取",render:function(t){return v("span",{class:"cursor-pointer text-primary",onClick:function(){return W(t,o)}},[t.is_pull?["更新",v(V,null,null)]:"拉取"])}},{onClick:function(t){return U(t,o)},isHide:function(t){return!t.is_pull},title:"删除"}])]}),l=c.BtTable,P=c.BtPage,N=c.refresh,D=c.param;return f((function(){!function(t,e,r){setTimeout((function(){if(e)z.tableHeight="410px";else{B.value=!1;var n=t.value-270;z.tableHeight="".concat(n,"px"),n>800&&(r.value.limit=20)}}),0)}(e,r,D)})),p((function(){Y.name="",Y.description="暂无数据",z.list=[],z.total=0,z.loading=!1,z.tableHeight="410px",Y.isRefresh=!0})),function(t,e){var r=A,n=E,u=O,c=j,s=S,f=k;return h(),m("div",it,[v(f,{ref:"searchFormRef",model:g(Y),"label-position":"right",onSubmit:e[5]||(e[5]=_((function(){}),["prevent"]))},{default:d((function(){return[y("div",at,[v(r,{modelValue:g(Y).name,"onUpdate:modelValue":e[0]||(e[0]=function(t){return g(Y).name=t}),class:"!w-[51rem]",onChangePassive:e[1]||(e[1]=function(t){return g($)("name")}),placeholder:"请输入需要搜索的镜像名",clearable:"",onClear:e[2]||(e[2]=function(t){return o(1)}),onKeyup:e[3]||(e[3]=b((function(t){return o(1)}),["enter"]))},null,8,["modelValue"]),v(c,{onCommand:a,"split-button":"",class:"ml-8px",type:"primary"},{dropdown:d((function(){return[v(u,null,{default:d((function(){return[(h(),m(w,null,x(i,(function(t){return v(n,{key:t.value,command:t},{default:d((function(){return[y("span",null,L(t.text),1)]})),_:2},1032,["command"])})),64))]})),_:1})]})),default:d((function(){return[y("span",{onClick:e[4]||(e[4]=_((function(t){return o(1)}),["stop"]))},"搜索")]})),_:1})]),y("div",ut,[v(s,null,{content:d((function(){return[v(g(l),{"max-height":g(z).tableHeight},null,8,["max-height"])]})),"footer-right":d((function(){return[v(g(P))]})),_:1})])]})),_:1},8,["model"])])}}}),lt=Object.freeze(Object.defineProperty({__proto__:null,default:ct},Symbol.toStringTag,{value:"Module"}));t("a",lt)}}}))}();
Save File
Cancel