← Back
Editing: index-legacy427.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 n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return r(t,e);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)?r(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,a=function(){};return{s:a,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return c=t.done,t},e:function(t){u=!0,i=t},f:function(){try{c||null==n.return||n.return()}finally{if(u)throw i}}}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];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 r};var e,r={},o=Object.prototype,a=o.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(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,a=Object.create(o.prototype),c=new P(n||[]);return i(a,"_invoke",{value:I(t,r,c)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var h="suspendedStart",m="suspendedYield",v="executing",y="completed",g={};function b(){}function x(){}function w(){}var E={};f(E,u,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(N([])));_&&_!==o&&a.call(_,u)&&(E=_);var L=w.prototype=b.prototype=Object.create(E);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function j(e,r){function n(o,i,c,u){var l=d(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&a.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 o;i(this,"_invoke",{value:function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}})}function I(t,r,n){var o=h;return function(a,i){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=T(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(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(t,r,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 T(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,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=d(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function V(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 A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(V,this),this.reset(!0)}function N(r){if(r||""===r){var n=r[u];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function t(){for(;++o<r.length;)if(a.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(t(r)+" is not iterable")}return x.prototype=w,i(L,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:x,configurable:!0}),x.displayName=f(w,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,f(t,s,"GeneratorFunction")),t.prototype=Object.create(L),t},r.awrap=function(t){return{__await:t}},S(j.prototype),f(j.prototype,l,(function(){return this})),r.AsyncIterator=j,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new j(p(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},S(L),f(L,s,"Generator"),f(L,u,(function(){return this})),f(L,"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=N,P.prototype={constructor:P,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(A),!t)for(var r in this)"t"===r.charAt(0)&&a.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 c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),l=a.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&&a.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 i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.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),A(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;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function o(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function c(t){o(i,n,a,c,u,"next",t)}function u(t){o(i,n,a,c,u,"throw",t)}c(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy130.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang-legacy.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var o,i,c,u,l,s,f,p,d,h,m,v,y,g,b,x,w,E,k,_,L,S,j,I,T,V,A,P,N,C,D,O;return{setters:[function(t){o=t.n,i=t.L,c=t.K,u=t.ja,l=t.jb,s=t.jc,f=t.ag,p=t.c,d=t.b},function(t){h=t.c,m=t.r,v=t.k,y=t.p,g=t.q,b=t.v,x=t.x,w=t.M,E=t.A,k=t.y,_=t.C,L=t.z,S=t.J,j=t.e,I=t.F,T=t.a_,V=t.P,A=t.B,P=t.S,N=t.ag,C=t.af,D=t.D},function(t){O=t._},null,null,null,null,null],execute:function(){var R={class:"flex items-center"},F={class:"ml-[1rem]"},G={class:"flex items-center mt-6"},K={class:"w-[20rem] flex ml-[1rem]"},U={class:"flex items-center mt-6"},Y={class:"w-[20rem] flex ml-[1rem]"},B={class:"my-6 flex items-center leading-[3rem]"},M={class:"flex ml-[1rem]"},z=["onClick"],q={key:1,class:"flex mt-[1.2rem]"},Q={class:"flex-1 mr-[2rem]"},H={class:"flex-1"},J={class:"list-disc text-[#777] px-[2rem] pt-[1.2rem]"},$={class:"flex items-center"};t("default",h({__name:"index",props:{compData:{default:function(){return{}}}},emits:["close"],setup:function(t,h){var W=h.emit,X=d(),Z=t,tt=Z.compData.addNoPortLogin,et=m(!1),rt=m(!1),nt=m(!1),ot=m([]),at=v({domain:"",port:"",key:"",cert:""}),it=W,ct=m("auto"),ut=[{title:"不部署证书",value:"no"},{title:"自定义证书",value:"auto"},{title:"选择已有证书",value:"select"}],lt=function(t){at.key=t.key,at.cert=t.cert},st=function(){var t=a(n().mark((function t(){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:c({loading:"正在关闭反向代理,请稍候...",request:u({container_id:Z.compData.row.id}),message:!0,success:function(t){t.status&&(ct.value="no",at.key="",at.cert="",at.port="",at.domain="",rt.value=!1)}});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ft=function(){var t=a(n().mark((function t(r,o){var a,i,c,u,l,s,f;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o){t.next=2;break}return t.abrupt("return");case 2:return t.prev=2,t.next=5,navigator.clipboard.readText();case 5:a=t.sent,i=[/-----BEGIN PRIVATE KEY-----[\s\S]*?-----END PRIVATE KEY-----/,/-----BEGIN RSA PRIVATE KEY-----[\s\S]*?-----END RSA PRIVATE KEY-----/,/-----BEGIN EC PRIVATE KEY-----[\s\S]*?-----END EC PRIVATE KEY-----/],c=[/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/,/-----BEGIN CERTIFICATE REQUEST-----[\s\S]*?-----END CERTIFICATE REQUEST-----/],u=e("key"===r?i:c),t.prev=10,u.s();case 12:if((l=u.n()).done){t.next=26;break}if(s=l.value,!(f=a.match(s))||!f[0]){t.next=24;break}X.success("已从粘贴板检测到".concat("key"===r?"密钥":"证书")),t.t0=r,t.next="key"===t.t0?20:"cert"===t.t0?22:24;break;case 20:return at.key=f[0],t.abrupt("break",24);case 22:return at.cert=f[0],t.abrupt("break",24);case 24:t.next=12;break;case 26:t.next=31;break;case 28:t.prev=28,t.t1=t.catch(10),u.e(t.t1);case 31:return t.prev=31,u.f(),t.finish(31);case 34:t.next=39;break;case 36:t.prev=36,t.t2=t.catch(2);case 39:case"end":return t.stop()}}),t,null,[[2,36],[10,28,31,34]])})));return function(e,r){return t.apply(this,arguments)}}(),pt=function(){var t=a(n().mark((function t(e){var r,o,a,i,c,u,s;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=X.load("正在获取配置中,请稍候..."),t.prev=1,t.next=4,l({container_id:e});case 4:o=t.sent,a=o.data,(i=a.proxy_port).length>0&&(ot.value=i.map((function(t){return{label:t,value:t}})),at.port=i[0]),nt.value=i.length>0,c=a.cert,u=a.key,s=a.name,at.domain=s,ct.value=a.ssl?"auto":"no",rt.value=!!a.status,at.key=u||"",at.cert=c||"",t.next=21;break;case 17:t.prev=17,t.t0=t.catch(1),r.close();case 21:return t.prev=21,r.close(),t.finish(21);case 24:case"end":return t.stop()}}),t,null,[[1,17,21,24]])})));return function(e){return t.apply(this,arguments)}}(),dt=function(){var t=a(n().mark((function t(){var e,r,o;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(at.domain){t.next=3;break}return X.error("域名不能为空"),t.abrupt("return");case 3:if("no"===ct.value){t.next=7;break}if(at.key&&at.cert){t.next=7;break}return X.error("请填写证书内容"),t.abrupt("return");case 7:if(!et.value){t.next=14;break}return e=Z.compData.row,r=e.id,o=e.name,t.next=11,c({request:s({container_id:r,container_name:o,container_port:at.port,domain:at.domain,privateKey:at.key,certPem:at.cert}),message:!0});case 11:pt(Z.compData.row.id),t.next=15;break;case 14:tt(at);case 15:it("close");case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return y((function(){Z.compData.row&&(et.value=!0,pt(Z.compData.row.id))})),function(t,e){var n=O,a=P,c=f,u=N,l=C,s=D,d=p;return g(),b("div",{class:S(x(et)?"":"p-[2.4rem]")},[!x(nt)&&x(et)?(g(),w(n,{key:0,width:"36rem"},{content:E((function(){return e[8]||(e[8]=[k("i",{class:"svgtofont-el-warning-filled text-warning mr-4px text-2rem"},null,-1),k("span",null,"当前容器暂无端口映射,无法做容器反向代理",-1)])})),_:1})):_("",!0),k("div",R,[e[9]||(e[9]=k("span",null,"反向代理状态:",-1)),k("span",F,L(x(rt)?"已开启":"未开启"),1),k("span",{class:S(x(rt)?"svgtofont-icon-start text-[#20a53a]":"svgtofont-icon-stop text-[#ff0000]")},null,2)]),k("div",G,[e[10]||(e[10]=k("span",null,"绑定域名",-1)),k("div",K,[j(a,{modelValue:x(at).domain,"onUpdate:modelValue":e[0]||(e[0]=function(t){return x(at).domain=t}),disabled:x(rt),placeholder:"请输入绑定域名"},null,8,["modelValue","disabled"])])]),k("div",U,[e[11]||(e[11]=k("span",null,"需要代理的本地端口",-1)),k("div",Y,[x(et)&&x(ot).length>0?(g(),w(c,{key:0,modelValue:x(at).port,"onUpdate:modelValue":e[1]||(e[1]=function(t){return x(at).port=t}),placeholder:"请选择端口号",disabled:x(rt),options:x(ot),class:"w-[20rem]"},null,8,["modelValue","disabled","options"])):(g(),w(a,{key:1,modelValue:x(at).port,"onUpdate:modelValue":e[2]||(e[2]=function(t){return x(at).port=t}),type:"number",placeholder:"端口号"},null,8,["modelValue"]))])]),k("div",B,[e[12]||(e[12]=k("span",null,"SSL证书",-1)),k("div",M,[j(l,{modelValue:x(ct),"onUpdate:modelValue":e[3]||(e[3]=function(t){return V(ct)?ct.value=t:null}),size:"small"},{default:E((function(){return[(g(),b(I,null,T(ut,(function(t,e){return j(u,{key:e,value:t.value},{default:E((function(){return[k("span",{onClick:function(e){return n=t.value,ct.value=n,void("select"===n&&o({component:function(){return i((function(){return r.import("./selected-cert-dialog-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},title:"免端口登录",area:70,showFooter:!1,compData:{selectdCert:lt}}));var n}},L(t.title),9,z)]})),_:2},1032,["value"])})),64))]})),_:1},8,["modelValue"])])]),"no"!==x(ct)?(g(),b("div",q,[k("div",Q,[e[13]||(e[13]=k("div",{class:"text-[1.2rem] mb-[.8rem]"},L("密钥(KEY)"),-1)),j(a,{class:"text-[1.2rem]",type:"textarea",modelValue:x(at).key,"onUpdate:modelValue":e[4]||(e[4]=function(t){return x(at).key=t}),rows:13,size:"small",placeholder:"粘贴您的*.key文件内容",onFocus:e[5]||(e[5]=function(t){return ft("key",x(at).key)})},null,8,["modelValue"])]),k("div",H,[e[14]||(e[14]=k("div",{class:"text-[1.2rem] mb-[.8rem]"},L("证书(PEM格式)"),-1)),j(a,{type:"textarea",modelValue:x(at).cert,"onUpdate:modelValue":e[6]||(e[6]=function(t){return x(at).cert=t}),rows:13,size:"small",placeholder:"粘贴您的*.pem文件内容",onFocus:e[7]||(e[7]=function(t){return ft("cert",x(at).cert)})},null,8,["modelValue"])])])):_("",!0),j(s,{onClick:dt,type:"primary",class:"!mt-1rem"},{default:E((function(){return e[15]||(e[15]=[A("保存")])})),_:1}),x(rt)?(g(),w(s,{key:2,onClick:st,class:"!mt-1rem"},{default:E((function(){return e[16]||(e[16]=[A("关闭反向代理")])})),_:1})):_("",!0),k("ul",J,[e[19]||(e[19]=k("li",null,"配置此域名的证书到面板,浏览器即可信任访问",-1)),k("li",null,[k("div",$,[e[18]||(e[18]=A(" 粘贴您的*.key以及*.pem内容,然后保存即可 ")),j(d,{href:"https://www.bt.cn/bbs/thread-105443-1-1.html"},{default:E((function(){return e[17]||(e[17]=[A("帮助")])})),_:1})])]),e[20]||(e[20]=k("li",null,"如果浏览器提示证书链不完整,请检查是否正确拼接PEM证书",-1)),e[21]||(e[21]=k("li",null,"PEM格式证书 = 域名证书.crt + 根证书(root_bundle).crt",-1)),e[22]||(e[22]=k("li",null,[A("如需更多设置,请前往"),k("a",{class:"bt-link",href:"/docker/dockersite"},"Docker--网站")],-1))])],2)}}}))}}}))}();
Save File
Cancel