feat: sort hosts, thresholds, and channels alphabetically on settings page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Andreas Wrede
2026-05-21 13:01:47 -04:00
parent f4231dd5f3
commit 8729fe7038
+2 -2
View File
@@ -197,7 +197,7 @@ def get_settings_sections(config: dict, threshold_checker=None) -> list:
# ---- Notification channels (complex, built separately) ---------------- # ---- Notification channels (complex, built separately) ----------------
_METADATA_KEYS = {"type", "owner", "private", "min_level"} _METADATA_KEYS = {"type", "owner", "private", "min_level"}
notif_channels = [] notif_channels = []
for ch_name, ch_cfg in (config.get("notification_channels") or {}).items(): for ch_name, ch_cfg in sorted((config.get("notification_channels") or {}).items()):
if not isinstance(ch_cfg, dict): if not isinstance(ch_cfg, dict):
continue continue
ch_type = ch_cfg.get("type", "") ch_type = ch_cfg.get("type", "")
@@ -276,7 +276,7 @@ def get_settings_sections(config: dict, threshold_checker=None) -> list:
# ---- Hosts summary ---------------------------------------------------- # ---- Hosts summary ----------------------------------------------------
hosts_list = [] hosts_list = []
for hname, hcfg in (config.get("hosts") or {}).items(): for hname, hcfg in sorted((config.get("hosts") or {}).items()):
if not isinstance(hcfg, dict): if not isinstance(hcfg, dict):
continue continue
hosts_list.append({ hosts_list.append({