FEATURE: rolls up 1.2.*.* IP ranges when number of entries > 10

This commit is contained in:
Régis Hanol
2014-11-27 19:29:30 +01:00
parent 062e954122
commit 5b90ceb71d
5 changed files with 99 additions and 17 deletions

View File

@ -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"));
}
}
});
}
});