Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Sort bots alphabetically in Configuration side menu #298

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
------------------

Expand Down
10 changes: 9 additions & 1 deletion intelmq_manager/static/js/configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading