← Back
Editing: index-legacy211.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(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 r(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(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 o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return r};var e,r={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=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(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 D(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}}}r.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function b(){}function w(){}function x(){}var j={};f(j,c,(function(){return this}));var O=Object.getPrototypeOf,_=O&&O(O(T([])));_&&_!==n&&a.call(_,c)&&(j=_);var k=x.prototype=b.prototype=Object.create(j);function P(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(e,r){function n(o,i,u,c){var l=h(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.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){s.value=t,u(s)}),(function(t){return n("throw",t,u,c)}))}c(l.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,r,n){var o=y;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===g){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=S(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=h(t,r,n);if("normal"===l.type){if(o=n.done?g:v,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=g,n.method="throw",n.arg=l.arg)}}}function S(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,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;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,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function I(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 D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function T(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(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},r.awrap=function(t){return{__await:t}},P(E.prototype),f(E.prototype,l,(function(){return this})),r.AsyncIterator=E,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new E(p(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},P(k),f(k,s,"Generator"),f(k,c,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),r.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}},r.values=T,D.prototype={constructor:D,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"),l=a.call(i,"finallyLoc");if(c&&l){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(!l)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,m):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),m},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),m}},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:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},r}function a(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 i(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function u(t){a(i,n,o,u,c,"next",t)}function c(t){a(i,n,o,u,c,"throw",t)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./useController-legacy5.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./useController-legacy6.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./useMethod-legacy5.js?v=VERSION_NUMBER"],(function(t,e){"use strict";var n,a,u,c,l,s,f,p,h,y,v,d,g,m,b,w,x,j,O,_,k,P,E,L,S,I,N,D,T,C,F,G;return{setters:[function(t){n=t.w,a=t.af,u=t.hX,c=t.c,l=t.l},function(t){s=t.c,f=t.r,p=t.k,h=t.aB,y=t.p,v=t.q,d=t.v,g=t.y,m=t.e,b=t.A,w=t.F,x=t.a_,j=t.x,O=t.M,_=t.P,k=t.B,P=t.C,E=t.bl,L=t.ai,S=t.aj,I=t.ah,N=t.af},function(t){D=t.createIpRules,T=t.removeIpRules,C=t.getIpFlowsAreasInfo,F=t.getIpFlowTrend},function(t){G=t.f},null,null,null,null,null,null,null],execute:function(){var e={class:"p-[2rem]"},A={class:"flex items-center justify-between mb-[8px]"},V={key:1};t("default",s({__name:"index",props:{compData:{default:function(){return{}}}},setup:function(t){var s,q=t,B=E().proxy,M=f("PHPMOD"===(null===(s=q.compData)||void 0===s||null===(s=s.project_config)||void 0===s?void 0:s.type)),H=f(),J=f("today"),Q=p([{label:"IP地址",prop:"ip",render:function(t){return h("span",{class:t.deny_status?"line-through text-[#bbb] cursor-pointer":"text-[#20a53a] cursor-pointer",on:{click:(e=i(o().mark((function e(){var r,n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,B.$confirm({title:"IP地址",message:"确定要".concat(t.deny_status?"解封":"封禁","当前ip吗?"),icon:"warning"});case 3:if(r=null,t.deny_status){e.next=11;break}return n={choose:"address",address:t.ip,domain:"",types:"drop",brief:"网站流量点击IP手动封禁"},e.next=8,D({data:JSON.stringify(n)});case 8:r=e.sent,e.next=14;break;case 11:return e.next=13,T({data:JSON.stringify({address:t.ip})});case 13:r=e.sent;case 14:B.$message.request(r),W(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0);case 21:case"end":return e.stop()}}),e,null,[[0,18]])}))),function(){return e.apply(this,arguments)})}},t.ip);var e}},{label:"归属地",render:function(t){return h("div",{class:"flex",style:{gap:"4px"}},[h("span",t.country),h("span",t.province),h("span",t.city)])}},{label:"造成流量",prop:"flow",render:function(t){return h("span",n(t.flow))}}]),R=f([{title:"今天",key:"today"},{title:"昨天",key:"yesterday"},{title:"近7天",key:"l7"},{title:"近30天",key:"l30"},{title:"近1小时",key:"h1"}]),U=f([]),Y=f("流量趋势"),$=a({options:{xAxis:{type:"category",data:[]},yAxis:{type:"value",name:"单位:字节",axisLabel:{margin:2,formatter:function(t,e){return t>=1e4&&t<1e7?t=t/1e4+"万":t>=1e7&&(t=t/1e7+"千万"),t}}},grid:{show:!1,bottom:"20%",right:"5%"},series:[{data:[],type:"line"}]}}),X=$.BtECharts,z=($.getEChart,$.setOption,$.setQuickOption),K=function(){var t=i(o().mark((function t(){var e,r,n,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=[],r=[0,0,0,0,0,0,0],n=!1,t.prev=3,t.next=6,F({site_name:q.compData.name,query_date:J.value});case 6:(a=t.sent)&&(r=[]),a.forEach((function(t){"h1"!=J.value&&"today"!=J.value&&"yesterday"!=J.value||(n=!0),e.push(rt(String(t.time),n)),r.push(t.flow)})),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(3);case 14:z(e,r);case 15:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(){return t.apply(this,arguments)}}(),W=function(){var t=i(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,C({site_name:q.compData.name,query_date:J.value});case 3:e=t.sent,U.value=e,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0);case 11:case"end":return t.stop()}}),t,null,[[0,8]])})));return function(){return t.apply(this,arguments)}}(),Z=function(t){Y.value=t,"流量趋势"===t?K():W()},tt=function(t){J.value=t,"流量趋势"===Y.value?K():W()},et=function(){G(r(r({},q.compData),{},{tabName:"flowQuota"}),"limit")},rt=function(t,e){var r="";return e?r=t.substring(8,10)+":"+(12===t.length?t.substring(10,12):"00"):(12===t.length||10===t.length?r=t.substring(0,4)+"-"+t.substring(4,6)+"-"+t.substring(6,8)+" "+t.substring(8,10)+":"+(12===t.length?t.substring(10,12):"00"):8===t.length&&(r=t.substring(0,4)+"-"+t.substring(4,6)+"-"+t.substring(6,8)),r)};return y((function(){K()})),function(t,r){var n=L,o=S,a=I,i=N,s=c,f=l;return v(),d("div",e,[g("div",A,[m(o,{modelValue:j(J),"onUpdate:modelValue":r[0]||(r[0]=function(t){return _(J)?J.value=t:null}),onChange:tt,class:"!w-[10rem]"},{default:b((function(){return[(v(!0),d(w,null,x(j(R),(function(t,e){return v(),O(n,{key:e,label:t.title,value:t.key},null,8,["label","value"])})),128))]})),_:1},8,["modelValue"]),m(i,{modelValue:j(Y),"onUpdate:modelValue":r[1]||(r[1]=function(t){return _(Y)?Y.value=t:null}),onChange:Z},{default:b((function(){return[m(a,{label:"流量趋势"}),m(a,{label:"IP TOP 10"})]})),_:1},8,["modelValue"]),j(u)||j(M)?P("",!0):(v(),O(s,{key:0,onClick:et},{default:b((function(){return r[2]||(r[2]=[k("流量限额>>")])})),_:1}))]),g("div",null,["流量趋势"===j(Y)?(v(),O(j(X),{key:0,ref_key:"totalCharts",ref:H,class:"h-[32rem]"},null,512)):P("",!0),"IP TOP 10"===j(Y)?(v(),d("div",V,[m(f,{column:j(Q),data:j(U)},null,8,["column","data"])])):P("",!0)])])}}}))}}}))}();
Save File
Cancel