From 4100c518edd404b71c642553aa8027971a1827c6 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Sun, 15 Dec 2024 23:53:50 +0800 Subject: [PATCH] style: sort button --- src/pages/Server.tsx | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/pages/Server.tsx b/src/pages/Server.tsx index ea25d7e..72728a9 100644 --- a/src/pages/Server.tsx +++ b/src/pages/Server.tsx @@ -15,7 +15,14 @@ import { fetchServerGroup } from "@/lib/nezha-api" import { cn, formatNezhaInfo } from "@/lib/utils" import { NezhaWebsocketResponse } from "@/types/nezha-api" import { ServerGroup } from "@/types/nezha-api" -import { ChartBarSquareIcon, CogIcon, MapIcon, ViewColumnsIcon } from "@heroicons/react/20/solid" +import { + ArrowDownIcon, + ArrowUpIcon, + ArrowsUpDownIcon, + ChartBarSquareIcon, + MapIcon, + ViewColumnsIcon, +} from "@heroicons/react/20/solid" import { useQuery } from "@tanstack/react-query" import { useEffect, useState } from "react" import { useTranslation } from "react-i18next" @@ -137,8 +144,8 @@ export default function Servers() { status === "all" ? filteredServers : filteredServers.filter((server) => - [status].includes(formatNezhaInfo(nezhaWsData.now, server).online ? "online" : "offline"), - ) + [status].includes(formatNezhaInfo(nezhaWsData.now, server).online ? "online" : "offline"), + ) filteredServers = filteredServers.sort((a, b) => { const serverAInfo = formatNezhaInfo(nezhaWsData.now, a) @@ -239,13 +246,22 @@ export default function Servers() {