← Back
Editing: index-legacy76.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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){return n};var e,n={},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",s=u.asyncIterator||"@@asyncIterator",l=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 b?e:b,a=Object.create(o.prototype),u=new T(n||[]);return i(a,"_invoke",{value:P(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}}}n.wrap=p;var v="suspendedStart",y="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function x(){}var j={};f(j,c,(function(){return this}));var _=Object.getPrototypeOf,O=_&&_(_(G([])));O&&O!==o&&a.call(O,c)&&(j=O);var S=x.prototype=b.prototype=Object.create(j);function L(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(e,r){function n(o,i,u,c){var s=h(e[o],e,i);if("throw"!==s.type){var l=s.arg,f=l.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){l.value=t,u(l)}),(function(t){return n("throw",t,u,c)}))}c(s.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 P(t,r,n){var o=v;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===m){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=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===v)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(t,r,n);if("normal"===s.type){if(o=n.done?m:y,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.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 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 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 N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function G(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 w.prototype=x,i(S,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},n.awrap=function(t){return{__await:t}},L(k.prototype),f(k.prototype,s,(function(){return this})),n.AsyncIterator=k,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new k(p(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},L(S),f(S,l,"Generator"),f(S,c,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),n.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}},n.values=G,T.prototype={constructor:T,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"),s=a.call(i,"finallyLoc");if(c&&s){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(!s)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:G(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},n}function n(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 o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(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 i(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 u(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function u(t){i(a,n,o,u,c,"next",t)}function c(t){i(a,n,o,u,c,"throw",t)}u(void 0)}))}}System.register(["./index-legacy103.js?v=VERSION_NUMBER","./index-legacy141.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./utils-lib-legacy.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","./column-legacy.js?v=VERSION_NUMBER","./useController-legacy6.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER"],(function(t,n){"use strict";var a,i,c,s,l,f,p,h,v,y,d,m,g,b,w,x,j,_,O,S,L,k,P,E,C,N,T,G,B,I,M,F,J,q,A,D,R,U,Y,z,H,K,Q,V;return{setters:[function(t){a=t._},function(t){i=t.u},function(t){c=t.r,s=t.c,l=t.s,f=t.e,p=t.B,h=t.w,v=t.p,y=t.q,d=t.M,m=t.A,g=t.x,b=t.y},function(t){w=t.n,x=t.L,j=t.bv,_=t.M,O=t.p,S=t.u,L=t.aM,k=t.a6,P=t.q,E=t.a8},function(t){C=t.f},null,function(t){N=t.c,T=t.a,G=t.d,B=t.g,I=t.u},function(t){M=t.b,F=t.g,J=t.c,q=t.d,A=t.f,D=t.h,R=t.s,U=t.u,Y=t.a,z=t.j},function(t){H=t.u,K=t.S},function(t){Q=t.setProject,V=t.removeProject}],execute:function(){var W=H(),X=W.activeType,Z=(W.settingTabActive,W.siteInfo),$=W.isRefreshList,tt=K(),et=tt.addGeneralProject,rt=tt.editGeneralProject,nt=tt.delGeneralProjectEvent,ot=tt.setSiteInfo,at=tt.getRootUser,it=tt.getProjectConfig,ut=t("u",c([])),ct=function(){Z.value=null,w({title:"添加通用项目",area:62,component:function(){return x((function(){return n.import("./index-legacy376.js?v=VERSION_NUMBER")}),void 0,n.meta.url)},showFooter:!0})},st=function(t,e){ot(t,e),w({title:"通用项目管理["+t.name+"] -- 添加时间["+t.addtime+"]",area:[84,72],component:function(){return x((function(){return n.import("./index-legacy377.js?v=VERSION_NUMBER")}),void 0,n.meta.url)}})},lt=function(){var t=u(r().mark((function t(e,n,a,i){var c,s,l,f;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=i.label,s=i.value,l=new Map([["start","批量启动选中项目后,项目将正常访问"],["stop","批量停用选中的项目后,项目将会停止运行"],["restart","批量重启选中的项目后,项目将会重新启动"],["delete","批量删除选中的项目后,项目将无法恢复"]]),f=function(){var t=u(r().mark((function t(e,n){var a,i,u,c,l;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=new Map([["start",Q],["stop",Q],["restart",Q],["delete",V]]),i=e.name,u=a.get(s),t.t0=s,t.next="start"===t.t0||"stop"===t.t0||"restart"===t.t0?6:"delete"===t.t0?14:18;break;case 6:if(!u){t.next=14;break}return t.next=9,u({data:JSON.stringify({project_name:i})},X.value,s);case 9:if(c=t.sent,l=c.status?1:2,"start"!==s){t.next=13;break}return t.abrupt("return",o(o({},e),{},{batchStatus:l,message:c.msg.replace(/<br>/g,"\n")}));case 13:return t.abrupt("return",o(o({},e),{},{batchStatus:l,message:c.status?c.data.msg:c.data.data}));case 14:if(!u){t.next=18;break}return t.next=17,u({data:JSON.stringify({project_name:i})},X.value);case 17:return t.abrupt("return",t.sent);case 18:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),t.next=5,e({title:"批量".concat(c),content:"".concat(l.get(s),",是否继续操作?"),column:[{label:"项目名称",prop:"name"},N()],onConfirm:function(){var t=u(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n(f);case 2:return $.value=!0,t.abrupt("return",!1);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 5:case"end":return t.stop()}}),t)})));return function(e,r,n,o){return t.apply(this,arguments)}}(),ft=(t("o",(function(t,e){C({type:"file",path:t,change:function(t){e&&e(t)}})})),t("a",u(r().mark((function t(){var e,n,a,i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,at();case 2:if(e=t.sent,n=e.data,ut.value=n.map((function(t){return{label:t,value:t}})),!Z.value){t.next=11;break}return t.next=8,it({data:JSON.stringify({project_name:Z.value.name})});case 8:return a=t.sent,i=a.data,t.abrupt("return",o(o({},null==i?void 0:i.project_config),{},{project_ps:null==i?void 0:i.ps,is_power_on:!(null==i||!i.project_config.is_power_on),project_log:null!=i&&i.project_config.project_log?1:0,web_log:null!=i&&i.project_config.web_log?1:0}));case 11:return t.abrupt("return",{project_exe:"",project_name:"",port:"",project_cmd:"",run_user:"www",project_ps:"",domains:"",release_firewall:!1,is_power_on:!1,bind_extranet:!1});case 12:case"end":return t.stop()}}),t)})))),t("s",function(){var t=u(r().mark((function t(e){var n,a,i,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,""!==(n=o({},e)).domains?(n.bind_extranet=1,a=j(n.domains,"string",""),n.domains=a.split("\n")):(n.bind_extranet=0,delete n.domains),Z.value&&(n.id=Z.value.id),i=Z.value?rt:et,t.next=7,i({data:JSON.stringify(n)});case 7:return u=t.sent,_.msg({dangerouslyUseHTMLString:!0,message:u.msg,type:u.status?"success":"error",duration:u.status?2e3:0,showClose:!u.status,customClass:"!max-w-[66rem]"}),$.value=!0,t.abrupt("return",u.status);case 13:return t.prev=13,t.t0=t.catch(0),t.abrupt("return",{status:!1,msg:"发生错误"});case 17:case"end":return t.stop()}}),t,null,[[0,13]])})));return function(e){return t.apply(this,arguments)}}()),function(){var t=u(r().mark((function t(e){var n,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,O({title:"删除项目-".concat(e.name),content:"风险操作,此操作不可逆,删除".concat(e.name,"项目后您将无法管理该项目,是否继续操作?"),type:"calc"});case 3:return n={data:JSON.stringify({project_name:e.name})},t.next=6,nt(n);case 6:return o=t.sent,_.request(o),$.value=!0,t.abrupt("return",o);case 12:return t.prev=12,t.t0=t.catch(0),t.abrupt("return",{status:!1,msg:"删除项目失败"});case 16:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e){return t.apply(this,arguments)}}()),pt=s({__name:"index",setup:function(t){S();var n=K(),c=n.getSiteList,s=n.setSiteInfo,w=l(K()),x=w.isRefreshList,_=w.siteInfo,O=L({options:[{type:"button",label:"添加项目",active:!0,onClick:ct}]}).BtOperation,C=i({key:"type_id",name:"Other分类",options:function(){return[{label:"全部分类",value:"all"}]},event:D,ignore:["0"],field:"type_name"}),N=E([{label:"启动项目",value:"start",event:lt},{label:"停用项目",value:"stop",event:lt},{label:"重启项目",value:"restart",event:lt},U(),Y({classList:z}),{label:"删除项目",value:"delete",event:lt}]),H=k({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 a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,e);return c({data:JSON.stringify(o(o({},n),{},{type_id:P(r)||"all"===r?"":r}))})},columns:[T(),M({onClick:function(t){st(t)}}),F({onClick:function(t,e){if("setting"!==e){var r=t.run?"stop":"start";R(t,"restart"===e?e:r)}else st(t,"state")}}),{label:"运行端口",isCustom:!0,render:function(t){var e=j(t.listen,"array",[]);return 0==e.length?"--":e.join("、")}},G(),J(),B({table:"sites",width:200}),q({onClick:function(t){st(t,"ssl")}}),I([{title:"设置",onClick:function(t){return st(t)}},{title:"删除",onClick:ft}])],extension:[C,N],empty:function(){return f("span",null,[p("您的列表为空,您可以"),f("span",{class:"bt-link",onClick:ct},[p("添加一个项目")])])}}),Q=H.BtTable,V=H.BtPage,W=H.BtRefresh,X=H.BtSearch,Z=H.BtColumn,$=H.BtBatch,tt=H.BtTableCategory,et=H.refresh,rt=H.config;return h(x,function(){var t=u(r().mark((function t(e){var n,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=5;break}return t.next=3,et();case 3:null!==(n=_.value)&&void 0!==n&&n.name&&(o=rt.data.find((function(t){return t.name===_.value.name})))&&s(o),x.value=!1;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),v((function(){})),function(t,e){var r=a;return y(),d(r,null,{"header-left":m((function(){return[f(g(O)),b("div",{class:"flex items-center ml-1rem",onClick:e[0]||(e[0]=function(){return g(A)&&g(A).apply(void 0,arguments)})},e[1]||(e[1]=[b("i",{class:"svgtofont-desired text-[1.6rem]"},null,-1),b("span",{class:"bt-link"},"需求反馈",-1)]))]})),"header-right":m((function(){return[f(g(tt),{class:"!w-[200px] mr-[10px]"}),f(g(X),{class:"mr-[10px]",placeholder:"请输入项目名称或备注"}),f(g(W),{class:"mr-[10px]"}),f(g(Z))]})),content:m((function(){return[f(g(Q),null,{empty:m((function(){return e[2]||(e[2]=[p(" 您的列表为空,您可以添加一个项目 ")])})),_:1})]})),"footer-left":m((function(){return[f(g($))]})),"footer-right":m((function(){return[f(g(V))]})),_:1})}}}),ht=Object.freeze(Object.defineProperty({__proto__:null,default:pt},Symbol.toStringTag,{value:"Module"}));t("i",ht)}}}))}();
Save File
Cancel