diff --git a/CHANGELOG.md b/CHANGELOG.md index 7221ab5..911528d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ SPDX-License-Identifier: AGPL-3.0-or-later CHANGELOG ========= +Unreleased changes +------------------ + +### Configuration +- Sort bots alphabetically in side menu. + 3.2.0 (2023-07-19) ------------------ diff --git a/intelmq_manager/static/js/configs.js b/intelmq_manager/static/js/configs.js index 8dd3b1e..f50c4ce 100644 --- a/intelmq_manager/static/js/configs.js +++ b/intelmq_manager/static/js/configs.js @@ -86,7 +86,15 @@ function load_bots(config) { let $bot_group = $("#templates > ul.side-menu > li").clone().prependTo("#side-menu").css("border-bottom-color", GROUP_COLORS[bot_group][0]); $bot_group.find("> a").prepend(bot_group); let group = config[bot_group]; - for (let bot_name in group) { + + // Sort bots alphabetically + const sortedGroupKeys = Object.keys(group).sort(); + const sortedGroup = {}; + sortedGroupKeys.forEach(key => { + sortedGroup[key] = group[key]; + }); + + for (let bot_name in sortedGroup) { let bot = group[bot_name]; let $bot = $bot_group.find("ul > li:first").clone().appendTo($("ul", $bot_group)) .attr("title", bot.description)