← Back
Editing: index-legacy270.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){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function n(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 o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function i(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 a(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return r};var e,r={},n=Object.prototype,o=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 N(n||[]);return i(a,"_invoke",{value:E(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}}}r.wrap=p;var h="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function b(){}function w(){}function x(){}var _={};f(_,c,(function(){return this}));var j=Object.getPrototypeOf,P=j&&j(j(T([])));P&&P!==n&&o.call(P,c)&&(_=P);var O=x.prototype=b.prototype=Object.create(_);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function L(e,r){function n(i,a,u,c){var l=d(e[i],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&o.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 a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return a=a?a.then(o,o):o()}})}function E(t,r,n){var o=h;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=S(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===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(t,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,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")),g;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function A(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 N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,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 i=-1,a=function t(){for(;++i<r.length;)if(o.call(r,i))return t.value=r[i],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return w.prototype=x,i(O,"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(O),t},r.awrap=function(t){return{__await:t}},k(L.prototype),f(L.prototype,l,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new L(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(O),f(O,s,"Generator"),f(O,c,(function(){return this})),f(O,"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,N.prototype={constructor:N,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(I),!t)for(var r in this)"t"===r.charAt(0)&&o.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 i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.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&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.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),I(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;I(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),g}},r}function u(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 c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy112.js?v=VERSION_NUMBER","./firewall-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./useMethod-legacy6.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./index.vue_vue_type_script_setup_true_lang-legacy11.js?v=VERSION_NUMBER","./useStore-legacy5.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER"],(function(t,r){"use strict";var n,i,u,l,s,f,p,d,h,y,v,m,g,b,w,x,_,j,P,O,k,L,E,S,A,I,N,T,F,G,V,q,C,D,H,U,M,J,R,Y,$,z,B,K,Q,W,X,Z,tt,et,rt,nt,ot;return{setters:[function(t){n=t.u,i=t.n,u=t.L,l=t.K,s=t.S,f=t.J,p=t.l,d=t.a0,h=t.j,y=t.b,v=t.p,m=t.e},function(t){g=t._},function(t){b=t.c,w=t.r,x=t.k,_=t.e,j=t.B,P=t.p,O=t.n,k=t.G,L=t.q,E=t.M,S=t.A,A=t.y,I=t.x,N=t.P,T=t.H,F=t.v,G=t.a_,V=t.F,q=t.D,C=t.bM,D=t.z,H=t.bN},function(t){U=t._},function(t){M=t.q,J=t.t,R=t.u,Y=t.v,$=t.w},function(t){z=t.a,B=t.u},function(t){K=t.r,Q=t.p,W=t.u,X=t.e,Z=t.b,tt=t.d,et=t.f},function(t){rt=t.k},function(t){nt=t._},function(t){ot=t.g},null,null],execute:function(){var it={class:"p-2rem"},at={class:"!w-[6rem] inline-block"},ut={class:"max-w-[26rem] inline-block"},ct=b({__name:"index",setup:function(t){var m=y();n();var b,ct=ot().refs.systemTabActive,lt=w(),st=w(!1),ft=w([]),pt=x({p:1,row:20}),dt=w(""),ht=w(0),yt=w({}),vt=w(!1),mt=x({processName:["进程名",""],processId:["进程pid",""],processTip:["启动命令",""]}),gt=function(){pt.p=1,Z.value="ALL",xt()},bt=function(){var t=c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,tt("fail2ban");case 2:(e=t.sent).setup?i({title:"端口防扫描",area:60,compData:{type:"AntiScan",requestFn:function(){return M()}},component:function(){return u((function(){return r.import("./index-legacy458.js?v=VERSION_NUMBER")}),void 0,r.meta.url)}}):(rt({name:e.name,type:"i",pluginInfo:e}),m.warn("请先安装防暴破插件"));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),wt=function(t){i({title:t?"修改端口规则":"添加端口规则",area:44,component:function(){return u((function(){return r.import("./add-port-rule-legacy.js?v=VERSION_NUMBER")}),void 0,r.meta.url)},compData:o(o({},yt.value),{},{isEdit:t,refreshFn:xt}),showFooter:!0})},xt=function(){var t=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("port"===ct.value){t.next=2;break}return t.abrupt("return");case 2:return e&&(Z.value=e),t.next=5,l({loading:st,data:{data:[Array,ft],page:s(ht)},request:J(o(o({chain:Z.value||"ALL"},pt),{},{query:dt.value}))});case 5:ft.value=ft.value.map((function(t){return o(o({},t),{},{key:"".concat(t.Port,"_").concat(t.id,"_").concat(t.Family)})}));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),_t=function(){var t=c(a().mark((function t(e,r){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v({icon:"warning-filled",title:"删除端口规则【"+e.Port+"】",content:"删除当前端口规则,是否继续操作?"});case 2:return n=o(o({},jt(e,"remove")),{},{domain:e.domain}),t.next=5,l({loading:"正在删除端口规则,请稍后...",request:Y(n,!1),message:!0,success:function(){return xt()}});case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),jt=function(t,e){return{operation:e,protocol:t.Protocol,address:t.Address,port:t.Port,strategy:t.Strategy,chain:t.Chain,brief:t.brief}},Pt=function(){var t=c(a().mark((function t(e){var r,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="accept"!==e.Strategy,t.next=3,v({icon:"warning-filled",title:"修改端口规则策略【"+e.Port+"】",content:"修改端口策略为“".concat(r?"放行":"禁止","”,设置后该端口将").concat(r?"恢复正常访问":"禁止访问服务器",",是否继续操作?")});case 3:return n={old_data:JSON.stringify(o({},e)),new_data:JSON.stringify(o({},jt(o(o({},e),{},{Strategy:r?"accept":"drop"}),"add")))},t.next=6,l({loading:"正在修改端口规则策略...",request:$(n,!1),message:!0,success:function(){return xt()}});case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ot=function(){var t=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return yt.value=e,t.next=3,l({loading:"正在获取数据,请稍后...",request:R({port:e.Port}),success:function(t){var e=t.data;mt.processName[1]=e.process_name,mt.processId[1]=e.process_pid,mt.processTip[1]=e.process_cmd}});case 3:vt.value=!0;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),kt=[{label:"删除",value:"delete",event:(b=c(a().mark((function t(e,r){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=function(){var t=c(a().mark((function t(e,r){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o(o({},jt(e,"remove")),{},{domain:e.domain}),t.next=3,Y(n,!1);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),t.next=3,et(e,r,n,{label:"端口",prop:"Port"},xt);case 3:case"end":return t.stop()}}),t)}))),function(t,e){return b.apply(this,arguments)})}],Lt=w([z({key:"key"}),{label:"协议",width:80,prop:"Protocol"},{label:"端口",width:120,renderHeader:function(){return K("端口","防火墙会加载系统所有端口信息,IPV6端口无法与IPV4分开管理,非必要勿删除IPV6端口")},render:function(t,e){return t.brief=t.brief||Q[t.Port],_("span",{class:"mr-[1rem]"},[t.Port+("ipv6"===t.Family?"(ipv6)":"")])}},{label:"状态",width:100,renderHeader:function(){return K("状态","link","https://www.bt.cn/bbs/thread-4708-1-1.html")},render:function(t,e){var r,n;return _("div",null,[_("span",null,[0===t.status?"未使用":1!==t.status||null!==(r=t.Port)&&void 0!==r&&r.includes("-")?"正常":"外网不通"]),_("span",{class:2!==t.status||null!==(n=t.Port)&&void 0!==n&&n.includes("-")||"udp"===t.Protocol?"!hidden":"bt-link",onClick:function(){return Ot(t)}},[j("(详情)")])])}}].concat(e(W({changePolicy:Pt,change:xt})),[{label:"来源",render:function(t,e){return _("div",null,[t.sid>0?_("span",{title:t.domain},[t.domain]):"all"===t.Address?_("span",null,[j("所有IP")]):_("span",{title:t.Address},[t.Address])])}},{label:"备注",showOverflowTooltip:!0,render:function(t){return _("span",null,[t.brief||Q[t.Port]||""])}},{label:"时间",prop:"addtime",width:160,renderHeader:function(){return K("时间","-- : 表示面板数据库中未记录更新时间,规则从系统中直接读取,忽略即可")}},X({editEvent:function(t){yt.value=t,wt(!0)},deleteEvent:_t})]));return P((function(){O(c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,window.$extension();case 3:if(e=t.sent){t.next=6;break}return t.abrupt("return",xt());case 6:if(!e.extensionElement({custom:{useOperate:B,portsPs:Q,setPortConfig:function(t){Lt.value[2]=t,xt()}}}).every((function(t){return!1===t}))){t.next=9;break}return t.abrupt("return",xt());case 9:t.next=14;break;case 11:return t.prev=11,t.t0=t.catch(0),t.abrupt("return",xt());case 14:case"end":return t.stop()}}),t,null,[[0,11]])}))))})),function(t,e){var r=q,n=f,o=p,i=d,a=U,u=H,c=C,l=h,s=g,y=k("bt-loading");return L(),E(s,null,{"header-left":S((function(){return[_(r,{type:"primary",onClick:e[0]||(e[0]=function(t){return wt(!1)})},{default:S((function(){return e[6]||(e[6]=[j(" 添加端口规则 ")])})),_:1}),_(nt,{type:"port",refreshFn:xt}),_(r,{onClick:bt},{default:S((function(){return e[7]||(e[7]=[j("端口防扫描")])})),_:1})]})),"header-right":S((function(){return[e[8]||(e[8]=A("div",{id:"extension-rulesTable"},null,-1)),_(n,{modelValue:I(dt),"onUpdate:modelValue":e[1]||(e[1]=function(t){return N(dt)?dt.value=t:null}),onSearch:gt,placeholder:"请输入端口/来源",class:"!w-24rem"},null,8,["modelValue"])]})),content:S((function(){return[T(_(o,{ref_key:"portTableRef",ref:lt,column:I(Lt),data:I(ft),description:"端口列表为空"},null,8,["column","data"]),[[y,I(st)],[y,"正在加载端口列表,请稍后...","title"]])]})),"footer-left":S((function(){return[_(i,{"table-ref":I(lt),options:kt},null,8,["table-ref"])]})),"footer-right":S((function(){return[_(a,{ref:"portRulesPager",total:I(ht),page:I(pt).p,"onUpdate:page":e[2]||(e[2]=function(t){return I(pt).p=t}),row:I(pt).row,"onUpdate:row":e[3]||(e[3]=function(t){return I(pt).row=t}),onChange:e[4]||(e[4]=function(t){return xt()}),name:"port"},null,8,["total","page","row"])]})),popup:S((function(){return[_(l,{title:I(yt).Port+"-端口使用进程详情",modelValue:I(vt),"onUpdate:modelValue":e[5]||(e[5]=function(t){return N(vt)?vt.value=t:null}),area:42},{default:S((function(){return[A("div",it,[_(c,{class:"margin-top table-descriptions",border:"",column:1},{default:S((function(){return[(L(!0),F(V,null,G(I(mt),(function(t,e){return L(),E(u,{key:e},{label:S((function(){return[A("span",at,D(t[0]),1)]})),default:S((function(){return[A("span",ut,D(t[1]),1)]})),_:2},1024)})),128))]})),_:1})])]})),_:1},8,["title","modelValue"])]})),_:1})}}});t("default",m(ct,[["__scopeId","data-v-162d6728"]]))}}}))}();
Save File
Cancel