FEATURE: Search screened IP address in blocks (#15461)

An admin could search for all screened ip addresses in a block by
using wildcards. 192.168.* returned all IPs in range 192.168.0.0/16.
This feature allows admins to search for a single IP address in all
screened IP blocks. 192.168.0.1 returns all IP blocks that match it,
for example 192.168.0.0/16.

* FEATURE: Remove roll up button for screened IPs

* FIX: Match more specific screened IP address first
This commit is contained in:
Bianca Nenciu
2022-01-11 09:16:51 +02:00
committed by GitHub
parent 5a8b8f6f1e
commit 5d35c38db2
9 changed files with 29 additions and 99 deletions

View File

@@ -107,36 +107,6 @@ export default Controller.extend({
this.model.unshiftObject(arg);
},
rollUp() {
return bootbox.confirm(
I18n.t("admin.logs.screened_ips.roll_up_confirm"),
I18n.t("no_value"),
I18n.t("yes_value"),
(confirmed) => {
if (confirmed) {
this.set("loading", true);
return ScreenedIpAddress.rollUp().then((results) => {
if (results && results.subnets) {
if (results.subnets.length > 0) {
this.send("show");
bootbox.alert(
I18n.t("admin.logs.screened_ips.rolled_up_some_subnets", {
subnets: results.subnets.join(", "),
})
);
} else {
this.set("loading", false);
bootbox.alert(
I18n.t("admin.logs.screened_ips.rolled_up_no_subnet")
);
}
}
});
}
}
);
},
exportScreenedIpList() {
exportEntity("screened_ip").then(outputExportResult);
},

View File

@@ -47,10 +47,6 @@ ScreenedIpAddress.reopenClass({
screened_ips.map((b) => ScreenedIpAddress.create(b))
);
},
rollUp() {
return ajax("/admin/logs/screened_ip_addresses/roll_up", { type: "POST" });
},
});
export default ScreenedIpAddress;

View File

@@ -8,11 +8,6 @@
placeholderKey="admin.logs.screened_ips.form.filter"
autocorrect="off"
autocapitalize="off"}}
{{d-button
class="btn-default"
action=(action "rollUp")
title="admin.logs.screened_ips.roll_up.title"
label="admin.logs.screened_ips.roll_up.text"}}
{{d-button
class="btn-default"
action=(action "exportScreenedIpList")