mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user