← Back
Editing: index-legacy220.js
!function(){function r(r){return function(r){if(Array.isArray(r))return t(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function e(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,t,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.toStringTag||"@@toStringTag";function i(e,o,a,u){var i=o&&o.prototype instanceof s?o:s,l=Object.create(i.prototype);return n(l,"_invoke",function(e,n,o){var a,u,i,s=0,l=o||[],f=!1,p={p:0,n:0,v:r,a:d,f:d.bind(r,4),d:function(t,e){return a=t,u=0,i=r,p.n=e,c}};function d(e,n){for(u=e,i=n,t=0;!f&&s&&!o&&t<l.length;t++){var o,a=l[t],d=p.p,y=a[2];e>3?(o=y===n)&&(i=a[(u=a[4])?5:(u=3,3)],a[4]=a[5]=r):a[0]<=d&&((o=e<2&&d<a[1])?(u=0,p.v=n,p.n=a[1]):d<y&&(o=e<3||a[0]>n||n>y)&&(a[4]=e,a[5]=n,p.n=y,u=0))}if(o||e>1)return c;throw f=!0,n}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,y),u=l,i=y;(t=u<2?r:i)||!f;){a||(u?u<3?(u>1&&(p.n=-1),d(u,i)):p.n=i:p.v=i);try{if(s=2,a){if(u||(o="next"),t=a[o]){if(!(t=t.call(a,i)))throw TypeError("iterator result is not an object");if(!t.done)return t;i=t.value,u<2&&(u=0)}else 1===u&&(t=a.return)&&t.call(a),u<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),u=1);a=r}else if((t=(f=p.n<0)?i:e.call(n,p))!==c)break}catch(t){a=r,u=1,i=t}finally{s=1}}return{value:t,done:f}}}(e,a,u),!0),l}var c={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][a]?t(t([][a]())):(n(t={},a,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function y(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,f):(r.__proto__=f,n(r,u,"GeneratorFunction")),r.prototype=Object.create(d),r}return l.prototype=f,n(d,"constructor",f),n(f,"constructor",l),l.displayName="GeneratorFunction",n(f,u,"GeneratorFunction"),n(d),n(d,u,"Generator"),n(d,a,function(){return this}),n(d,"toString",function(){return"[object Generator]"}),(e=function(){return{w:i,m:y}})()}function n(r,t,e,o){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}n=function(r,t,e,o){function u(t,e){n(r,t,function(r){return this._invoke(t,e,r)})}t?a?a(r,t,{value:e,enumerable:!o,configurable:!o,writable:!o}):r[t]=e:(u("next",0),u("throw",1),u("return",2))},n(r,t,e,o)}function o(r,t,e,n,o,a,u){try{var i=r[a](u),c=i.value}catch(r){return void e(r)}i.done?t(c):Promise.resolve(c).then(n,o)}function a(r){return function(){var t=this,e=arguments;return new Promise(function(n,a){var u=r.apply(t,e);function i(r){o(u,n,a,i,c,"next",r)}function c(r){o(u,n,a,i,c,"throw",r)}i(void 0)})}}System.register(["./utils-lib-legacy.js?v=1765440387","./base-lib-legacy.js?v=1765440387","./form-item-legacy.js?v=1765440387","./__commonjsHelpers__-legacy.js?v=1765440387","./index-legacy94.js?v=1765440387"],function(t,n){"use strict";var o,u,i,c,s,l,f,p,d,y,v,m,g,b,_,h,w,j,O,S;return{setters:[function(r){o=r.ay,u=r.K,i=r.hQ,c=r.hR,s=r.o,l=r.cf,f=r.G},function(r){p=r.r,d=r.c,y=r.az,v=r.g,m=r.e,g=r.B,b=r.c1,_=r.p,h=r.q,w=r.M,j=r.x},function(r){O=r.h,S=r.f},null,null],execute:function(){var n=o(),x=n.refs.settingData,k=n.getSet,U=p([]),R=["不使用加速",x.value.bad_registry_path],L=function(r,t){t(U.value)},A=function(){var r=a(e().m(function r(t){return e().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,u({loading:"正在删除加速URL,请稍候...",request:i({data:JSON.stringify({registry_mirrors_address:t})}),message:!0,success:function(){var r=a(e().m(function r(t){var n,o;return e().w(function(r){for(;;)switch(r.n){case 0:if(!t.status){r.n=2;break}return r.n=1,c();case 1:n=r.v,o=[],Object.entries(n.data.com_reg_mirrors).forEach(function(r){o.push({label:"".concat(r[0],"(").concat(r[1],")"),value:r[0]})}),U.value=o;case 2:return r.a(2)}},r)}));return function(t){return r.apply(this,arguments)}}()});case 1:r.n=3;break;case 2:r.p=2,r.v;case 3:return r.a(2)}},r,null,[[0,2]])}));return function(t){return r.apply(this,arguments)}}(),G=function(){var r=a(e().m(function r(t,n){return e().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,s({title:"设置加速URL",content:"设置后需要重启docker,请确保可以重启docker再操作!"});case 1:return r.n=2,u({loading:"正在设置加速URL,请稍候...",request:l({registry_mirrors_address:"不使用加速"===t.value.registry_mirrors_address?"":t.value.registry_mirrors_address}),message:!0,success:function(r){r.status&&(k(),n())}});case 2:r.n=4;break;case 3:r.p=3,r.v;case 4:return r.a(2)}},r,null,[[0,3]])}));return function(t,e){return r.apply(this,arguments)}}();t("default",d({__name:"index",props:{compData:{default:function(){return{}}}},setup:function(t,n){var o,u=n.expose,i=t,c=y("popupClose",function(){}),s=f({data:function(){return function(r){return x.value.bad_registry?{registry_mirrors_address:x.value.bad_registry_path}:{registry_mirrors_address:""===r.compData.url||"未设置加速URL"===r.compData.url?"不使用加速":JSON.parse(JSON.stringify(r.compData.url))}}(i)},options:function(r){return v(function(){return[O("加速URL",function(){return m(b,{modelValue:r.value.registry_mirrors_address,"onUpdate:modelValue":function(t){return r.value.registry_mirrors_address=t},"fetch-suggestions":L,"popper-class":"my-urlautocomplete",placeholder:"请选择或输入加速URL"},{default:function(t){var e,n=t.item;return m("div",{class:n.value===r.value.registry_mirrors_address?"flex items-center justify-between px-[2rem] bg-[#f5f7fa]":"flex items-center justify-between px-[2rem]"},[m("div",{class:n.value===r.value.registry_mirrors_address?"w-[38rem] truncate bt-link":"w-[38rem] truncate"},[n.label]),(e=n.value,!R.includes(e)&&m("span",{class:"bt-danger",onClick:function(r){r.stopPropagation(),A(n.value)}},[g("删除")]))])},suffix:function(){return m("span",{class:"svgtofont-el-arrow-down"},null)}})},"registry_mirrors_address",{rules:[{validator:function(r,t,e){t&&"不使用加速"!==t&&-1===t.indexOf("http")?e(new Error("请输入正确的加速URL,如https://docker.1ms.run")):e()},trigger:["blur","change"]}]}),S("",[{content:"可选择或手动输入加速URL"},{content:"优先使用加速URL执行操作,请求超时将跳过使用默认加速方式"},{content:"设置加速后需要手动重启docker"}])]})},submit:(o=a(e().m(function r(t,n,o){return e().w(function(r){for(;;)switch(r.n){case 0:G(t,c);case 1:return r.a(2)}},r)})),function(r,t,e){return o.apply(this,arguments)})}),l=s.BtForm,p=s.submit;s.param;return _(function(){U.value=[].concat(r(x.value.options),[{label:"不使用加速",value:"不使用加速"}]),x.value.bad_registry&&U.value.unshift({label:"".concat(x.value.bad_registry_path,"(推荐)"),value:JSON.parse(JSON.stringify(x.value.bad_registry_path))})}),u({onConfirm:p}),function(r,t){return h(),w(j(l),{class:"p-[1.6rem]"})}}}))}}})}();
Save File
Cancel