← Back
Editing: index-legacy286.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,i=o.hasOwnProperty,a=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(r){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),u=new G(n||[]);return a(i,"_invoke",{value:C(t,r,u)}),i}function v(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var p="suspendedStart",d="suspendedYield",y="executing",m="completed",g={};function w(){}function x(){}function b(){}var k={};f(k,c,(function(){return this}));var _=Object.getPrototypeOf,L=_&&_(_(N([])));L&&L!==o&&i.call(L,c)&&(k=L);var E=b.prototype=w.prototype=Object.create(k);function j(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function P(e,r){function n(o,a,u,c){var l=v(e[o],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&i.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;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function C(t,e,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=O(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===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=v(t,e,n);if("normal"===l.type){if(o=n.done?m:d,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function O(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,O(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=v(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(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 F(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 N(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,a=function t(){for(;++o<e.length;)if(i.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}throw new TypeError(t(e)+" is not iterable")}return x.prototype=b,a(E,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:x,configurable:!0}),x.displayName=f(b,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,f(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},n.awrap=function(t){return{__await:t}},j(P.prototype),f(P.prototype,l,(function(){return this})),n.AsyncIterator=P,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new P(h(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(E),f(E,s,"Generator"),f(E,c,(function(){return this})),f(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=N,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)&&i.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 a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.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&&i.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 a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},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),F(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;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(t,e,r,n,o,i,a){try{var u=t[i](a),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,i){var a=t.apply(e,n);function u(t){r(a,o,i,u,c,"next",t)}function c(t){r(a,o,i,u,c,"throw",t)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./useStore-legacy5.js?v=VERSION_NUMBER","./firewall-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var o,i,a,u,c,l,s,f,h,v,p,d,y,m,g,w,x,b,k,_,L,E,j,P,C,O,S,F,G,N,T,q,B,D,H,A,I,V,K;return{setters:[function(t){o=t.n,i=t.L,a=t.M,u=t.K,c=t.c,l=t.R,s=t.gB,f=t.e},function(t){h=t.c,v=t.r,p=t.p,d=t.G,y=t.H,m=t.x,g=t.q,w=t.v,x=t.y,b=t.e,k=t.P,_=t.B,L=t.C,E=t.M,j=t.A,P=t.F,C=t.a_,O=t.J,S=t.al,F=t.D,G=t.av,N=t.z,T=t.K,q=t.ax},function(t){B=t._},function(t){D=t.g},function(t){H=t.aj,A=t.ak,I=t.al,V=t.am,K=t.an},null],execute:function(){var M={class:"sn-home"},R={class:"sn-home-switch"},U={class:"flex items-center"},Y={key:0,class:"sn-home-note flex items-center"},z={key:1},J={class:"mt-[2rem]"},Q={class:"sn-home-overview-item-title"},W={key:0,class:"sn-home-list"},X={class:"sn-home-list-item flex items-center"},Z={class:"ml-[0.4rem] truncate flex-1"},$={class:"text-right"},tt={class:"text-[#999] leading-2.2rem"},et={class:"mt-1rem"},rt={class:"flex justify-end items-center"},nt={key:1,class:"sn-home-list"},ot=h({__name:"index",setup:function(t){var f=D().refs.phpTabActive,h=v(!1),ot=v(!1),it=v(!1),at=v(!1),ut=v([]),ct=v(!1),lt=[{title:"高风险",value:0,style:"color: #F50606;",name:"risk_high"},{title:"中危",value:0,style:"color: #FF9900",name:"risk_mod"},{title:"低危",value:0,style:"color: #DDC400",name:"risk_low"},{title:"网站数量",value:0,style:"color: #333",name:"site_count"},{title:"告警次数",value:0,style:"color: #333",name:"risk_count"}],st=function(){var t=n(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u({loading:"正在加入URL白名单...",request:V({url_rule:r}),message:!0});case 2:return t.next=4,vt();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ft=function(){var t=n(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u({loading:"正在处理,请稍候...",request:K({operation:1,id:r}),message:!0});case 2:return t.next=4,vt();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ht=function(){var t=n(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u({request:A(),data:{status:[Boolean,h],send:[Boolean,it],php_status:[Boolean,at]}});case 2:it.value&&at.value?ct.value=!1:ct.value=!0;case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),vt=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.next=2,u({loading:ot,request:I()});case 2:r=t.sent,n=r.data,ut.value=n.logs,lt.forEach((function(t){t.value=n[t.name]}));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),pt=function(){o({title:"模拟攻击",area:60,compData:function(){return mt()},component:function(){return i((function(){return r.import("./simulate-attack-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)}})},dt=function(){var t=n(e().mark((function t(r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(h.value=!r,it.value&&at.value){t.next=5;break}return h.value=!1,a.error("请先开启PHP模块设置"),t.abrupt("return");case 5:return t.next=7,u({loading:"正在"+(r?"开启":"关闭")+"监控,请稍后...",request:H({status:r?"start":"stop"}),message:!0,data:{status:[Boolean,function(t){t&&(h.value=r)}]}});case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),yt=function(){return f.value="php"},mt=function(){ht(),vt()};return p((function(){return mt()})),function(t,e){var r=S,n=c,o=F,i=B,a=q,u=G,f=d("bt-loading");return y((g(),w("div",M,[x("div",R,[x("div",U,[e[1]||(e[1]=x("div",{class:"mr-4"},"监控开关",-1)),b(r,{modelValue:m(h),"onUpdate:modelValue":e[0]||(e[0]=function(t){return k(h)?h.value=t:null}),width:36,onChange:dt,disabled:m(ct)},null,8,["modelValue","disabled"])]),m(ct)?(g(),w("div",Y,[e[3]||(e[3]=x("i",{class:"svgtofont-el-warning-filled text-[#E6A23C] text-[1.6rem]"},null,-1)),e[4]||(e[4]=_(" 无法使用PHP安全告警,请开启 ")),m(at)?L("",!0):(g(),w("span",{key:0,class:"bt-link !text-danger underline",onClick:yt,title:"点击跳转PHP模块页面"}," PHP模块 ")),m(at)||m(it)?L("",!0):(g(),w("span",z,"、")),m(it)?L("",!0):(g(),E(n,{key:2,title:"点击跳转告警设置页面",type:"danger",class:"underline"},{default:j((function(){return e[2]||(e[2]=[_(" 设置告警 ")])})),_:1}))])):L("",!0),m(it)&&m(at)?(g(),E(o,{key:1,type:"primary",onClick:pt},{default:j((function(){return e[5]||(e[5]=[_("模拟攻击")])})),_:1})):L("",!0)]),x("div",{class:O(["sn-home-overview",lt[0].value?"sn-home-overview-red":lt[1].value?"sn-home-overview-yellow":"sn-home-overview-green"])},[e[6]||(e[6]=x("div",{class:"text-[#666] text-[1.4rem]"},"风险等级概览",-1)),x("div",J,[(g(),w(P,null,C(lt,(function(t,e){return x("div",{class:O(["sn-home-overview-item",e<3?"line-border":""]),key:e},[x("div",Q,N(t.title),1),x("div",{class:"sn-home-overview-item-num",style:T(t.style)},N(t.value),5)],2)})),64))])],2),m(ut).length?(g(),w("div",W,[(g(!0),w(P,null,C(m(ut),(function(t,r){return g(),E(a,{key:r,placement:"bottom",width:260,trigger:"hover",offset:0,"show-after":300},{reference:j((function(){return[x("div",X,[x("div",null,[x("div",{class:O(["sn-home-list-item-type max-w-[12rem] w-max flex items-center",1===t.risk?"green":2===t.risk?"org":"red"])},[e[7]||(e[7]=x("i",{class:"svgtofont-el-warning !text-[1.6rem] w-[16px]"},null,-1)),x("span",Z,N(t.intercept),1)],2)]),x("span",null,"攻击者IP:"+N(t.address),1),x("span",null,"网站:"+N(t.domain),1),x("span",null,"路径:"+N(t.url),1),x("div",$,"触发时间:"+N(m(l)(t.addtime)),1)])]})),default:j((function(){return[x("div",tt,[x("div",null,"【"+N(t.domain)+"】",1),x("div",et,[e[8]||(e[8]=_(" 路径: ")),x("span",{class:O((o=t.risk,3===o?"text-[#F50606]":2===o?"text-[#FF9900]":"text-[#DDC400]"))},N(t.intercept),3)]),x("div",null,"路径:"+N(m(s)(t.url)),1),x("div",null,[e[9]||(e[9]=_(" 解决方案: ")),(g(!0),w(P,null,C((r=t.solution,(null==r?void 0:r.split("|split|"))||[]),(function(t,e){return g(),w("p",{key:e},N(t),1)})),128))]),x("div",rt,[b(n,{onClick:function(e){return st(t.url)}},{default:j((function(){return e[10]||(e[10]=[_("误报")])})),_:2},1032,["onClick"]),b(i),b(n,{onClick:function(e){return ft(t.id)}},{default:j((function(){return e[11]||(e[11]=[_("已处理")])})),_:2},1032,["onClick"])])])];var r,o})),_:2},1024)})),128))])):(g(),w("div",nt,[b(u,{description:"暂无数据"})])),e[12]||(e[12]=x("div",{class:"text-[#C1C1C1] mt-[1rem]"},"以上仅提供最新的前100条风险数据",-1))])),[[f,m(ot)]])}}});t("default",f(ot,[["__scopeId","data-v-8022050a"]]))}}}))}();
Save File
Cancel