← Back
Editing: index-legacy439.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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return r};var n,r={},o=Object.prototype,u=o.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},i=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",s=l.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(n){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,u=Object.create(o.prototype),l=new U(r||[]);return a(u,"_invoke",{value:E(e,n,l)}),u}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var m="suspendedStart",v="suspendedYield",y="executing",h="completed",g={};function b(){}function x(){}function w(){}var _={};f(_,i,(function(){return this}));var j=Object.getPrototypeOf,L=j&&j(j(F([])));L&&L!==o&&u.call(L,i)&&(_=L);var V=w.prototype=b.prototype=Object.create(_);function k(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function q(t,n){function r(o,a,l,i){var c=d(t[o],t,a);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==e(f)&&u.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,l,i)}),(function(e){r("throw",e,l,i)})):n.resolve(f).then((function(e){s.value=e,l(s)}),(function(e){return r("throw",e,l,i)}))}i(c.arg)}var o;a(this,"_invoke",{value:function(e,t){function u(){return new n((function(n,o){r(e,t,n,o)}))}return o=o?o.then(u,u):u()}})}function E(e,t,r){var o=m;return function(u,a){if(o===y)throw Error("Generator is already running");if(o===h){if("throw"===u)throw a;return{value:n,done:!0}}for(r.method=u,r.arg=a;;){var l=r.delegate;if(l){var i=O(l,r);if(i){if(i===g)continue;return i}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var c=d(e,t,r);if("normal"===c.type){if(o=r.done?h:v,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=h,r.method="throw",r.arg=c.arg)}}}function O(e,t){var r=t.method,o=e.iterator[r];if(o===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=n,O(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var u=d(o,e.iterator,t.arg);if("throw"===u.type)return t.method="throw",t.arg=u.arg,t.delegate=null,g;var a=u.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function U(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function F(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(u.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=n,e.done=!0,e};return a.next=a}}throw new TypeError(e(t)+" is not iterable")}return x.prototype=w,a(V,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:x,configurable:!0}),x.displayName=f(w,s,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,f(e,s,"GeneratorFunction")),e.prototype=Object.create(V),e},r.awrap=function(e){return{__await:e}},k(q.prototype),f(q.prototype,c,(function(){return this})),r.AsyncIterator=q,r.async=function(e,t,n,o,u){void 0===u&&(u=Promise);var a=new q(p(e,t,n,o),u);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(V),f(V,s,"Generator"),f(V,i,(function(){return this})),f(V,"toString",(function(){return"[object Generator]"})),r.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}},r.values=F,U.prototype={constructor:U,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},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 t=this;function r(r,o){return l.type="throw",l.arg=e,t.next=r,o&&(t.method="next",t.arg=n),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],l=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var i=u.call(a,"catchLoc"),c=u.call(a,"finallyLoc");if(i&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(i){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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&&u.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},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),S(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 o=r.arg;S(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:F(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),g}},r}function n(e,t,n,r,o,u,a){try{var l=e[u](a),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,o)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(o,u){var a=e.apply(t,r);function l(e){n(a,o,u,l,i,"next",e)}function i(e){n(a,o,u,l,i,"throw",e)}l(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./index.vue_vue_type_script_setup_true_lang-legacy10.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./index-legacy130.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./useController-legacy14.js?v=VERSION_NUMBER","./index-legacy398.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang-legacy.js?v=VERSION_NUMBER","./useController-legacy6.js?v=VERSION_NUMBER","./config-legacy.js?v=VERSION_NUMBER"],(function(e,n){"use strict";var o,u,a,l,i,c,s,f,p,d,m,v,y,h,g,b,x,w,_,j,L,V,k,q,E,O,C,S,U,F,G,N,P,A,T,B,I,W,z,M,H,Y,D,Q,R,X,$,J,K,Z,ee,te,ne,re,oe,ue,ae,le;return{setters:[function(e){o=e.u,u=e.fj,a=e.a7,l=e.G,i=e.k,c=e.ag,s=e.bg,f=e.n,p=e.R,d=e._,m=e.c,v=e.W,y=e.al},function(e){h=e.c,g=e.t,b=e.p,x=e.G,w=e.q,_=e.v,j=e.x,L=e.M,V=e.A,k=e.y,q=e.e,E=e.B,O=e.C,C=e.H,S=e.z,U=e.D,F=e.g,G=e.aW,N=e.a$,P=e.r,A=e.P,T=e.aA},function(e){B=e.u},function(e){I=e._},function(e){W=e._},function(e){z=e._},function(e){M=e.b,H=e.u},function(e){Y=e.aI},function(e){D=e.g,Q=e.c,R=e.d,X=e.e,$=e.f,J=e.v,K=e.j,Z=e.k,ee=e.l,te=e.n,ne=e.r,re=e.q,oe=e.s,ue=e.t,ae=e.u},function(e){le=e.B},null,null,null,null,null,null],execute:function(){var n={class:"flex items-center"},ie={class:"whitespace-normal leading-1.8rem ml-[4px]"},ce={key:0,class:"flex items-center"},se={class:"bg-[#FAFAFA] mb-[12px] flex items-center border border-[#ddd] justify-evenly p-[8px] py-[12px]"},fe={class:"flex flex-col justify-center items-center"},pe={class:"flex flex-col justify-center items-center"},de=h({__name:"index",setup:function(e){var y=o().payment;g(y.value);var h=u({request:D,columns:[{label:"类型",width:80,render:function(e){return{monitor_traffic_attack:"动态检查",monitor_traffic_total:"累计限制",monitor_http_flood:"动态检查"}[e.source]}},{label:"描述",prop:"view_msg"},M({minWidth:100,event:Z,data:["停用","正常"]}),H([{title:"删除",onClick:ee}])],extension:[a(ue)]}).BtTable,P=function(){var e,n=l({data:{cycle:5,cycle_unit:"m",traffic:1,traffic_unit:"mb",request:10,request_unit:"kc",type:"total",sender:[],total:3},options:function(e){return F((function(){return[{type:"custom",render:function(){return q(G,{title:"实时检查近一段时间内的资源消耗情况,当出现超过阀值的高资源占用时,发出告警信息",type:"warning",closable:!1,"show-icon":!0,class:"!mb-[12px]"},null)}},{type:"custom",render:function(){return q(s,{label:"周期",prop:"cycle"},{default:function(){return[q("div",{class:"flex items-center"},[q(i,{width:"7rem",type:"number",min:"1",modelValue:e.value.cycle,"onUpdate:modelValue":function(t){return e.value.cycle=t}},null),q(c,{class:"!w-[7rem] !ml-[.4rem] !mt-[2px]",modelValue:e.value.cycle_unit,"onUpdate:modelValue":function(t){return e.value.cycle_unit=t},options:[{label:"分钟",value:"m"},{label:"小时",value:"h"}]},null)])]}})}},{type:"custom",render:function(){return q(s,{label:"阈值信息",prop:"total"===e.value.type?"traffic":"request"},{default:function(){var t,n;return[q("div",{class:"flex items-center"},[q(c,{class:"!w-[10rem] !mr-[.4rem] !mt-[2px]",modelValue:e.value.type,"onUpdate:modelValue":function(t){return e.value.type=t},options:[{value:"total",label:"流量"},{value:"request",label:"请求数"}],onChange:function(t){"total"===t?(e.value.cycle_unit="m",e.value.traffic=1,e.value.traffic_unit="mb"):(e.value.cycle_unit="h",e.value.request=10,e.value.request_unit="kc")}},null),"total"===e.value.type?q("div",{class:"flex items-center"},[q(i,{width:"12rem",type:"number",min:"1",modelValue:e.value.traffic,"onUpdate:modelValue":function(t){return e.value.traffic=t}},null),q(c,{class:"!w-[8rem] !ml-[.4rem] !mt-[2px]",modelValue:e.value.traffic_unit,"onUpdate:modelValue":function(t){return e.value.traffic_unit=t},options:te},null)]):q("div",{class:"flex items-center"},[q(i,{width:"12rem",type:"number",min:"1",modelValue:e.value.request,"onUpdate:modelValue":function(t){return e.value.request=t}},null),q(c,{class:"!w-[8rem] !ml-[.4rem] !mt-[2px]",modelValue:e.value.request_unit,"onUpdate:modelValue":function(t){return e.value.request_unit=t},options:ne},null)])]),q("span",{class:"text-[1.2rem] text-[#666]"},["近".concat(e.value.cycle).concat("m"===e.value.cycle_unit?"分钟":"小时","内的").concat("total"===e.value.type?"流量":"请求数","超过").concat("total"===e.value.type?e.value.traffic:e.value.request).concat("total"===e.value.type?null===(t=te.find((function(t){return t.value===e.value.traffic_unit})))||void 0===t?void 0:t.label:null===(n=ne.find((function(t){return t.value===e.value.request_unit})))||void 0===n?void 0:n.label,"就触发告警")])]}})},rules:{traffic:[{required:!0,message:"请输入流量阈值",trigger:"blur"}],request:[{required:!0,message:"请输入请求数阈值",trigger:"blur"}]}},Y("告警方式","sender",{attrs:{class:"!w-24rem",limit:["sms"]},rules:{sender:[{required:!0,message:"请选择告警方式",trigger:"blur"}]}}),{type:"custom",render:function(){return q(s,{label:"发送次数",prop:"total"},{default:function(){return[q("div",{class:"flex items-center"},[q(i,{width:"12rem",type:"number",min:"0",modelValue:e.value.total,"onUpdate:modelValue":function(t){return e.value.total=t}},{append:"次"}),q("span",{class:"text-[1.2rem] text-[#666] ml-[12px]"},[E("后将不再发送告警信息,无需限制次数可填0次表示不限制")])])]}})},rules:{total:[{required:!0,message:"请输入发送次数",trigger:"blur"}]}}]}))},submit:(e=r(t().mark((function e(n,r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r();case 2:return e.next=4,re(n.value);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})}),o=n.BtForm,u=n.submit;n.param;f({title:"添加动态异常告警",area:60,component:function(){return q("div",{class:"p-[2rem]"},[q(o,null,null)])},showFooter:!0,onConfirm:u})},A=function(){var e,n=100,o=l({data:{cycle:0,traffic:1,traffic_unit:"mb",sender:[],total:3},options:function(e){return F((function(){return[{type:"custom",render:function(){return q(G,{title:"监控某段时间内的流量累计使用情况,当使用量超过当前规则设置的阀值,则发出告警信息",type:"warning",closable:!1,"show-icon":!0,class:"!mb-[12px]"},null)}},{type:"custom",render:function(){return q(s,{label:"时间段",prop:"cycle","label-width":n},{default:function(){return[q("div",null,[q(le,{modelValue:e.value.cycle,"onUpdate:modelValue":function(t){return e.value.cycle=t},"value-format":"X",class:"date",type:"date",placeholder:0===e.value.cycle?"每个自然月":"请选择时间",onChange:function(t){return e.value.cycle=Number(t)}},null),q(U,{type:"default",class:"!ml-[.4rem]",onClick:function(){return e.value.cycle=0}},{default:function(){return[E("设为每个自然月")]}}),0!==e.value.cycle&&q("span",{class:"block text-[1.2rem] text-[#666]"},[E("自"),p(e.value.cycle,"yyyy-MM-dd"),E("日起(包含该日)")])])]}})}},{type:"custom",render:function(){return q(s,{label:"流量使用量阈值",prop:"traffic","label-width":n},{default:function(){var t;return[q("div",{class:"flex items-center"},[q(i,{width:"12rem",type:"number",min:"1",modelValue:e.value.traffic,"onUpdate:modelValue":function(t){return e.value.traffic=t}},null),q(c,{class:"!w-[8rem] !ml-[.4rem] !mt-[2px] !mr-[12px]",modelValue:e.value.traffic_unit,"onUpdate:modelValue":function(t){return e.value.traffic_unit=t},options:te},null)]),q("span",{class:"block text-[1.2rem] text-[#666]"},["每个自然月的流量累计超过".concat(e.value.traffic).concat(null===(t=te.find((function(t){return t.value===e.value.traffic_unit})))||void 0===t?void 0:t.label,"就触发告警")])]}})},rules:{traffic:[{required:!0,message:"请输入流量阈值",trigger:"blur"}]}},Y("告警方式","sender",{attrs:{class:"!w-24rem",limit:["sms"],labelWidth:n},rules:{sender:[{required:!0,message:"请选择告警方式",trigger:"blur"}]}}),{type:"custom",render:function(){return q(s,{label:"发送次数",prop:"total","label-width":n},{default:function(){return[q("div",{class:"flex items-center"},[q(i,{width:"12rem",type:"number",min:"0",modelValue:e.value.total,"onUpdate:modelValue":function(t){return e.value.total=t}},{append:"次"}),q("span",{class:"text-[1.2rem] text-[#666] ml-[12px]"},[E("后将不再发送告警信息,无需限制次数可填0次表示不限制")])])]}})},rules:{total:[{required:!0,message:"请输入发送次数",trigger:"blur"}]}}]}))},submit:(e=r(t().mark((function e(n,r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r();case 2:return e.next=4,oe(n.value);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})}),u=o.BtForm,a=o.submit;o.param;f({title:"添加流量使用提醒",area:60,component:function(){return q("div",{class:"p-[2rem]"},[q(u,null,null)])},showFooter:!0,onConfirm:a})};return b((function(){Q()})),function(e,t){var r=d,o=m,u=z,a=N,l=W,i=v,c=x("bt-loading");return w(),_("div",null,[j(R)?(w(),L(u,{key:0,showConfig:{width:"44rem"}},{content:V((function(){return[k("div",n,[q(r,{icon:"el-warning",color:"#fc6d26",size:18}),k("div",ie,[j(X).total_status?O("",!0):(w(),_("span",ce,[t[2]||(t[2]=E(" 当前尚未安装监控报表插件 ")),q(o,{onClick:t[0]||(t[0]=function(e){return j($)("install")}),class:"!text-[1.2rem] ml-4px"},{default:V((function(){return t[1]||(t[1]=[E("点击安装")])})),_:1})]))])])]})),_:1})):O("",!0),k("div",null,[C((w(),_("div",se,[k("div",fe,[t[3]||(t[3]=k("span",null,"当前流量",-1)),k("span",null,S(j(K).traffic),1)]),q(a,{direction:"vertical"}),k("div",pe,[t[4]||(t[4]=k("span",null,"当前请求数",-1)),k("span",null,S(j(K).request),1)])])),[[c,j(J)]]),q(l,null,{"header-left":V((function(){return[q(j(U),{type:"primary",onClick:P},{default:V((function(){return t[5]||(t[5]=[E("添加动态检查告警")])})),_:1}),q(j(U),{onClick:A},{default:V((function(){return t[6]||(t[6]=[E("添加流量使用提醒")])})),_:1})]})),content:V((function(){return[q(j(h),{"max-height":400})]})),_:1}),q(i,{options:[{content:"流量限额可设置多条规则,统计周期产生的流量/请求超过限额会告警"}]})])])}}});e("default",h({__name:"index",setup:function(e){var t,n=B().siteInfo,r=P((null===(t=n.value)||void 0===t?void 0:t.tabName)||"flowLimit");return b((function(){ae()})),function(e,t){var n=T,o=y;return w(),L(o,{type:"card",modelValue:j(r),"onUpdate:modelValue":t[0]||(t[0]=function(e){return A(r)?r.value=e:null})},{default:V((function(){return[q(n,{label:"流量限制",name:"flowLimit"},{default:V((function(){return[q(I)]})),_:1}),q(n,{label:"流量限额",name:"flowQuota",lazy:!0},{default:V((function(){return[q(de)]})),_:1})]})),_:1},8,["modelValue"])}}}))}}}))}();
Save File
Cancel