← Back
Editing: index-legacy71.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)}var e=["type_id"];function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(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 o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function u(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return r};var e,r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.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),u=new N(n||[]);return i(a,"_invoke",{value:P(t,r,u)}),a}function v(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",y="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function j(){}var x={};f(x,c,(function(){return this}));var _=Object.getPrototypeOf,O=_&&_(_(I([])));O&&O!==n&&o.call(O,c)&&(x=O);var S=j.prototype=b.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function L(e,r){function n(i,a,u,c){var l=v(e[i],e,a);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,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 a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return a=a?a.then(o,o):o()}})}function P(t,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=E(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===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=v(t,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function E(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,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=v(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function C(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 T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(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 i=-1,a=function t(){for(;++i<r.length;)if(o.call(r,i))return t.value=r[i],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return w.prototype=j,i(S,"constructor",{value:j,configurable:!0}),i(j,"constructor",{value:w,configurable:!0}),w.displayName=f(j,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},r.awrap=function(t){return{__await:t}},k(L.prototype),f(L.prototype,l,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new L(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(S),f(S,s,"Generator"),f(S,c,(function(){return this})),f(S,"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=I,N.prototype={constructor:N,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(T),!t)for(var r in this)"t"===r.charAt(0)&&o.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 i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){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(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.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 i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},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),T(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;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function c(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,u,"next",t)}function u(t){c(i,n,o,a,u,"throw",t)}a(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./useController-legacy6.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./index-legacy141.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang-legacy.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER"],(function(t,n){"use strict";var o,a,c,s,f,p,v,h,y,d,m,g,b,w,j,x,_,O,S,k,L,P,E,C,T,N,I,G,B,A,D,F,M,U,q,J,R,K,Y,z,H,$,Q,V,W,X,Z,tt,et,rt;return{setters:[function(t){o=t.n,a=t.L,c=t.ai,s=t.K,f=t.b,p=t.u,v=t.aM,h=t.a6,y=t.q,d=t.w,m=t.a8},function(t){g=t._},function(t){b=t.c,w=t.s,j=t.e,x=t.B,_=t.w,O=t.p,S=t.n,k=t.q,L=t.M,P=t.A,E=t.x,C=t.y},function(t){T=t.c,N=t.a,I=t.d,G=t.g,B=t.u},function(t){A=t.b,D=t.g,F=t.d,M=t.f,U=t.h,q=t.s,J=t.i,R=t.k,K=t.u,Y=t.a,z=t.j},function(t){H=t.u,$=t.S},function(t){Q=t.u},function(t){V=t.i,W=t.o,X=t.h},null,function(t){Z=t.modifyProject,tt=t.createProject,et=t.batchStatus,rt=t.batchDelSite}],execute:function(){var nt=f(),ot=H(),it=ot.siteInfo,at=ot.isRefreshList,ut=ot.activeType,ct=$().setSiteInfo,lt=function(){it.value=null,o({title:"添加Go项目",area:62,component:function(){return a((function(){return n.import("./index-legacy365.js?v=VERSION_NUMBER")}),void 0,n.meta.url)},showFooter:!0})},st=function(t){ct(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:""),o({title:"Go项目管理["+t.name+"] -- 添加时间["+t.addtime+"]",area:[84,72],component:function(){return a((function(){return n.import("./index-legacy366.js?v=VERSION_NUMBER")}),void 0,n.meta.url)}})},ft=function(t){var e=t.split("\n").filter((function(t){return""!==t})),r=[];return e.forEach((function(t){var e=t.split("=");r.push({k:e[0],v:e[1]})})),r},pt=(t("a",function(){var t=l(u().mark((function t(e,r,n){var o,i,a,l,f,p;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return""!==(o=Object.assign({},e.value)).domains?(o.bind_extranet=1,o.domains=c(o.domains)?o.domains.split("\n"):o.domains):(o.bind_extranet=0,delete o.domains),i=e.value.env,1===n&&(i=ft(i)),o.env_file=2===n?e.value.envPath:"",o.env_list=JSON.stringify(1===n?i:[]),t.next=8,r();case 8:return a={data:JSON.stringify(o)},l=it.value?Z:tt,t.next=12,s({request:l(a,"go")});case 12:return f=t.sent,p=f.data,nt.msg({dangerouslyUseHTMLString:!0,message:p.status?p.data:p.error_msg,type:p.status?"success":"error",duration:p.status?2e3:0,showClose:!p.status,customClass:"!max-w-[66rem]"}),f.status&&(at.value=!0),t.abrupt("return",f.status);case 17:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}()),function(){var t=l(u().mark((function t(e,r,n,o,a,c){var s,f,p,v,h,y;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=o.label,f=o.value,p=c.enable,v=c.exclude,h=new Map([["start","批量启动选中项目后,项目将正常访问"],["stop","批量停用选中的项目后,项目将会停止运行"],["restart","批量重启选中的项目后,项目将会重新启动"],["delete","批量删除选中的项目后,项目将无法恢复"]]),y=function(){var t=l(u().mark((function t(e){var r,o,i,a,c;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new Map([["start",et],["stop",et],["restart",et],["delete",rt]]),o=r.get(f),t.t0=f,t.next="start"===t.t0||"stop"===t.t0||"restart"===t.t0?5:"delete"===t.t0?12:17;break;case 5:if(!o){t.next=11;break}return i=n.value.map((function(t){return{project_name:t.name}})),a=X(!1,v,p,{params:{site_list:JSON.stringify(i),status:f,project_type:ut.value.toUpperCase()}}),t.next=10,o(a,ut.value);case 10:case 16:return t.abrupt("return",t.sent);case 11:return t.abrupt("break",17);case 12:if(!o){t.next=17;break}return c=X(n.value,v,p,{params:{project_type:ut.value.toUpperCase()}}),t.next=16,o(c);case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),t.next=6,e({title:"批量".concat(s),content:"".concat(h.get(f),",是否继续操作?"),column:[{label:"项目名称",prop:"name"},T()],onConfirm:function(){var t=l(u().mark((function t(){var e,r,n;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y();case 2:e=t.sent,at.value=!0,a&&a(),r=V(e.data),n=(n=r.data).map((function(t){return i(i({},t),{},{name:t.name||t.project_name})})),W(n,{title:"".concat(s,"网站")});case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 6:case"end":return t.stop()}}),t)})));return function(e,r,n,o,i,a){return t.apply(this,arguments)}}()),vt=b({__name:"index",setup:function(t){p();var o=$(),c=o.getSiteList,s=o.setSiteInfo,f=w($()),b=(f.activeType,f.isRefreshList),T=f.siteInfo,H=v({options:[{type:"button",label:"添加项目",active:!0,onClick:lt},{type:"button",label:"SDK版本管理",onClick:function(){R("go")}}]}).BtOperation,V=Q({key:"type_id",name:"Go分类",options:function(){return[{label:"全部分类",value:"all"}]},event:U,ignore:["0"],field:"type_name"}),W=m([{label:"启用项目",value:"start",event:pt},{label:"停用项目",value:"stop",event:pt},{label:"重启项目",value:"restart",event:pt},K(),Y({classList:z}),{label:"删除项目",value:"delete",event:pt}]),X=h({request:function(t){var r=t.type_id,n=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,e);return c({data:JSON.stringify(i(i({},n),{},{type_id:y(r)||"all"===r?"":r}))})},columns:[N({type:"page",key:"id"}),A({onClick:function(t){st(t)}}),D({onClick:function(t,e){if("setting"!==e){var r=t.run?"stop":"start";q(t,"restart"===e?e:r)}else st(t,"state")}}),{label:"PID",isCustom:!1,render:function(t){var e;return y(t.load_info)||0===(null===(e=Object.keys(t.load_info))||void 0===e?void 0:e.length)?"--":Object.entries(t.load_info).map((function(t){var e=r(t,2),n=e[0];e[1];return"".concat(n)})).join(", ")}},{label:"监听端口",isCustom:!1,render:function(t){var e,r;return y(t.listen)||0===(null===(e=t.listen)||void 0===e?void 0:e.length)?"--":(null===(r=t.listen)||void 0===r?void 0:r.join(","))||"--"}},{label:"CPU",isCustom:!1,render:function(t){var e;return y(t.load_info)||0===(null===(e=Object.keys(t.load_info))||void 0===e?void 0:e.length)?"--":Object.entries(t.load_info).map((function(t){var e=r(t,2),n=(e[0],e[1]);return"".concat(n.cpu_percent.toFixed(2),"%")})).join(", ")}},{label:"内存",isCustom:!1,render:function(t){var e;return y(t.load_info)||0===(null===(e=Object.keys(t.load_info))||void 0===e?void 0:e.length)?"--":Object.entries(t.load_info).map((function(t){var e=r(t,2),n=(e[0],e[1]);return"".concat(d(n.memory_used))})).join(", ")}},I(),G({table:"sites",width:200}),F({onClick:function(t){st(t,"ssl")}}),B([{title:"设置",onClick:function(t){st(t)}},{title:"删除",onClick:function(t){J(t)}}])],extension:[V,W],empty:function(){return j("span",null,[x("您的列表为空,您可以"),j("span",{class:"bt-link",onClick:lt},[x("添加一个项目")])])}}),Z=X.BtTable,tt=X.BtPage,et=X.BtRefresh,rt=X.BtSearch,nt=X.BtColumn,ot=X.BtBatch,it=X.BtTableCategory,at=X.refresh,ut=X.config;return _(b,function(){var t=l(u().mark((function t(e){var r,n;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=5;break}return t.next=3,at();case 3:null!==(r=T.value)&&void 0!==r&&r.name&&(n=ut.data.find((function(t){return t.name===T.value.name})))&&s(n),b.value=!1;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),O((function(){S((function(){a((function(){return n.import("./index-legacy365.js?v=VERSION_NUMBER")}),void 0,n.meta.url),a((function(){return n.import("./index-legacy366.js?v=VERSION_NUMBER")}),void 0,n.meta.url)}))})),function(t,e){var r=g;return k(),L(r,null,{"header-left":P((function(){return[j(E(H)),C("div",{class:"flex items-center ml-1rem",onClick:e[0]||(e[0]=function(){return E(M)&&E(M).apply(void 0,arguments)})},e[1]||(e[1]=[C("i",{class:"svgtofont-desired text-[1.6rem]"},null,-1),C("span",{class:"bt-link"},"需求反馈",-1)]))]})),"header-right":P((function(){return[j(E(it),{class:"!w-[200px] mr-[10px]"}),j(E(rt),{class:"mr-[10px]",placeholder:"请输入项目名称或备注"}),j(E(et),{class:"mr-[10px]"}),j(E(nt))]})),content:P((function(){return[j(E(Z))]})),"footer-left":P((function(){return[j(E(ot))]})),"footer-right":P((function(){return[j(E(tt))]})),_:1})}}}),ht=Object.freeze(Object.defineProperty({__proto__:null,default:vt},Symbol.toStringTag,{value:"Module"}));t("i",ht)}}}))}();
Save File
Cancel