← Back
Editing: pull-image-details-dialog-legacy.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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return n};var r,n={},a=Object.prototype,o=a.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.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(r){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var a=e&&e.prototype instanceof w?e:w,o=Object.create(a.prototype),c=new G(n||[]);return i(o,"_invoke",{value:S(t,r,c)}),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var v="suspendedStart",d="suspendedYield",y="executing",m="completed",g={};function w(){}function x(){}function b(){}var _={};f(_,u,(function(){return this}));var L=Object.getPrototypeOf,j=L&&L(L(N([])));j&&j!==a&&o.call(j,u)&&(_=j);var E=b.prototype=w.prototype=Object.create(_);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,r){function n(a,i,c,u){var l=h(e[a],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,a){n(t,e,r,a)}))}return a=a?a.then(o,o):o()}})}function S(t,e,n){var a=v;return function(o,i){if(a===y)throw Error("Generator is already running");if(a===m){if("throw"===o)throw i;return{value:r,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var u=V(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===v)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=y;var l=h(t,e,n);if("normal"===l.type){if(a=n.done?m:d,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function V(t,e){var n=e.method,a=t.iterator[n];if(a===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,V(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=h(a,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,g;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function P(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 G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function t(){for(;++a<e.length;)if(o.call(e,a))return t.value=e[a],t.done=!1,t;return t.value=r,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return x.prototype=b,i(E,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:x,configurable:!0}),x.displayName=f(b,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,f(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},n.awrap=function(t){return{__await:t}},k(O.prototype),f(O.prototype,l,(function(){return this})),n.AsyncIterator=O,n.async=function(t,e,r,a,o){void 0===o&&(o=Promise);var i=new O(p(t,e,r,a),o);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},k(E),f(E,s,"Generator"),f(E,u,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),n.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}},n.values=N,G.prototype={constructor:G,reset:function(t){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(D),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},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 e=this;function n(n,a){return c.type="throw",c.arg=t,e.next=n,a&&(e.method="next",e.arg=r),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.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&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},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 a=n.arg;D(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(t,e,r,n,a,o,i){try{var c=t[o](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,a)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(a,o){var i=t.apply(e,n);function c(t){r(i,a,o,c,u,"next",t)}function u(t){r(i,a,o,c,u,"throw",t)}c(void 0)}))}}System.register(["./base-lib-legacy.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy29.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./useMethods-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var a,o,i,c,u,l,s,f,p,h,v,d,y,m,g,w,x,b,_,L,j;return{setters:[function(t){a=t.c,o=t.ay,i=t.r,c=t.g,u=t.p,l=t.q,s=t.v,f=t.y,p=t.z,h=t.x,v=t.e,d=t.A,y=t.J,m=t.B,g=t.c2,w=t.D},function(t){x=t.i2,b=t.i3,_=t.M,L=t.e},function(t){j=t.p},null,null,null,null,null],execute:function(){var r={class:"flex-wrap p-[2rem]"},E={class:""},k={class:"bg-[#f8f8f8] p-[2rem] rounded-[.4rem]"},O={class:"text-[16px]"},S={class:"mt-[1rem] text-[#666]"},V={class:"flex mt8px"},P=["title"],D={class:"max-w-[25rem]"},G={class:"text-[1.4rem] leading-[1.4] max-w-[25rem] truncate"},N={class:"text-[1.2rem] leading-[1.2] text-[#ccc] mt-[1rem]"},T={class:"name"},F=a({__name:"pull-image-details-dialog",props:{compData:{default:function(){return{name:""}}}},setup:function(t){var a=t;o("popupClose",(function(){}));var L=i({id:0,selectValue:"",detail:{name:"",last_updated:"",is_official:!1,pull_count:0}}),F=c((function(){var t=L.value.detail.pull_count;return t?t.toLocaleString():""})),I=c((function(){return"library"===L.value.detail.namespace?"是":"否"})),A=i([]),C=function(t){L.value.selectValue=t.tag_name},H=function(t,r){var a=function(){var a=n(e().mark((function n(){var a,o,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M();case 2:a=A.value,o=L.value.selectValue,i=t===o?a.sort((function(t,e){return t.tag_name===o&&e.tag_name!==o?-1:t.tag_name!==o&&e.tag_name===o?1:0})):a.filter((function(e){return e.tag_name.includes(t)})),r(i);case 6:case"end":return e.stop()}}),n)})));return function(){return a.apply(this,arguments)}}();a()},M=function(){var t=n(e().mark((function t(){var r,n,o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=L.value.id,t.next=3,b({image:a.compData.name,id:r,search:L.value.selectValue});case 3:n=t.sent,o=n.data,i=o.data,A.value=i;case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Y=function(){var t=n(e().mark((function t(){var r;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=L.value.selectValue){t.next=4;break}return _.error("未获取到镜像ID,请选择一个镜像"),t.abrupt("return",!1);case 4:return t.next=6,j({name:a.compData.name,tag:r},a.compData.refresh);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return u(n(e().mark((function t(){var r,n,o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,x({image:a.compData.name});case 3:return r=t.sent,n=r.data,o=n.data,L.value.detail=o,L.value.id=o.id,t.next=10,M();case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0);case 15:case"end":return t.stop()}}),t,null,[[0,12]])})))),function(t,e){var n=g,o=w;return l(),s("div",r,[f("div",E,[f("div",k,[f("strong",O,p(a.compData.name),1),f("ul",S,[f("li",null,[e[1]||(e[1]=f("span",null,"最近一次更新时间:",-1)),f("span",null,p(h(L).detail.last_updated),1)]),f("li",null,[e[2]||(e[2]=f("span",null,"是否为官方镜像:",-1)),f("span",null,p(h(I)),1)]),e[4]||(e[4]=f("li",null,[f("span",null,"来源:"),f("span",null,"Docker Hub")],-1)),f("li",null,[e[3]||(e[3]=f("span",null,"Pulls量:",-1)),f("span",null,p(h(F)),1)])])])]),f("div",V,[v(n,{"popper-class":"my-autocomplete",modelValue:h(L).selectValue,"onUpdate:modelValue":e[0]||(e[0]=function(t){return h(L).selectValue=t}),class:"!w-[40rem]","popper-append-to-body":!1,"fetch-suggestions":H,onSelect:C,placeholder:"请选择或搜索镜像"},{default:d((function(t){var e,r=t.item;return[f("div",{class:y(["flex items-center justify-between py-[1rem]",r.tag_name===h(L).selectValue?" text-[#20a53a] hover:text-[#1d9534]":""]),title:"".concat(r.tag_name)},[f("div",D,[f("div",G,p("".concat(r.tag_name)),1),f("div",N,p("".concat((null===(e=r.digest)||void 0===e?void 0:e.slice(0,30))||"")),1)]),f("span",T,p(r.last_updated)+"更新",1)],10,P)]})),_:1},8,["modelValue"]),v(o,{type:"primary",class:"ml-8px",onClick:Y},{default:d((function(){return e[5]||(e[5]=[m("拉取")])})),_:1})])])}}});t("default",L(F,[["__scopeId","data-v-45d313ac"]]))}}}))}();
Save File
Cancel