← Back
Editing: index-legacy298.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 r};var n,r={},a=Object.prototype,o=a.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function f(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(n){f=function(t,e,n){return t[e]=n}}function p(t,e,n,r){var a=e&&e.prototype instanceof w?e:w,o=Object.create(a.prototype),u=new C(r||[]);return i(o,"_invoke",{value:S(t,n,u)}),o}function v(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var d="suspendedStart",h="suspendedYield",y="executing",m="completed",g={};function w(){}function _(){}function b(){}var x={};f(x,c,(function(){return this}));var L=Object.getPrototypeOf,k=L&&L(L(D([])));k&&k!==a&&o.call(k,c)&&(x=k);var j=b.prototype=w.prototype=Object.create(x);function E(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function P(e,n){function r(a,i,u,c){var l=v(e[a],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):n.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return r("throw",t,u,c)}))}c(l.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new n((function(n,a){r(t,e,n,a)}))}return a=a?a.then(o,o):o()}})}function S(t,e,r){var a=d;return function(o,i){if(a===y)throw Error("Generator is already running");if(a===m){if("throw"===o)throw i;return{value:n,done:!0}}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var c=O(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===d)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=y;var l=v(t,e,r);if("normal"===l.type){if(a=r.done?m:h,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(a=m,r.method="throw",r.arg=l.arg)}}}function O(t,e){var r=e.method,a=t.iterator[r];if(a===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=n,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=v(a,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,g;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,g):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function T(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 I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function t(){for(;++a<e.length;)if(o.call(e,a))return t.value=e[a],t.done=!1,t;return t.value=n,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return _.prototype=b,i(j,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:_,configurable:!0}),_.displayName=f(b,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,f(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},r.awrap=function(t){return{__await:t}},E(P.prototype),f(P.prototype,l,(function(){return this})),r.AsyncIterator=P,r.async=function(t,e,n,a,o){void 0===o&&(o=Promise);var i=new P(p(t,e,n,a),o);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(j),f(j,s,"Generator"),f(j,c,(function(){return this})),f(j,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},r.values=D,C.prototype={constructor:C,reset:function(t){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(I),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},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 r(r,a){return u.type="throw",u.arg=t,e.next=r,a&&(e.method="next",e.arg=n),!!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 c=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){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"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;I(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:D(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),g}},r}function n(t,e,n,r,a,o,i){try{var u=t[o](i),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,a)}function r(t){return function(){var e=this,r=arguments;return new Promise((function(a,o){var i=t.apply(e,r);function u(t){n(i,a,o,u,c,"next",t)}function c(t){n(i,a,o,u,c,"throw",t)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./useMethod-legacy8.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./firewall-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER"],(function(t,n){"use strict";var a,o,i,u,c,l,s,f,p,v,d,h,y,m,g,w,_,b,x,L,k,j,E,P,S,O,T,I,C,D,G,M,N,V,F,q,H,U,A,K,R,Y,z,B,Q;return{setters:[function(t){a=t.e,o=t.n,i=t.L,u=t.p,c=t.K,l=t.b,s=t.ai,f=t.R,p=t.l,v=t.a0},function(t){d=t._},function(t){h=t.c,y=t.X,m=t.q,g=t.v,w=t.e,_=t.A,b=t.y,x=t.F,L=t.ah,k=t.af,j=t.b6,E=t.r,P=t.p,S=t.G,O=t.H,T=t.x,I=t.P,C=t.B,D=t.a_,G=t.al,M=t.a$,N=t.D,V=t.z,F=t.K},function(t){q=t.a,H=t.s,U=t.e},function(t){A=t.a,K=t.u,R=t.c},function(t){Y=t.aN,z=t.aO,B=t.aP,Q=t.aQ},null,null],execute:function(){var X={class:"ml-8px"},$=h({__name:"date",props:{type:{},typeModifiers:{},value:{default:function(){return[]}},valueModifiers:{}},emits:["update:type","update:value"],setup:function(t){var e=y(t,"type"),n=y(t,"value");function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,e=H(t),n=U(t);return[e.getTime(),n.getTime()]}var a=function(t){switch(t){case"today":n.value=r();break;case"yesterday":n.value=r(q(new Date,-1))}},o=function(t){var e=new Date,n=q(e,-30);return H(n).getTime()>t||U(e).getTime()<t},i=function(t){e.value="custom",n.value=[H(t[0]).getTime(),U(t[1]).getTime()]};return function(t,r){var u=L,c=k,l=j;return m(),g(x,null,[w(c,{class:"network-custom-radio",modelValue:e.value,"onUpdate:modelValue":r[0]||(r[0]=function(t){return e.value=t}),onChange:a},{default:_((function(){return[w(u,{label:"今日",value:"today"}),w(u,{label:"昨日",value:"yesterday"})]})),_:1},8,["modelValue"]),b("div",X,[w(l,{modelValue:n.value,"onUpdate:modelValue":r[1]||(r[1]=function(t){return n.value=t}),type:"daterange","disabled-date":o,onChange:i},null,8,["modelValue"])])],64)}}}),J=a($,[["__scopeId","data-v-f355f5ec"]]),W={class:"sn-home"},Z={class:"sn-home-switch"},tt={class:"flex items-center"},et={class:"flex items-center"},nt={class:"sn-home-overview sn-home-overview-green"},rt={class:"mt-[2rem]"},at={class:"sn-home-overview-item-title"},ot=h({__name:"index",setup:function(t){var a=E(!1),h=E(!1),y=E([]),L=E(),k=E([{title:"今日扫描次数",value:0,style:"color: #333"},{title:"今日扫描IP数",value:0,style:"color: #333"},{title:"总扫描次数",value:0,style:"color: #333"}]),j=E({type:"today",data:X()}),q=E(),H=function(){var t=r(e().mark((function t(n){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u({title:"封禁IP",content:"是否封禁【".concat(n.scan_ip,"】24小时?")});case 2:return t.next=4,c({loading:"正在执行,请稍后...",request:Y({ip:n.scan_ip,timeout:86400}),success:function(t){l().request(t)}});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),U=[A({key:"scan_ip"}),{label:"扫描IP",prop:"scan_ip"},{label:"扫描类型",prop:"scan_type"},{label:"今日扫描次数",render:function(t){return t.scan_count_today.toLocaleString()||0}},{label:"总扫描次数",render:function(t){return t.total_scan_count.toLocaleString()||0}},{label:"被扫描的端口",render:function(t){return w("div",{innerHTML:t.scanned_ports,title:t.scanned_ports,class:"max-w-[25rem] truncate"},null)}},{label:"扫描开始时间",prop:"scan_start_time"},{label:"扫描持续时间",render:function(t){return pt(t.scan_duration)}},K([{onClick:function(t){o({title:"".concat(t.scan_ip," 扫描详情"),area:50,compData:{ip:t.scan_ip},showFooter:!1,component:function(){return i((function(){return n.import("./datails-legacy.js?v=VERSION_NUMBER")}),void 0,n.meta.url)}})},title:"详情"},{onClick:H,title:"封锁"}])];function X(){var t=function(t){var e=new Date(t);e.setHours(0,0,0,0);var n=new Date(t);return n.setHours(23,59,59,999),{start:e,end:n}}(new Date),e=t.start,n=t.end;return[e.getTime(),n.getTime()]}var $=function(){st()},ot=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,c({loading:"正在设置扫描感知开关,请稍后...",request:z({switch_type:"scan_sensing",status:h.value}),success:function(t){s(t.data.data)&&!t.status?l().error(t.msg+"【"+t.data.data+"】"):l().request(t)}});case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0);case 8:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(){return t.apply(this,arguments)}}(),it=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u({title:"导出IP列表",content:"确定要导出当前扫描IP列表吗?"});case 2:return t.next=4,c({loading:"正在执行,请稍后...",request:B(),success:function(t){t.data.status?window.open("/download?filename="+t.data.url,"_blank","noopener,noreferrer"):l().error(t.data.msg)}});case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ut=function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o({title:"高级配置",area:45,compData:{config:q.value},showFooter:!1,component:function(){return i((function(){return n.import("./advanced-legacy.js?v=VERSION_NUMBER")}),void 0,n.meta.url)}});case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ct=function(){var t=r(e().mark((function t(n,a,o,i){var u,c,l;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=function(){var t=r(e().mark((function t(n,r){var a,o,i;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=n.scan_ip,o=new Map([["lock",Y]]),i=o.get(l),t.t0=l,t.next="lock"===t.t0?6:11;break;case 6:if(!i){t.next=10;break}return t.next=9,i({ip:a,timeout:86400});case 9:return t.abrupt("return",t.sent);case 10:return t.abrupt("break",11);case 11:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),c=i.label,l=i.value,t.next=4,n({title:"批量".concat(c),content:"即将批量".concat(c,"选中的IP,是否继续操作?"),column:[{label:"批量封锁",prop:"scan_ip"},R()],onConfirm:function(){var t=r(e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a(u);case 2:return st(),t.abrupt("return",!1);case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 4:case"end":return t.stop()}}),t)})));return function(e,n,r,a){return t.apply(this,arguments)}}(),lt=[{label:"封锁",value:"lock",event:ct}],st=function(){var t=r(e().mark((function t(){var n,r,a;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Q(ft());case 2:n=t.sent,r=n.data,a=r.overview,k.value[0].value=a.scan_count_today.toLocaleString(),k.value[1].value=a.ip_count_today.toLocaleString(),k.value[2].value=a.total_scan_count.toLocaleString(),h.value=a.scan_status,q.value=a,y.value=r.scan_info;case 11:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ft=function(){return{start_timestamp:f(j.value.data[0],"yyyy-MM-dd"),end_timestamp:f(j.value.data[1],"yyyy-MM-dd")}},pt=function(t){var e=t.split(":"),n=parseInt(e[0]),r=parseInt(e[1]),a=parseInt(e[2]);return n>999?"999+":"00:00:00"===t?"-":"".concat(60*n+r,"分").concat(a,"秒")},vt=function(){j.value.data=X(),y.value=[],st()};return P((function(){return vt()})),function(t,e){var n=G,r=M,o=N,i=p,u=v,c=d,l=S("bt-loading");return O((m(),g("div",W,[b("div",Z,[b("div",tt,[e[3]||(e[3]=b("div",{class:"mr-4"},"扫描感知",-1)),w(n,{modelValue:T(h),"onUpdate:modelValue":e[0]||(e[0]=function(t){return I(h)?h.value=t:null}),width:36,onChange:ot},null,8,["modelValue"])]),b("div",null,[b("div",et,[w(J,{type:T(j).type,"onUpdate:type":e[1]||(e[1]=function(t){return T(j).type=t}),value:T(j).data,"onUpdate:value":[e[2]||(e[2]=function(t){return T(j).data=t}),$]},null,8,["type","value"]),w(r,{direction:"vertical"}),w(o,{onClick:vt},{default:_((function(){return e[4]||(e[4]=[C("刷新")])})),_:1}),w(o,{onClick:it},{default:_((function(){return e[5]||(e[5]=[C("导出")])})),_:1}),w(o,{onClick:ut},{default:_((function(){return e[6]||(e[6]=[C("高级配置")])})),_:1})])])]),b("div",nt,[e[7]||(e[7]=b("div",{class:"text-[#666] text-[1.4rem]"},"扫描概览",-1)),b("div",rt,[(m(!0),g(x,null,D(T(k),(function(t,e){return m(),g("div",{class:"sn-home-overview-item",key:e},[b("div",at,V(t.title),1),b("div",{class:"sn-home-overview-item-num",style:F(t.style)},V(t.value),5)])})),128))])]),w(c,null,{content:_((function(){return[w(i,{ref_key:"scanListRef",ref:L,column:U,data:T(y),"max-height":"400"},null,8,["data"])]})),"footer-left":_((function(){return[w(u,{"table-ref":T(L),options:lt},null,8,["table-ref"])]})),_:1})])),[[l,T(a)]])}}});t("default",a(ot,[["__scopeId","data-v-6fda3751"]]))}}}))}();
Save File
Cancel