mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FEATURE: rolls up 1.2.*.* IP ranges when number of entries > 10
This commit is contained in:
@ -21,8 +21,16 @@ export default Ember.ArrayController.extend(Discourse.Presence, {
|
||||
return bootbox.confirm(I18n.t("admin.logs.screened_ips.roll_up_confirm"), I18n.t("no_value"), I18n.t("yes_value"), function (confirmed) {
|
||||
if (confirmed) {
|
||||
self.set("loading", true)
|
||||
return Discourse.ScreenedIpAddress.rollUp().then(function() {
|
||||
self.send("show");
|
||||
return Discourse.ScreenedIpAddress.rollUp().then(function(results) {
|
||||
if (results && results.subnets) {
|
||||
if (results.subnets.length > 0) {
|
||||
self.send("show");
|
||||
bootbox.alert(I18n.t("admin.logs.screened_ips.rolled_up_some_subnets", { subnets: results.subnets.join(", ") }));
|
||||
} else {
|
||||
self.set("loading", false);
|
||||
bootbox.alert(I18n.t("admin.logs.screened_ips.rolled_up_no_subnet"));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user