← Back
Editing: group-detail-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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return n};var r,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 p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(r){p=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),u=new G(n||[]);return i(a,"_invoke",{value:L(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=f;var v="suspendedStart",m="suspendedYield",d="executing",y="completed",g={};function b(){}function w(){}function _(){}var x={};p(x,c,(function(){return this}));var k=Object.getPrototypeOf,j=k&&k(k(C([])));j&&j!==o&&a.call(j,c)&&(x=j);var E=_.prototype=b.prototype=Object.create(x);function O(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function D(e,r){function n(o,i,u,c){var s=h(e[o],e,i);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==t(p)&&a.call(p,"__await")?r.resolve(p.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):r.resolve(p).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 L(t,e,n){var o=v;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=P(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=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=h(t,e,n);if("normal"===s.type){if(o=n.done?y:m,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function P(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,P(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=h(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,g;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function S(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 G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function C(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,i=function t(){for(;++o<e.length;)if(a.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return w.prototype=_,i(E,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:w,configurable:!0}),w.displayName=p(_,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,_):(t.__proto__=_,p(t,l,"GeneratorFunction")),t.prototype=Object.create(E),t},n.awrap=function(t){return{__await:t}},O(D.prototype),p(D.prototype,s,(function(){return this})),n.AsyncIterator=D,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new D(f(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(E),p(E,l,"Generator"),p(E,c,(function(){return this})),p(E,"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=C,G.prototype={constructor:G,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(T),!t)for(var e in this)"t"===e.charAt(0)&&a.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 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),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,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(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 n(t){return function(){var e=this,n=arguments;return new Promise((function(o,a){var i=t.apply(e,n);function u(t){r(i,o,a,u,c,"next",t)}function c(t){r(i,o,a,u,c,"throw",t)}u(void 0)}))}}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 a(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){i(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 i(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}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var o,i,u,c,s,l,p,f,h,v,m,d,y,g,b,w,_,x,k,j,E,O,D,L,P,S,T,G,C,N,q,I,F,A,V,z,J;return{setters:[function(t){o=t.n,i=t.L,u=t.p,c=t.b,s=t.l,l=t.j,p=t.cE,f=t.e},function(t){h=t._},function(t){v=t.r,m=t.c,d=t.e,y=t.k,g=t.p,b=t.a4,w=t.G,_=t.q,x=t.v,k=t.A,j=t.B,E=t.z,O=t.x,D=t.H,L=t.I,P=t.y,S=t.M,T=t.C,G=t.P,C=t.n,N=t.D},function(t){q=t.delGroupProject,I=t.getJavaGroupDetail,F=t.groupProjectOperation,A=t.editGroupProject,V=t.groupProjectType,z=t.getGroupLog},function(t){J=t.u}],execute:function(){var M=t("j",v({})),Y={class:"p-[2rem]"},B={class:"flex items-center"},H={key:2,class:"ml-[1rem]"},U={class:"p-[2rem]"},K=m({__name:"group-detail",props:{compData:{}},setup:function(t){var f,m=t,K=c(),Q=0,R=null,W=v([{name:"test",status:"test",pid:"test",listen:[]}]),X=v([]),Z=v("simultaneous"),$=v(!1),tt=v(!0),et=[{prop:"name",label:"项目名称"},{prop:"pid",label:"PID"},{prop:"status",label:"项目状态",render:function(t){var e="--",r="#20a53a";switch(t.project_status){case"succeeded":e="运行中";break;case"failed":e="未运行或运行异常",r="#ef0808";break;case"not_run":e="未运行",r="#ef0808";break;default:e="--",r="#555"}return d("span",{style:"color: ".concat(r,";")},[e])}},{prop:"listen",label:"端口",render:function(t){var e;return d("span",null,[(null===(e=t.listen)||void 0===e?void 0:e.join(","))||"--"])}},J([{onClick:function(t){o({isAsync:!0,title:"项目【".concat(m.compData.group_name,"】检查策略"),area:50,btn:"确定",component:function(){return i((function(){return r.import("./project-check-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:a(a({},t),{},{group_id:m.compData.group_id,refreshEvent:ft})})},title:"检测策略"},{onClick:(f=n(e().mark((function t(r,n){var o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,u({title:"移除项目【".concat(r.name,"】"),width:"35rem",icon:"warning",content:"您真的要将项目【".concat(r.name,"】从本项目组移除吗?")});case 3:return t.next=5,q({group_id:m.compData.group_id,project_id:r.id});case 5:o=t.sent,K.request(o),o.status&&(ft(),m.compData.refreshEvent&&m.compData.refreshEvent()),t.next=12;break;case 10:t.prev=10,t.t0=t.catch(0);case 12:case"end":return t.stop()}}),t,null,[[0,10]])}))),function(t,e){return f.apply(this,arguments)}),title:"从项目组中移除",width:140}])],rt=[{label:"",width:50,render:function(t){return d("i",{class:"svgtofont-icon-drag cursor-move mover iconfont align-middle",title:"拖拽排序"},null)}},{prop:"name",label:"项目名称"},{prop:"pid",label:"PID"},{prop:"port",label:"端口"}],nt=y({start:!1,stop:!1,termination:!1,statusText:""}),ot=function(){var t=n(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o({title:"【".concat(m.compData.group_name,"】添加项目"),area:50,showFooter:!0,component:function(){return i((function(){return r.import("./group-add-projects-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:{group_id:m.compData.group_id,refreshEvent:function(){ft(),m.compData.refreshEvent&&m.compData.refreshEvent()},projectList:W.value}});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),at=function(t,e){return(e||m.compData).operation_info.includes(t)},it=function(){var t=n(e().mark((function t(r){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,F({group_id:m.compData.group_id},r);case 3:n=t.sent,K.request(n),ft(),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(0);case 10:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),ut=function(){var t=n(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(W.value.length){t.next=3;break}return K.error("暂无项目数据"),t.abrupt("return");case 3:X.value=[],X.value=W.value.map((function(t){return{id:t.id,name:t.name,check_info:t.check_info,level:t.level}})),$.value=!0,$.value&&C((function(){var t,r;r=document.querySelector(".level-table .el-table__body-wrapper tbody"),p.create(r,{animation:500,onEnd:(t=n(e().mark((function t(r){var n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=X.value.splice(r.oldIndex,1)[0],X.value.splice(r.newIndex,0,n);case 2:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})})}));case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ct=function(){var t=n(e().mark((function t(){var r;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,X.value.forEach((function(t,e){t.level=e+1})),t.next=4,A({group_id:m.compData.group_id,project_datas:JSON.stringify(X.value)});case 4:r=t.sent,K.request(r),r.status&&($.value=!1,ft()),t.next=11;break;case 9:t.prev=9,t.t0=t.catch(0);case 11:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(){return t.apply(this,arguments)}}(),st=function(){var t=n(e().mark((function t(){var r;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,V({group_id:m.compData.group_id,sort_type:"simultaneous"===Z.value?"sequence":"simultaneous"});case 3:r=t.sent,K.request(r),r.status&&(Z.value="simultaneous"===Z.value?"sequence":"simultaneous"),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(0);case 10:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(){return t.apply(this,arguments)}}(),lt=function(){var t=n(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o({isAsync:!0,title:"项目组【".concat(m.compData.group_name,"】日志"),area:84,component:function(){return i((function(){return r.import("./group-logs-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:m.compData,cancel:function(){ft()}});case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),pt=function(){var t=n(e().mark((function t(){var r,n;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,z({group_id:m.compData.group_id,last_write_time:Q});case 3:if(!(r=t.sent).status){t.next=21;break}if(M.value=r.data,r.data.running){t.next=12;break}return R&&clearTimeout(R),R=null,Q=0,ft(),t.abrupt("return");case 12:if(r.data.last_write_time==Q){t.next=17;break}return t.next=15,I({group_id:m.compData.group_id});case 15:(n=t.sent).status&&ht(n.data);case 17:R=setTimeout((function(){pt()}),2e3),Q=r.data.last_write_time,t.next=25;break;case 21:R&&clearTimeout(R),R=null,Q=0,ft();case 25:t.next=29;break;case 27:t.prev=27,t.t0=t.catch(0);case 29:case"end":return t.stop()}}),t,null,[[0,27]])})));return function(){return t.apply(this,arguments)}}(),ft=function(){var t=n(e().mark((function t(){var r;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,tt.value=!0,t.next=4,I({group_id:m.compData.group_id});case 4:(r=t.sent).status?(ht(r.data),""!==r.data.now_operation&&r.data.now_operation&&!R?pt():(R&&clearTimeout(R),R=null,Q=0)):K.error(r.msg),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(0);case 10:return t.prev=10,tt.value=!1,t.finish(10);case 13:case"end":return t.stop()}}),t,null,[[0,8,10,13]])})));return function(){return t.apply(this,arguments)}}(),ht=function(t){W.value=t.projects,Z.value=t.sort_type,nt.start=at("start",t),nt.stop=at("stop",t),nt.termination=at("termination",t),nt.statusText="start"===t.now_operation?"状态:启动运行中":"状态:停止运行中"};return g(n(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ft();case 2:case"end":return t.stop()}}),t)})))),b((function(){R&&clearTimeout(R),R=null,M.value={},m.compData.refreshEvent&&m.compData.refreshEvent()})),function(t,e){var r=N,n=s,o=h,a=l,i=w("bt-loading");return _(),x("div",Y,[d(o,null,{"header-left":k((function(){return[d(r,{type:"primary",onClick:ot},{default:k((function(){return e[4]||(e[4]=[j("添加新项目")])})),_:1}),d(r,{type:"default",class:"ml-1rem",onClick:st},{default:k((function(){return[j("启动方式:"+E("simultaneous"==O(Z)?"同时启动":"依次启动"),1)]})),_:1}),D(d(r,{type:"default",class:"ml-[1rem]",onClick:ut},{default:k((function(){return e[5]||(e[5]=[j("修改项目启动顺序")])})),_:1},512),[[L,"sequence"==O(Z)]])]})),"header-right":k((function(){return[P("div",B,[O(nt).start?(_(),S(r,{key:0,type:"default",class:"ml-[1rem]",onClick:e[0]||(e[0]=function(t){return it("start")})},{default:k((function(){return e[6]||(e[6]=[j("启动")])})),_:1})):T("",!0),O(nt).stop?(_(),S(r,{key:1,type:"default",class:"ml-[1rem]",onClick:e[1]||(e[1]=function(t){return it("stop")})},{default:k((function(){return e[7]||(e[7]=[j("停止")])})),_:1})):T("",!0),O(nt).termination?(_(),x("span",H,E(O(nt).statusText),1)):T("",!0),O(nt).termination?(_(),S(r,{key:3,type:"default",class:"ml-[1rem]",onClick:e[2]||(e[2]=function(t){return it("termination")})},{default:k((function(){return e[8]||(e[8]=[j("终止")])})),_:1})):T("",!0),O(nt).termination?(_(),x("span",{key:4,class:"ml-[1rem] text-primary cursor-pointer",onClick:lt},"日志")):T("",!0)])]})),content:k((function(){return[D(d(n,{"max-height":300,column:et,data:O(W)},null,8,["data"]),[[i,O(tt)]])]})),"footer-left":k((function(){return e[9]||(e[9]=[])})),popup:k((function(){return[d(a,{title:"启动优先级排序",class:"overflow-hidden",modelValue:O($),"onUpdate:modelValue":e[3]||(e[3]=function(t){return G($)?$.value=t:null}),area:65,"show-footer":!0,onConfirm:ct},{default:k((function(){return[P("div",U,[d(o,null,{content:k((function(){return[D(d(n,{"max-height":300,class:"level-table","row-key":"name",column:rt,data:O(X)},null,8,["data"]),[[i,O(tt)]])]})),_:1}),e[10]||(e[10]=P("ul",{class:"mt-[8px] leading-8 text-[1.2rem] list-disc ml-[2rem]"},[P("li",null,"拖拽排序,项目启动顺序将按照从上到下依次进行启动")],-1))])]})),_:1},8,["modelValue"])]})),_:1}),e[11]||(e[11]=P("ul",{class:"mt-[8px] leading-8 text-[1.2rem] list-disc ml-[2rem]"},[P("li",null,"启动顺序为依次启动时,项目将按照从上到下依次进行启动")],-1))])}}}),Q=f(K,[["__scopeId","data-v-02d260ec"]]),R=Object.freeze(Object.defineProperty({__proto__:null,default:Q},Symbol.toStringTag,{value:"Module"}));t("g",R)}}}))}();
Save File
Cancel