fix(sidebar): sort hosts by IP address numerically (#1629)

This commit is contained in:
ZacharyZcR authored and GitHub committed 2026-10-14 08:59:40 +08:00
1 parent 25e58a6425
commit 4c9ee5923e
2 files changed
+40 -2

No files matched your search

+2 -2
View File
@@ -70,9 +70,9 @@ export function sortHostTree(
case "name-desc":
return hostB.name.localeCompare(hostA.name);
case "ip-asc":
return hostA.ip.localeCompare(hostB.ip);
return hostA.ip.localeCompare(hostB.ip, undefined, { numeric: true });
case "ip-desc":
return hostB.ip.localeCompare(hostA.ip);
return hostB.ip.localeCompare(hostA.ip, undefined, { numeric: true });
case "status-online":
return Number(hostB.online) - Number(hostA.online);
case "status-offline":