mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix: tag order
This commit is contained in:
parent
745b88e849
commit
58dc3e8e32
@ -30,12 +30,7 @@ export default function ServerListClient() {
|
|||||||
|
|
||||||
const { result } = data;
|
const { result } = data;
|
||||||
|
|
||||||
const allTag = result.map((server) => server.tag).filter((tag) => tag);
|
|
||||||
const uniqueTags = [...new Set(allTag)];
|
|
||||||
|
|
||||||
uniqueTags.sort((a, b) => a.localeCompare(b));
|
|
||||||
|
|
||||||
uniqueTags.unshift(defaultTag);
|
|
||||||
|
|
||||||
const sortedServers = result.sort((a, b) => {
|
const sortedServers = result.sort((a, b) => {
|
||||||
const displayIndexDiff = (b.display_index || 0) - (a.display_index || 0);
|
const displayIndexDiff = (b.display_index || 0) - (a.display_index || 0);
|
||||||
@ -43,6 +38,11 @@ export default function ServerListClient() {
|
|||||||
return a.id - b.id;
|
return a.id - b.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const allTag = sortedServers.map((server) => server.tag).filter((tag) => tag);
|
||||||
|
const uniqueTags = [...new Set(allTag)];
|
||||||
|
|
||||||
|
uniqueTags.unshift(defaultTag);
|
||||||
|
|
||||||
const filteredServers =
|
const filteredServers =
|
||||||
tag === defaultTag
|
tag === defaultTag
|
||||||
? sortedServers
|
? sortedServers
|
||||||
|
Loading…
Reference in New Issue
Block a user