mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-06-21 02:20:41 +00:00
feat: net transfer badge
This commit is contained in:
+11
-5
@@ -57,11 +57,13 @@ export default function Servers() {
|
||||
|
||||
const totalServers = nezhaWsData?.servers?.length || 0;
|
||||
const onlineServers =
|
||||
nezhaWsData?.servers?.filter((server) => formatNezhaInfo(nezhaWsData.now,server).online)
|
||||
?.length || 0;
|
||||
nezhaWsData?.servers?.filter(
|
||||
(server) => formatNezhaInfo(nezhaWsData.now, server).online,
|
||||
)?.length || 0;
|
||||
const offlineServers =
|
||||
nezhaWsData?.servers?.filter((server) => !formatNezhaInfo(nezhaWsData.now,server).online)
|
||||
?.length || 0;
|
||||
nezhaWsData?.servers?.filter(
|
||||
(server) => !formatNezhaInfo(nezhaWsData.now, server).online,
|
||||
)?.length || 0;
|
||||
const up =
|
||||
nezhaWsData?.servers?.reduce(
|
||||
(total, server) => total + server.state.net_out_transfer,
|
||||
@@ -112,7 +114,11 @@ export default function Servers() {
|
||||
{showServices && <ServiceTracker />}
|
||||
<section className="grid grid-cols-1 gap-2 md:grid-cols-2 mt-6">
|
||||
{filteredServers.map((serverInfo) => (
|
||||
<ServerCard now={nezhaWsData.now} key={serverInfo.id} serverInfo={serverInfo} />
|
||||
<ServerCard
|
||||
now={nezhaWsData.now}
|
||||
key={serverInfo.id}
|
||||
serverInfo={serverInfo}
|
||||
/>
|
||||
))}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user