Skip to content

Commit 830f41c

Browse files
authored
Merge pull request #298 from Psych0meter/develop
ENH: Sort bots alphabetically in Configuration side menu
2 parents 76b3e07 + 93ebbd5 commit 830f41c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ CHANGELOG
1313
* Improve the error popup window to make its contents more readable (PR#304 by Radek Vyhnal).
1414
* Tests: Update/Fix Debian package build scripts (PR#305 by Sebastian Wagner).
1515

16+
### Configuration
17+
- Sort bots alphabetically in side menu (PR#298 by Psych0meter).
18+
1619
3.3.0 (2024-03-01)
1720
------------------
1821

intelmq_manager/static/js/configs.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,15 @@ function load_bots(config) {
8686
let $bot_group = $("#templates > ul.side-menu > li").clone().prependTo("#side-menu").css("border-bottom-color", GROUP_COLORS[bot_group][0]);
8787
$bot_group.find("> a").prepend(bot_group);
8888
let group = config[bot_group];
89-
for (let bot_name in group) {
89+
90+
// Sort bots alphabetically
91+
const sortedGroupKeys = Object.keys(group).sort();
92+
const sortedGroup = {};
93+
sortedGroupKeys.forEach(key => {
94+
sortedGroup[key] = group[key];
95+
});
96+
97+
for (let bot_name in sortedGroup) {
9098
let bot = group[bot_name];
9199
let $bot = $bot_group.find("ul > li:first").clone().appendTo($("ul", $bot_group))
92100
.attr("title", bot.description)

0 commit comments

Comments
 (0)