← Back
Editing: index-legacy173.js
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,u=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e,t)||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(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}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 t,n={},a=Object.prototype,o=a.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var a=t&&t.prototype instanceof w?t:w,o=Object.create(a.prototype),u=new N(r||[]);return i(o,"_invoke",{value:O(e,n,u)}),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=p;var v="suspendedStart",d="suspendedYield",y="executing",m="completed",g={};function w(){}function x(){}function b(){}var _={};f(_,l,(function(){return this}));var k=Object.getPrototypeOf,j=k&&k(k(P([])));j&&j!==a&&o.call(j,l)&&(_=j);var L=b.prototype=w.prototype=Object.create(_);function E(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function S(t,n){function r(a,i,u,l){var c=h(t[a],t,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==e(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,u,l)}),(function(e){r("throw",e,u,l)})):n.resolve(f).then((function(e){s.value=e,u(s)}),(function(e){return r("throw",e,u,l)}))}l(c.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,a){r(e,t,n,a)}))}return a=a?a.then(o,o):o()}})}function O(e,n,r){var a=v;return function(o,i){if(a===y)throw Error("Generator is already running");if(a===m){if("throw"===o)throw i;return{value:t,done:!0}}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var l=V(u,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===v)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=y;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:d,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function V(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,V(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(a,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function P(n){if(n||""===n){var r=n[l];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var a=-1,i=function e(){for(;++a<n.length;)if(o.call(n,a))return e.value=n[a],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(e(n)+" is not iterable")}return x.prototype=b,i(L,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:x,configurable:!0}),x.displayName=f(b,s,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,f(e,s,"GeneratorFunction")),e.prototype=Object.create(L),e},n.awrap=function(e){return{__await:e}},E(S.prototype),f(S.prototype,c,(function(){return this})),n.AsyncIterator=S,n.async=function(e,t,r,a,o){void 0===o&&(o=Promise);var i=new S(p(e,t,r,a),o);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},E(L),f(L,s,"Generator"),f(L,l,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=P,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return u.type="throw",u.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;A(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:P(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}function a(e,t,n,r,a,o,i){try{var u=e[o](i),l=u.value}catch(e){return void n(e)}u.done?t(l):Promise.resolve(l).then(r,a)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function u(e){a(i,r,o,u,l,"next",e)}function l(e){a(i,r,o,u,l,"throw",e)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy116.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy140.js?v=VERSION_NUMBER","./index.vue_vue_type_script_setup_true_lang-legacy7.js?v=VERSION_NUMBER","./index.vue_vue_type_script_setup_true_lang-legacy8.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./ace-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER"],(function(e,n){"use strict";var a,i,u,l,c,s,f,p,h,v,d,y,m,g,w,x,b,_,k,j,L,E,S,O,V,C,A,N,P,T,U,q,G,I,W,F,H,D,M,z,R,B,Y,$,K,X,Z,J,Q;return{setters:[function(e){a=e.K,i=e.bT,u=e.M,l=e.aX,c=e.w,s=e.aL,f=e.k,p=e.al,h=e.e},function(e){v=e._},function(e){d=e.r,y=e.c,m=e.s,g=e.p,w=e.G,x=e.q,b=e.v,_=e.e,k=e.A,j=e.y,L=e.H,E=e.x,S=e.P,O=e.B,V=e.F,C=e.a_,A=e.M,N=e.z,P=e.C,T=e.aA,U=e.D,q=e.ai,G=e.aj,I=e.au,W=e.aw,F=e.a9,H=e.a7},function(e){D=e.B},function(e){M=e.S,z=e._},function(e){R=e.S,B=e._},function(e){Y=e.Z,$=e.W,K=e.U,X=e.m,Z=e.$,J=e.a0,Q=e.V},null,null,null,null],execute:function(){var n=R(),ee=M(),te=d({}),ne={active:"活动连接(Active connections)",accepts:"总连接次数(accepts)",handled:"总握手次数(handled)",requests:"总请求数(requests)",Reading:"请求数(Reading)",Writing:"响应数(Writing)",Waiting:"驻留进程(Waiting)",worker:"工作进程(Worker)",workercpu:"Nginx占用CPU(Workercpu)",workermen:"Nginx占用内存(Workermen)"},re=d([]),ae=d("service"),oe=d(""),ie=d(!1),ue=d(!1),le=d([]),ce=d(""),se=d(""),fe=d(""),pe=d([]),he=function(){var e=o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({loading:ue,request:Z(),data:[Array,re]});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=o(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},re.value.forEach((function(e){t[e.name]=e.value})),e.next=4,a({loading:"正在保存中,请稍后...",request:Y(t),message:!0});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),de=function(){var e=o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({loading:ie,request:J(),success:function(e){if(l("status",e)&&!e.status)u.msg({message:e.msg||"获取数据失败",type:"error",dangerouslyUseHTMLString:!0,customClass:"bt-message-error-html ",showClose:!0});else{le.value=[];var n=["bytes","bytes_read","bytes_written"];Object.keys(e.data).forEach((function(t){le.value.push({name:t,ps:ne[t],value:n.includes(t)?c(Number(e.data[t])):e.data[t]})}));var r=le.value.findIndex((function(e){return"active"===e.name}));if(r>-1){var a=t(le.value.splice(r,1),1)[0];le.value.unshift(a)}}}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ye=function(){var e=o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({loading:ie,request:Q({path:"/www/server/nginx/conf/nginx.conf"}),data:{data:[String,oe]}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){var e=o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({loading:"正在保存中,请稍后...",request:i({path:"/www/server/nginx/conf/nginx.conf",data:oe.value,encoding:"utf-8"}),message:!0});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ge=function(){var e=o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({loading:ie,request:$({path:"/www/wwwlogs/nginx_error.log"}),data:{msg:[String,ce]}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),we=function(){var e=o(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(se.value!==fe.value){e.next=3;break}return u.error("当前版本与选择版本一致"),e.abrupt("return");case 3:return e.prev=3,e.next=6,K({sName:"nginx",version:se.value,min_version:""});case 6:X(),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3);case 12:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(){return e.apply(this,arguments)}}(),xe=function(e){switch(e.props.name){case"service":be();break;case"performance":he();break;case"config":ye();break;case"load":de();break;case"logs":ge()}},be=function(e){ae.value="service",e&&(te.value=e),ee.init(te.value),n.init({name:"nginx"}),se.value=te.value.version.split(".")[0]+"."+te.value.version.split(".")[1],fe.value=te.value.version.split(".")[0]+"."+te.value.version.split(".")[1],pe.value=te.value.versions},_e={class:"my-[12px]"},ke={class:"flex text-[#666] items-center"},je={class:"flex flex-col text-[#666] performance"},Le={key:0,class:"flex items-center"},Ee={key:1,class:"flex items-center"},Se=y({__name:"index",props:{compData:{default:{}}},setup:function(e){var t=e,n=m(M()).compData;return g((function(){be(t.compData),n.value.refreshEvent=o(r().mark((function e(){var t,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({name:"web"});case 2:t=e.sent,a=t.data,n.value.status=a.s_status;case 5:case"end":return e.stop()}}),e)})))})),function(e,t){var n=T,r=D,a=U,o=q,i=G,u=I,l=W,c=f,s=F,h=H,d=v,y=p,m=w("bt-loading");return x(),b("div",null,[_(y,{modelValue:E(ae),"onUpdate:modelValue":t[2]||(t[2]=function(e){return S(ae)?ae.value=e:null}),type:"left-bg-card",class:"h-full",onTabClick:E(xe)},{default:k((function(){return[_(n,{label:"服务",name:"service"},{default:k((function(){return[_(z),_(B)]})),_:1}),_(n,{label:"配置文件",name:"config"},{default:k((function(){return[t[4]||(t[4]=j("span",{class:"my-[4px] text-[#666]"},"提示:Ctrl+F 搜索关键字,Ctrl+S 保存,Ctrl+H 查找替换",-1)),j("div",_e,[L(_(r,{class:"!h-[38rem] !w-[52rem]",modelValue:E(oe),"onUpdate:modelValue":t[0]||(t[0]=function(e){return S(oe)?oe.value=e:null}),id:"configContent",filePath:"/www/server/nginx/conf/nginx.conf"},null,8,["modelValue"]),[[m,E(ie)]])]),_(a,{type:"primary",onClick:E(me)},{default:k((function(){return t[3]||(t[3]=[O("保存")])})),_:1},8,["onClick"]),t[5]||(t[5]=j("ul",{class:"leading-8 mt-20px text-[1.2rem] list-disc ml-[20px]"},[j("li",null,"此处为nginx主配置文件,若您不了解配置规则,请勿随意修改")],-1))]})),_:1}),_(n,{label:"版本切换",name:"version"},{default:k((function(){return[j("div",ke,[t[7]||(t[7]=j("span",null,"选择版本",-1)),_(i,{class:"mx-[12px] !w-[18rem]",modelValue:E(se),"onUpdate:modelValue":t[1]||(t[1]=function(e){return S(se)?se.value=e:null})},{default:k((function(){return[(x(!0),b(V,null,C(E(pe),(function(e,t){return x(),A(o,{key:t,label:"nginx "+e.m_version,value:e.m_version},null,8,["label","value"])})),128))]})),_:1},8,["modelValue"]),_(a,{type:"primary",onClick:E(we)},{default:k((function(){return t[6]||(t[6]=[O("切换")])})),_:1},8,["onClick"])])]})),_:1}),_(n,{label:"负载状态",name:"load"},{default:k((function(){return[L((x(),A(l,{maxHeight:"500",data:E(le),border:"",style:{width:"100%"}},{default:k((function(){return[_(u,{prop:"ps",label:"字段"}),_(u,{prop:"value",label:"当前值"})]})),_:1},8,["data"])),[[m,E(ie)]])]})),_:1}),L((x(),A(n,{label:"性能调整",name:"performance"},{default:k((function(){return[j("div",je,[_(h,{"label-position":"right","label-width":"186px"},{default:k((function(){return[(x(!0),b(V,null,C(E(re),(function(e,t){return x(),A(s,{label:e.name,key:t},{default:k((function(){return["gzip"!=e.name?(x(),b("div",Le,[_(c,{modelValue:e.value,"onUpdate:modelValue":function(t){return e.value=t},type:"worker_processes"!==e.name?"number":""},null,8,["modelValue","onUpdate:modelValue","type"]),j("span",null,N(e.ps),1)])):P("",!0),"gzip"==e.name?(x(),b("div",Ee,[_(i,{modelValue:e.value,"onUpdate:modelValue":function(t){return e.value=t},class:"!w-[8rem] mx-8px"},{default:k((function(){return[_(o,{label:"开启",value:"on"}),_(o,{label:"关闭",value:"off"})]})),_:2},1032,["modelValue","onUpdate:modelValue"]),j("span",null,N(e.ps),1)])):P("",!0)]})),_:2},1032,["label"])})),128)),_(s,{label:" "},{default:k((function(){return[_(a,{onClick:E(ve),type:"primary"},{default:k((function(){return t[8]||(t[8]=[O("保存")])})),_:1},8,["onClick"])]})),_:1})]})),_:1})])]})),_:1})),[[m,E(ue)]]),_(n,{label:"错误日志",name:"logs"},{default:k((function(){return[_(d,{content:E(ce),autoScroll:!0,isHtml:!0,"full-screen":{title:"全屏查看日志",onRefresh:E(ge)},style:"height:540px"},null,8,["content","full-screen"])]})),_:1})]})),_:1},8,["modelValue","onTabClick"])])}}});e("default",h(Se,[["__scopeId","data-v-e14a026d"]]))}}}))}();
Save File
Cancel