← Back
Editing: alarm-config-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:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",s=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(r){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof x?e:x,a=Object.create(o.prototype),u=new G(n||[]);return i(a,"_invoke",{value:V(t,r,u)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var h="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function x(){}function b(){}function w(){}var _={};f(_,l,(function(){return this}));var L=Object.getPrototypeOf,j=L&&L(L(U([])));j&&j!==o&&a.call(j,l)&&(_=j);var k=w.prototype=x.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,r){function n(o,i,u,l){var c=d(e[o],e,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==t(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,l)}),(function(t){n("throw",t,u,l)})):r.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return n("throw",t,u,l)}))}l(c.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 V(t,e,n){var o=h;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var l=S(u,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=d(t,e,n);if("normal"===c.type){if(o=n.done?g:y,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function S(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,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=d(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,v;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,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function P(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 F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function U(e){if(e||""===e){var n=e[l];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 b.prototype=w,i(k,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=f(w,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,f(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},n.awrap=function(t){return{__await:t}},E(O.prototype),f(O.prototype,c,(function(){return this})),n.AsyncIterator=O,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new O(p(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(k),f(k,s,"Generator"),f(k,l,(function(){return this})),f(k,"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=U,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(F),!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 l=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)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,v):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),v},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),F(r),v}},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;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:U(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),v}},n}function r(t,e,r,n,o,a,i){try{var u=t[a](i),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).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,l,"next",t)}function l(t){r(i,o,a,u,l,"throw",t)}u(void 0)}))}}System.register(["./base-lib-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy48.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index-legacy110.js?v=VERSION_NUMBER","./index-legacy105.js?v=VERSION_NUMBER","./store-legacy3.js?v=VERSION_NUMBER","./store-legacy4.js?v=VERSION_NUMBER","./store-legacy5.js?v=VERSION_NUMBER","./hooks-legacy.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var o,a,i,u,l,c,s,f,p,d,h,y,m,g,v,x,b,w,_,L,j,k,E,O,V,S;return{setters:[function(t){o=t.c,a=t.s,i=t.g,u=t.w,l=t.p,c=t.q,s=t.v,f=t.e,p=t.A,d=t.x,h=t.P,y=t.M,m=t.B,g=t.C,v=t.y,x=t.z,b=t.S,w=t.a9,_=t.ag,L=t.af,j=t.a7},function(t){k=t._},function(t){E=t.k,O=t.ag,V=t.e},function(t){S=t.b},null,null,null,null,null,null,null,null,null],execute:function(){var r={class:"px-[2rem] py-[4rem] give-dialog"},P={class:"flex items-center"},F={key:0,class:"text-[#999]"},G={key:1,class:"text-[#999]"},U={key:0,class:"text-[#999] ml-1.6rem text-[1.2rem]"},N={key:1,class:"text-[#999] ml-1.6rem text-[1.2rem]"},D={key:2,class:"text-[#999] ml-1.6rem text-[1.2rem]"},R={class:"flex items-center"};t("default",V(o({__name:"alarm-config",setup:function(t){var o=S(),V=a(o),T=V.giveFormDisabled,C=V.giveFormRef,I=V.msgForm,q=V.maxCapacityAndUsageRate,A=(V.options,V.nextOptions),B=V.rowData,Y=B.value,$=Y.type,z=Y.data,H=(Y.id,{num:[{required:!0,message:"请输入发送次数",trigger:"blur"},{pattern:/^[0-9]\d*$/,message:"请输入正整数",trigger:"blur"}],usageRate:[{required:!0,message:"请输入告警阈值",trigger:"blur"},{pattern:/^[0-9]\d*$/,message:"请输入正整数",trigger:"blur"}],give:[{required:!0,message:"请至少选择一个告警方式",trigger:"change"}]}),M=i((function(){switch($){case"load":return"【负载状态】告警";case"cpu":return"【CPU使用率】告警";case"mem":return"【内存使用率】告警"}if(-1!==$.indexOf("disk"))return"磁盘【".concat($.split("-")[1],"】告警")})),J=i((function(){switch($){case"load":return"负载状态";case"cpu":case"mem":return"使用率"}if(-1!==$.indexOf("disk"))return 2===z.cycle||"2"===I.value.typeDetection?"占用率":"剩余容量"})),K=i((function(){return"2"===I.value.typeDetection?"%":"GB"}));return u((function(){return B.value}),(function(){o.alarmInfo()})),l(n(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o.alarmInfo();case 1:case"end":return t.stop()}}),t)})))),function(t,e){var n=b,a=w,i=_,u=L,l=E,V=O,S=k,B=j;return c(),s("div",r,[f(B,{model:d(I),rules:H,ref_key:"giveFormRef",ref:C,disabled:d(T)},{default:p((function(){return[f(a,{label:"任务类型"},{default:p((function(){return[f(n,{class:"!w-[30rem]",modelValue:d(M),"onUpdate:modelValue":e[0]||(e[0]=function(t){return h(M)?M.value=t:null}),readonly:!0,disabled:""},null,8,["modelValue"])]})),_:1}),-1!==d($).indexOf("disk")?(c(),y(a,{key:0,label:"检测类型"},{default:p((function(){return[f(u,{modelValue:d(I).typeDetection,"onUpdate:modelValue":e[1]||(e[1]=function(t){return d(I).typeDetection=t}),onChange:d(o).switchTypeDetection},{default:p((function(){return[f(i,{label:"2"},{default:p((function(){return e[6]||(e[6]=[m("占用百分比")])})),_:1}),f(i,{label:"1"},{default:p((function(){return e[7]||(e[7]=[m("剩余容量")])})),_:1})]})),_:1},8,["modelValue","onChange"])]})),_:1})):g("",!0),f(a,{label:d(J),prop:"usageRate"},{default:p((function(){return[v("div",P,[f(l,{class:"!w-[12rem]",modelValue:d(I).usageRate,"onUpdate:modelValue":e[2]||(e[2]=function(t){return d(I).usageRate=t}),min:0,max:d(q),type:"number"},{append:p((function(){return[-1!==d($).indexOf("disk")?(c(),s("span",F,x(d(K)),1)):(c(),s("span",G,"%"))]})),_:1},8,["modelValue","max"]),d($).indexOf("cpu")>-1?(c(),s("span",U," 每5分钟平均CPU超过该数值就告警 ")):-1===d($).indexOf("disk")?(c(),s("span",N," 每5分钟平均负载超过该数值就告警 ")):(c(),s("span",D," 每隔10分钟磁盘占用超过该数值就告警 "))])]})),_:1},8,["label"]),f(a,{label:"发送次数",prop:"num"},{default:p((function(){return[v("div",R,[f(l,{class:"!w-[12rem]",modelValue:d(I).num,"onUpdate:modelValue":e[3]||(e[3]=function(t){return d(I).num=t}),min:0,type:"number"},{append:p((function(){return e[8]||(e[8]=[v("span",{class:"text-[#999]"},"次",-1)])})),_:1},8,["modelValue"]),e[9]||(e[9]=v("span",{class:"text-[#999] ml-1.6rem text-[1.2rem]"}," 后将不再发送告警信息,如需发送多次请填写2次以上 ",-1))])]})),_:1}),-1===d($).indexOf("disk")?(c(),y(a,{key:1,label:"告警后执行",prop:"next_data"},{default:p((function(){return[f(V,{modelValue:d(I).next_data,"onUpdate:modelValue":e[4]||(e[4]=function(t){return d(I).next_data=t}),options:d(A),class:"!w-[30rem]",multiple:""},null,8,["modelValue","options"])]})),_:1})):g("",!0),f(a,{label:"告警方式",prop:"give"},{default:p((function(){return[f(S,{class:"!w-[30rem]",modelValue:d(I).give,"onUpdate:modelValue":e[5]||(e[5]=function(t){return d(I).give=t})},null,8,["modelValue"])]})),_:1})]})),_:1},8,["model","disabled"]),e[10]||(e[10]=v("div",{class:"tip"},[v("ul",null,[v("li",null,"【发送次数】设置0时,每天触发告警次数没有上限")])],-1))])}}}),[["__scopeId","data-v-b8ff39e3"]]))}}}))}();
Save File
Cancel