File: /www/server/panel/BTPanel/static/js/set-url-legacy.js
!function(){function t(r){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(r)}function r(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t)||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 e(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}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 e};var r,e={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function f(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{f({},"")}catch(r){f=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,i=Object.create(o.prototype),u=new U(n||[]);return a(i,"_invoke",{value:O(t,e,u)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",d="suspendedYield",v="executing",m="completed",g={};function b(){}function _(){}function w(){}var x={};f(x,c,(function(){return this}));var L=Object.getPrototypeOf,E=L&&L(L(G([])));E&&E!==o&&i.call(E,c)&&(x=E);var j=w.prototype=b.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(r){f(t,r,(function(t){return this._invoke(r,t)}))}))}function S(r,e){function n(o,a,u,c){var s=p(r[o],r,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==t(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}})}function O(t,e,n){var o=y;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=N(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===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=p(t,e,n);if("normal"===s.type){if(o=n.done?m:d,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function N(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,N(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function A(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function P(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function U(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function G(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function t(){for(;++o<e.length;)if(i.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}throw new TypeError(t(e)+" is not iterable")}return _.prototype=w,a(j,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:_,configurable:!0}),_.displayName=f(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===_||"GeneratorFunction"===(r.displayName||r.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,f(t,l,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},k(S.prototype),f(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(j),f(j,l,"Generator"),f(j,c,(function(){return this})),f(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=G,U.prototype={constructor:U,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(P),!t)for(var e in this)"t"===e.charAt(0)&&i.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,o){return u.type="throw",u.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!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"),s=i.call(a,"finallyLoc");if(c&&s){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(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,r){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&&r&&(this.next=r),g},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),P(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;P(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:G(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},e}function o(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function i(t){return function(){var r=this,e=arguments;return new Promise((function(n,i){var a=t.apply(r,e);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=1777008528","./useStore-legacy4.js?v=1777008528","./utils-lib-legacy.js?v=1777008528","./__commonjsHelpers__-legacy.js?v=1777008528"],(function(t,e){"use strict";var o,a,u,c,s,l,f,h,p,y,d,v,m,g,b,_,w,x,L,E,j,k,S,O;return{setters:[function(t){o=t.c,a=t.h,u=t.r,c=t.o,s=t.k,l=t.l,f=t.e,h=t.x,p=t.p,y=t.q,d=t.F,v=t.v,m=t.N,g=t.z,b=t.bT,_=t.a7,w=t.a4},function(t){x=t.g,L=t.bt,E=t.bu,j=t.bv},function(t){k=t.I,S=t.o,O=t.e},null],execute:function(){var e={class:"p-[1.6rem]"},N=["onClick"],A=o({__name:"set-url",props:{compData:{default:function(){return{}}}},emits:["close"],setup:function(t,o){var O=o.expose,A=o.emit,P=x(),U=P.refs.settingData,G=P.getSet,I=t,R=A,T=a({registry_mirrors_address:"不使用加速"}),F=u([]),D=["不使用加速",U.value.bad_registry_path],C=function(t,r){r(F.value)},q=function(){var t=i(n().mark((function t(r){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,k({loading:"正在删除加速URL,请稍候...",request:L({data:JSON.stringify({registry_mirrors_address:r})}),message:!0,success:function(){var t=i(n().mark((function t(r){var e,o;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.status){t.next=7;break}return t.next=3,E();case 3:e=t.sent,o=[],Object.entries(e.data.com_reg_mirrors).forEach((function(t){o.push({label:"".concat(t[0],"(").concat(t[1],")"),value:t[0]})})),F.value=o;case 7:case"end":return t.stop()}}),t)})));return function(r){return t.apply(this,arguments)}}()});case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),console.log(t.t0);case 8:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(r){return t.apply(this,arguments)}}(),V=function(){var t=i(n().mark((function t(){var r;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,"不使用加速"===(r={registry_mirrors_address:T.registry_mirrors_address}).registry_mirrors_address&&(r.registry_mirrors_address=""),t.next=5,S({title:"设置加速URL",content:"设置后需要重启docker,请确保可以重启docker再操作!"});case 5:return t.next=7,k({loading:"正在设置加速URL,请稍候...",request:j({data:JSON.stringify(r)}),message:!0,success:function(t){t.status&&(G(),R("close"))}});case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),console.log(t.t0);case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(){return t.apply(this,arguments)}}();return c((function(){T.registry_mirrors_address=""===I.compData.url||"未设置加速URL"===I.compData.url?"不使用加速":I.compData.url;F.value=[].concat(r(U.value.options),[{label:"不使用加速",value:"不使用加速"}]),U.value.bad_registry&&(T.registry_mirrors_address=U.value.bad_registry_path,F.value.unshift({label:"".concat(U.value.bad_registry_path,"(推荐)"),value:U.value.bad_registry_path}))})),O({onConfirm:V}),function(t,r){var n=b,o=_,i=w;return s(),l("div",e,[f(i,{ref:"urlFormRef",size:"default",model:p(T),"label-position":"right",onSubmit:r[1]||(r[1]=m((function(){}),["prevent"]))},{default:h((function(){return[f(o,{prop:"registry_mirrors_address",label:"加速URL"},{default:h((function(){return[f(n,{modelValue:p(T).registry_mirrors_address,"onUpdate:modelValue":r[0]||(r[0]=function(t){return p(T).registry_mirrors_address=t}),"fetch-suggestions":C,"popper-class":"my-urlautocomplete",placeholder:"请选择或输入加速URL"},{default:h((function(t){var r,e=t.item;return[y("div",{class:d(["flex items-center justify-between px-[2rem]",e.value===p(T).registry_mirrors_address?"bg-[#f5f7fa]":""])},[y("div",{class:d(["w-[38rem] truncate",e.value===p(T).registry_mirrors_address?"bt-link":""])},v(e.label),3),(r=e.value,D.includes(r)?g("",!0):(s(),l("span",{key:0,class:"bt-danger",onClick:m((function(t){return q(e.value)}),["stop"])},"删除",8,N)))],2)]})),_:1},8,["modelValue"])]})),_:1})]})),_:1},8,["model"]),r[2]||(r[2]=y("ul",{class:"list-disc text-[#777] ml-[11.7rem] mt-[1.5rem]"},[y("li",null,"优先使用加速URL执行操作,请求超时将跳过使用默认加速方式"),y("li",null,"设置加速后需要手动重启docker")],-1))])}}});t("default",O(A,[["__scopeId","data-v-3ab1632a"]]))}}}))}();