← Back
Editing: no-port-config-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(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,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,i=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)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},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 x?e:x,a=Object.create(o.prototype),u=new P(n||[]);return i(a,"_invoke",{value:j(t,r,u)}),a}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 v="suspendedStart",y="suspendedYield",m="executing",d="completed",g={};function x(){}function b(){}function w(){}var E={};f(E,c,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(C([])));_&&_!==o&&a.call(_,c)&&(E=_);var L=w.prototype=x.prototype=Object.create(E);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function I(e,r){function n(o,i,u,c){var l=h(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,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;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 j(t,r,n){var o=v;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===d){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=A(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===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=h(t,r,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function A(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,A(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=h(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 T(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 N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function C(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,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 b.prototype=w,i(L,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=f(w,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"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(I.prototype),f(I.prototype,l,(function(){return this})),r.AsyncIterator=I,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new I(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,c,(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=C,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(N),!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 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 i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){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),N(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;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function o(t,e,r,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).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 u(t){o(i,n,a,u,c,"next",t)}function c(t){o(i,n,a,u,c,"throw",t)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./config-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var o,i,u,c,l,s,f,p,h,v,y,m,d,g,x,b,w,E,k,_,L,S,I,j,A,T,N,P,C;return{setters:[function(t){o=t.n,i=t.L,u=t.p,c=t.K,l=t.M,s=t.k,f=t.c},function(t){p=t.c,h=t.q,v=t.M,y=t.A,m=t.y,d=t.B,g=t.z,x=t.v,b=t.x,w=t.C,E=t.aW,k=t.r,_=t.p,L=t.e,S=t.F,I=t.a_,j=t.P,A=t.af,T=t.D,N=t.ag},function(t){P=t.j},function(t){C=t.ag},null,null,null],execute:function(){var V={class:"text-[1.2rem] flex items-center"},D={key:0,class:"inline-flex items-cenetr"},O=p({__name:"index",props:{tips:{default:""},showSurvey:{type:Boolean,default:!0}},setup:function(t){return function(t,e){var r=E;return h(),v(r,{type:"error",closable:!1,class:"!mb-10px"},{title:y((function(){return[m("div",V,[e[3]||(e[3]=m("i",{class:"svgtofont-el-warning-filled text-[#F56C6C] mr-4px !text-[1.6rem]"},null,-1)),d(" "+g(t.tips||"本功能将在下个正式版本被移除")+", ",1),t.showSurvey?(h(),x("div",D,[e[1]||(e[1]=d(" 如有疑问请直接 ")),e[2]||(e[2]=m("i",{class:"svgtofont-el-service mx-2px text-[#20a53a]"},null,-1)),m("span",{class:"bt-link",onClick:e[0]||(e[0]=function(t){return b(P)()})}," 联系客服")])):w("",!0)])]})),_:1})}}}),R={class:"p-24px"},F={class:"flex items-center"},G={class:"w-[20rem] flex ml-[1rem]"},Y={class:"my-6 flex items-center leading-[3rem]"},K={class:"flex ml-[1rem]"},B={key:0,class:"flex mt-12px"},U={class:"flex-1 mr-20px"},z={class:"flex-1"},M={class:"list-disc text-[#777] px-20px pt-12px"},q={class:"flex items-center"};t("default",p({__name:"no-port-config",props:{compData:{}},emits:["close"],setup:function(t,p){var v=p.emit,E=t,P=v,V=k("auto"),D=[{title:"自定义证书",value:"auto"},{title:"不部署证书",value:"no"},{title:"选择已有证书",value:"select"}],Q=k(E.compData),Z=function(t){V.value=t,"select"===t&&o({title:"选择已有证书",component:function(){return i((function(){return r.import("./cert-list-dialog-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},area:70,compData:{refreshData:function(t){Q.value.domain=(null==t?void 0:t.dns[0].replace(/^\*\./,"panel."))||"",Q.value.cert=(null==t?void 0:t.fullchain)||"",Q.value.key=(null==t?void 0:t.privkey)||"",Q.value.certInfo=t.info||{}}}})},$=function(){if(!E.compData.domain)return l.error("域名不能为空"),!1;return/^(?!:\/\/)([a-zA-Z0-9-_]{1,63}\.)+[a-zA-Z]{2,6}$/.test(E.compData.domain)?!!("no"===V.value||E.compData.key&&E.compData.cert)||(l.error("请填写证书内容"),!1):(l.error("域名格式不正确"),!1)},H=function(){var t=a(n().mark((function t(){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if($()){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,u({title:"提示",icon:"warning-filled",content:"基于Nginx/Apache,如果环境运行异常会导致无法访问,是否继续操作?"});case 4:return t.next=6,c({loading:"正在设置免端口访问配置,请稍候...",request:C({domain:E.compData.domain,key:"no"===V.value?"":Q.value.key,cert:"no"===V.value?"":Q.value.cert}),message:!0});case 6:E.compData.refresh(),P("close");case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),W=function(){var t=a(n().mark((function t(r,o){var a,i,u,c,s,f,p;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-----/],u=[/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/,/-----BEGIN CERTIFICATE REQUEST-----[\s\S]*?-----END CERTIFICATE REQUEST-----/],c=e("key"===r?i:u),t.prev=10,c.s();case 12:if((s=c.n()).done){t.next=26;break}if(f=s.value,!(p=a.match(f))||!p[0]){t.next=24;break}l.success("已从粘贴板检测到".concat("key"===r?"密钥":"证书")),t.t0=r,t.next="key"===t.t0?20:"cert"===t.t0?22:24;break;case 20:return Q.value.key=p[0],t.abrupt("break",24);case 22:return Q.value.cert=p[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),c.e(t.t1);case 31:return t.prev=31,c.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)}}(),J=function(){window.location.href="/site/nginx"};return _((function(){V.value=E.compData.use_ssl?"auto":"no"})),function(t,e){var r=O,n=s,o=N,a=A,i=T,u=f;return h(),x("div",R,[L(r),m("div",F,[e[6]||(e[6]=m("span",null,"绑定域名:",-1)),m("div",G,[L(n,{modelValue:b(Q).domain,"onUpdate:modelValue":e[0]||(e[0]=function(t){return b(Q).domain=t}),placeholder:"请输入绑定域名"},null,8,["modelValue"])])]),m("div",Y,[e[7]||(e[7]=m("span",null,"SSL证书:",-1)),m("div",K,[L(a,{modelValue:b(V),"onUpdate:modelValue":e[1]||(e[1]=function(t){return j(V)?V.value=t:null}),size:"small",onChange:Z},{default:y((function(){return[(h(),x(S,null,I(D,(function(t,e){return L(o,{key:e,label:t.value},{default:y((function(){return[m("span",null,g(t.title),1)]})),_:2},1032,["label"])})),64))]})),_:1},8,["modelValue"])])]),"no"!==b(V)?(h(),x("div",B,[m("div",U,[e[8]||(e[8]=m("div",{class:"text-[1.2rem] mb-[.8rem]"},"密钥(KEY)",-1)),L(n,{class:"text-[1.2rem]",type:"textarea",modelValue:b(Q).key,"onUpdate:modelValue":e[2]||(e[2]=function(t){return b(Q).key=t}),rows:13,size:"small",onFocus:e[3]||(e[3]=function(t){return W("key",b(Q).key)})},null,8,["modelValue"])]),m("div",z,[e[9]||(e[9]=m("div",{class:"text-[1.2rem] mb-[.8rem]"},"证书(PEM格式)",-1)),L(n,{type:"textarea",modelValue:b(Q).cert,"onUpdate:modelValue":e[4]||(e[4]=function(t){return b(Q).cert=t}),rows:13,size:"small",onFocus:e[5]||(e[5]=function(t){return W("cert",b(Q).cert)})},null,8,["modelValue"])])])):w("",!0),L(i,{onClick:H,type:"primary",class:"mt-4"},{default:y((function(){return e[10]||(e[10]=[d("保存")])})),_:1}),m("ul",M,[m("li",null,[e[11]||(e[11]=d("配置后可在网站--反向代理项目中管理,")),m("span",{class:"text-[#20a53a] cursor-pointer",onClick:J},"点击前往")]),e[14]||(e[14]=m("li",null,"配置此域名的证书到面板,浏览器即可信任访问",-1)),m("li",null,[m("div",q,[e[13]||(e[13]=d(" 粘贴您的*.key以及*.pem内容,然后保存即可 ")),L(u,{href:"https://www.bt.cn/bbs/thread-105443-1-1.html"},{default:y((function(){return e[12]||(e[12]=[d("帮助")])})),_:1})])]),e[15]||(e[15]=m("li",null,"如果浏览器提示证书链不完整,请检查是否正确拼接PEM证书",-1)),e[16]||(e[16]=m("li",null,"PEM格式证书 = 域名证书.crt + 根证书(root_bundle).crt",-1))])])}}}))}}}))}();
Save File
Cancel