1 line
9.9 KiB
JavaScript
1 line
9.9 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{1721:function(t,e,r){"use strict";r.r(e);var s=r(3832),i=r(2071);for(var n in i)["default"].indexOf(n)<0&&function(t){r.d(e,t,(function(){return i[t]}))}(n);var o=r(0),a=r(3166),l=r.n(a),u=Object(o.a)(i.default,s.a,s.b,!1,null,null,null);"function"==typeof l.a&&l()(u),e.default=u.exports},1881:function(t,e,r){"use strict";r(7),r(10),r(6),r(8),r(11);var s=r(1);Object.defineProperty(e,"__esModule",{value:!0}),e.unblock=e.block=e.unskip=e.skip=e.getBlockList=e.getSkipList=e.getUserList=e.getIpList=e.getGeneralList=e.getIpInfo=e.getDefaults=void 0,r(57),r(5),r(110),r(17),r(96);var i=s(r(2)),n=s(r(78));function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,s)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l="/CMD_BRUTE_FORCE_MONITOR",u=function(t,e){return n.default.get(a({id:t,url:l},e))},c=function(t,e){return n.default.post({url:l,params:{action:t},schema:e})},f=u("BFM_DEFAULTS",{params:{seek_value:"-1"},after:function(t){return t.flow(t.project({logsize:"BRUTE_LOG_SIZE",userLimit:"USER_LIMIT",ipLimit:"IP_LIMIT",logScanning:"LOG_SCANNING",subjects:"SUBJECT_SELECT",defaultSubject:"SUBJECT_SELECT","scripts.block":"HAVE_BLOCK_SH","scripts.unblock":"HAVE_UNBLOCK_SH","scripts.show_blocked_ips":"HAVE_SHOW_BLOCKED_IPS_SH"}),t.mapProps({logScanning:t.convert.toAppBoolean,subjects:t.toSelect,defaultSubject:t.flow(t.find(t.getProp("selected")),t.getProp("value")),scripts:t.mapValues(t.isEqual("1"))}))}});e.getDefaults=f;var p=u("BFM_IPINFO",{schema:{ipinfo:n.default.REQUIRED_STRING},after:function(t){return t.flow(t.project({ip:"BLOCK_IP",data:"info"}),t.mapProp("data",t.flow(t.convert.toLines,t.filter(t.notEmpty))))}});e.getIpInfo=p;var d=u("BFM_GENERAL_LIST",{params:{show:"LOGINFAILURES"},pagination:!0,schema:{filter:n.default.OPTIONAL_STRING,value:n.default.OPTIONAL_STRING},before:function(t){var e=t.filter,r=t.value,s={};if(t.sort||(s.sort1="-1"),e){var i="ip"===e?2:3;s["comparison".concat(i)]="equals",s["value".concat(i)]=r}return s},after:function(t){return t.flow(t.project({rows:"LOGINFAILURES"}),t.processTableInfo("rows"),t.mapProp("rows",t.toArray),t.mapProp("rows",t.mapArray((function(t){return a(a({},t),{},{date:new Date(Number(t.id.slice(0,13))),index:Number(t.id.slice(13))})}))))}});e.getGeneralList=d;var _=u("BFM_IPLIST",{params:{show:"IPLOGINFAILURES",sort1:-2},pagination:!0,after:function(t){return t.flow(t.project({rows:"IPLOGINFAILURES"}),t.processTableInfo("rows"),t.mapProp("rows",t.flow(t.toArray,t.mapArray(t.project({ip:"ip",failures:"login_failures",first:"first_entry",last:"last_entry",notified:"notified",blocked:"blocked"})),t.mapArrayProps({first:t.convert.toAppDate,last:t.convert.toAppDate,notified:t.isEqual("Yes"),blocked:t.isEqual("Yes")}))))}});e.getIpList=_;var b=u("BFM_USER_LIST",{params:{show:"USERLOGINFAILURES",sort1:-2},pagination:!0,after:function(t){return t.flow(t.project({rows:"USERLOGINFAILURES"}),t.processTableInfo("rows"),t.mapProp("rows",t.flow(t.toArray,t.mapArrayProps({first_entry:t.convert.toAppDate,last_entry:t.convert.toAppDate,notified:t.isEqual("Yes")}))))}});e.getUserList=b;var g=u("BFM_SKIP_LIST",{params:{show:"SKIPLIST"},pagination:!0,after:function(t){return t.flow(t.project({rows:"SKIPLIST"}),t.processTableInfo("rows"),t.mapProp("rows",t.flow(t.toArray,t.mapArray(t.flow(t.moveProp("when","date"),t.mapProp("date",t.convert.toAppDate))))))}});e.getSkipList=g;var v=u("BFM_BLOCK_LIST",{params:{show:"BLOCKED_IPS"},pagination:!0,after:function(t){return t.flow(t.project({rows:"BLOCKED_IPS"}),t.processTableInfo("rows"),t.mapProp("rows",t.toArray),t.mapProp("rows",t.mapArray(t.deleteProp("ip_info"),t.mapProp("date_blocked",t.convert.toAppDate))))}});e.getBlockList=v;var m={type:Array,required:!1},h=n.default.OPTIONAL_STRING,I=c("skiplist",{ip:m,user:m,comments:h,skip_value:h});e.skip=I;var S=c("remove_from_skiplist",{select:n.default.ROWS});e.unskip=S;var L=c("block_ips",{ip:m,user:m});e.block=L;var O=c("unblock",{ip:n.default.ROWS});e.unblock=O},1882:function(t,e,r){"use strict";r.r(e);var s=r(1883),i=r.n(s);for(var n in s)["default"].indexOf(n)<0&&function(t){r.d(e,t,(function(){return s[t]}))}(n);e.default=i.a},1883:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r(26),r(5);var s={api:[{command:r(1881).getDefaults,bind:{"response.scripts":"scripts"}}],props:{id:{type:String,required:!0},filter:{type:Object,required:!1}},methods:{changeTab:function(t){var e=this,r="general"===t?"admin/brute-force-monitor":"admin/brute-force-monitor/".concat(t);r!==this.$route.name&&(this.$router.push({name:r}),this.$nextTick((function(){e.$refs.tabs.dataCurrentTab=e.id})))}},computed:{filterMessage:function(){if(this.filter){if("ip"===this.filter.filter)return this.$gettextInterpolate(this.$gettext("List filtered by IP: %{ ip }"),{ip:this.filter.value});if("user"===this.filter.filter)return this.$gettextInterpolate(this.$gettext("List filtered by User: %{ user } "),{user:this.filter.value})}return this.$gettext("Select IP address or User to filter results")},headers:function(){var t=[{id:"general",label:this.$gettext("Failed Logins"),desc:this.filterMessage},{id:"ip_list",label:this.$gettext("Failed Logins: IP list"),desc:this.$gettext("Select IP to filter results")},{id:"user_list",label:this.$gettext("Failed logins: Usernames List"),desc:this.$gettext("Select username to filter results")},{id:"skip_list",label:this.$gettext("Skip List"),desc:this.$gettext("Skipped IPs / Users")}];return this.$api.scripts.show_blocked_ips&&t.push({id:"block_list",label:this.$gettext("Block List"),desc:this.$gettext("View / Delete Blocked IPs")}),t}}};e.default=s},1922:function(t,e,r){"use strict";r.r(e);var s=r(1930),i=r(1882);for(var n in i)["default"].indexOf(n)<0&&function(t){r.d(e,t,(function(){return i[t]}))}(n);var o=r(0),a=Object(o.a)(i.default,s.a,s.b,!1,null,null,null);e.default=a.exports},1930:function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return i}));var s=function(){var t=this.$createElement,e=this._self._c||t;return e("app-page-section",[e("ui-tabs",{ref:"tabs",attrs:{selected:this.id,tabs:this.headers},on:{"update:selected":this.changeTab}},[e("div",{attrs:{slot:"tab:"+this.id},slot:"tab:"+this.id},[this._t("default")],2)])],1)},i=[]},2071:function(t,e,r){"use strict";r.r(e);var s=r(2072),i=r.n(s);for(var n in s)["default"].indexOf(n)<0&&function(t){r.d(e,t,(function(){return s[t]}))}(n);e.default=i.a},2072:function(t,e,r){"use strict";var s=r(1);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(1881),n=s(r(1922)),o=s(r(3165)),a={preload:[i.getDefaults,i.getUserList],commands:{getUserList:i.getUserList},components:{Tabs:n.default,SkipUsersDialog:o.default},data:function(){return{select:[]}}};e.default=a},2073:function(t,e,r){"use strict";r.r(e);var s=r(2074),i=r.n(s);for(var n in s)["default"].indexOf(n)<0&&function(t){r.d(e,t,(function(){return s[t]}))}(n);e.default=i.a},2074:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=r(1881),i={props:{select:{type:Array,required:!0,default:function(){return[]}}},methods:{submit:function(){(0,s.skip)({user:this.select})}}};e.default=i},3165:function(t,e,r){"use strict";r.r(e);var s=r(3988),i=r(2073);for(var n in i)["default"].indexOf(n)<0&&function(t){r.d(e,t,(function(){return i[t]}))}(n);var o=r(0),a=Object(o.a)(i.default,s.a,s.b,!1,null,null,null);e.default=a.exports},3166:function(t,e){},3832:function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return i}));var s=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("app-page",{attrs:{id:"brute-force-monitor"}},[r("tabs",{attrs:{id:"user_list"}},[r("ui-api-table",t._b({on:{"action:skip":function(e){t.$dialog("ADD_USERS_TO_SKIP_LIST").open()}},scopedSlots:t._u([{key:"col:user",fn:function(e){var s=e.user;return r("ui-link",{attrs:{name:"admin/brute-force-monitor",query:{user:s}},domProps:{textContent:t._s(s)}})}},{key:"col:notified",fn:function(e){var s=e.notified;return r("ui-badge",{attrs:{theme:s?"primary":"danger",size:"small"}},[t._v("\n "+t._s(s?t.$gettext("Yes"):t.$gettext("No"))+"\n ")])}}]),model:{value:t.select,callback:function(e){t.select=e},expression:"select"}},"ui-api-table",{command:t.$commands.getUserList,rowID:"user",columns:{user:{label:t.$gettext("User"),grow:!0},login_failures:t.$gettext("Login Failures"),first_entry:{label:t.$gettext("First"),filter:"date"},last_entry:{label:t.$gettext("Last"),filter:"date"},notified:t.$gettext("Notified")},actions:{skip:t.$gettext("Skip")},initialSort:{key:"login_failures",order:"DESC"},verticalLayout:t.$_Client.isPhone},!1))],1),t._v(" "),r("skip-users-dialog",t._b({},"skip-users-dialog",{select:t.select},!1))],1)},i=[]},3988:function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return i}));var s=function(){var t=this.$createElement,e=this._self._c||t;return e("ui-dialog",{attrs:{id:"ADD_USERS_TO_SKIP_LIST",theme:"danger"}},[e("translate",{attrs:{slot:"title"},slot:"title"},[this._v("Add to skip list")]),this._v(" "),e("translate",{attrs:{slot:"content","translate-n":this.select.length,"translate-plural":"Are you sure you want to add selected users to skip list?"},slot:"content"},[this._v("\n Are you sure you want to add selected user to skip list?\n ")]),this._v(" "),e("ui-button",{attrs:{slot:"buttons",theme:"danger"},on:{click:this.submit},slot:"buttons"},[e("translate",[this._v("\n Add\n ")])],1)],1)},i=[]}}]); |