FIX: The connection list is now displayed sorted. Current on top.

This commit is contained in:
Azpect3120 2024-08-19 14:27:28 -07:00
parent 4a7cc5f7e8
commit c8b2fadbb0

View File

@ -19,11 +19,12 @@ func ConnectionsList(connections map[string]string, current string) string {
return html + LIST_CLOSE
}
for name, url := range connections {
html += fmt.Sprintf(LIST_ITEM, connections[current], " selected", current)
for _, name := range getSortedKeys(connections) {
if name == current {
html += fmt.Sprintf(LIST_ITEM, url, " selected", name)
continue
} else {
html += fmt.Sprintf(LIST_ITEM, url, "", name)
html += fmt.Sprintf(LIST_ITEM, connections[name], "", name)
}
}