mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
refactor(overview): sort by speed
This commit is contained in:
parent
34f29420df
commit
ccc875fb04
@ -107,12 +107,12 @@ export default function ServerListClient() {
|
||||
: filteredServersByStatus.filter((server) => server.tag === tag);
|
||||
|
||||
if (filter) {
|
||||
// 根据使用流量进行从高到低排序
|
||||
// 根据使用速度进行从高到低排序
|
||||
filteredServers.sort((a, b) => {
|
||||
return (
|
||||
b.status.NetInTransfer +
|
||||
b.status.NetOutTransfer -
|
||||
(a.status.NetInTransfer + b.status.NetOutTransfer)
|
||||
b.status.NetInSpeed +
|
||||
b.status.NetOutSpeed -
|
||||
(a.status.NetInSpeed + b.status.NetOutSpeed)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -49,9 +49,12 @@ export default function ServerOverviewClient() {
|
||||
setStatus("all");
|
||||
}
|
||||
}}
|
||||
className={cn("cursor-pointer hover:border-blue-500 transition-all", {
|
||||
"pointer-events-none": global,
|
||||
})}
|
||||
className={cn(
|
||||
"cursor-pointer hover:border-blue-500 transition-all min-h-[94px]",
|
||||
{
|
||||
"pointer-events-none": global,
|
||||
},
|
||||
)}
|
||||
>
|
||||
<CardContent className="flex h-full items-center px-6 py-3">
|
||||
<section className="flex flex-col gap-1">
|
||||
@ -83,7 +86,7 @@ export default function ServerOverviewClient() {
|
||||
}
|
||||
}}
|
||||
className={cn(
|
||||
"cursor-pointer hover:ring-green-500 ring-1 ring-transparent transition-all",
|
||||
"cursor-pointer hover:ring-green-500 ring-1 ring-transparent transition-all min-h-[94px]",
|
||||
{
|
||||
"ring-green-500 ring-2 border-transparent": status === "online",
|
||||
},
|
||||
@ -123,7 +126,7 @@ export default function ServerOverviewClient() {
|
||||
}
|
||||
}}
|
||||
className={cn(
|
||||
"cursor-pointer hover:ring-red-500 ring-1 ring-transparent transition-all",
|
||||
"cursor-pointer hover:ring-red-500 ring-1 ring-transparent transition-all min-h-[94px]",
|
||||
{
|
||||
"ring-red-500 ring-2 border-transparent": status === "offline",
|
||||
},
|
||||
@ -163,7 +166,7 @@ export default function ServerOverviewClient() {
|
||||
}
|
||||
}}
|
||||
className={cn(
|
||||
"cursor-pointer hover:ring-purple-500 ring-1 ring-transparent transition-all",
|
||||
"cursor-pointer hover:ring-purple-500 ring-1 ring-transparent transition-all min-h-[94px]",
|
||||
{
|
||||
"ring-purple-500 ring-2 border-transparent": filter === true,
|
||||
},
|
||||
|
@ -5,8 +5,6 @@ import { Suspense } from "react";
|
||||
import ServerGlobal from "./ClientComponents/Global";
|
||||
import GlobalLoading from "./ClientComponents/GlobalLoading";
|
||||
|
||||
export const runtime = "edge";
|
||||
|
||||
export default async function Home({
|
||||
searchParams,
|
||||
}: {
|
||||
|
@ -4,8 +4,6 @@ import Link from "next/link";
|
||||
import Footer from "./(main)/footer";
|
||||
import Header from "./(main)/header";
|
||||
|
||||
export const runtime = "edge";
|
||||
|
||||
export default function NotFoundPage() {
|
||||
const t = useTranslations("NotFoundPage");
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user