mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-02-04 12:40:10 +00:00
feat: add hash tag
This commit is contained in:
@@ -18,31 +18,35 @@ export const CycleTransferStatsCard: React.FC<CycleTransferStatsProps> = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
return Object.entries(cycleData.server_name).map(([serverId, serverName]) => {
|
||||
const transfer = cycleData.transfer?.[serverId] || 0;
|
||||
const nextUpdate = cycleData.next_update?.[serverId];
|
||||
return Object.entries(cycleData.server_name).map(
|
||||
([serverId, serverName]) => {
|
||||
const transfer = cycleData.transfer?.[serverId] || 0;
|
||||
const nextUpdate = cycleData.next_update?.[serverId];
|
||||
|
||||
if (!transfer && !nextUpdate) {
|
||||
return null;
|
||||
}
|
||||
if (!transfer && !nextUpdate) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<CycleTransferStatsClient
|
||||
key={`${cycleId}-${serverId}`}
|
||||
name={cycleData.name}
|
||||
from={cycleData.from}
|
||||
to={cycleData.to}
|
||||
max={cycleData.max}
|
||||
serverStats={[{
|
||||
serverId,
|
||||
serverName,
|
||||
transfer,
|
||||
nextUpdate: nextUpdate || "",
|
||||
}]}
|
||||
className={className}
|
||||
/>
|
||||
);
|
||||
});
|
||||
return (
|
||||
<CycleTransferStatsClient
|
||||
key={`${cycleId}-${serverId}`}
|
||||
name={cycleData.name}
|
||||
from={cycleData.from}
|
||||
to={cycleData.to}
|
||||
max={cycleData.max}
|
||||
serverStats={[
|
||||
{
|
||||
serverId,
|
||||
serverName,
|
||||
transfer,
|
||||
nextUpdate: nextUpdate || "",
|
||||
},
|
||||
]}
|
||||
className={className}
|
||||
/>
|
||||
);
|
||||
},
|
||||
);
|
||||
})}
|
||||
</section>
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@ const Footer: React.FC = () => {
|
||||
<section className="flex flex-col">
|
||||
<section className="mt-1 flex items-center justify-between gap-2 text-[13px] font-light tracking-tight text-neutral-600/50 dark:text-neutral-300/50">
|
||||
<p>
|
||||
©2020-{new Date().getFullYear()}{" "}
|
||||
©2020-{new Date().getFullYear()}{" "}
|
||||
<a href={"https://github.com/naiba/nezha"} target="_blank">
|
||||
Nezha
|
||||
</a>
|
||||
@@ -22,6 +22,9 @@ const Footer: React.FC = () => {
|
||||
>
|
||||
nezha-dash
|
||||
</a>
|
||||
{import.meta.env.VITE_GIT_HASH && (
|
||||
<span className="ml-1">({import.meta.env.VITE_GIT_HASH})</span>
|
||||
)}
|
||||
</p>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -37,7 +37,12 @@ export const ServiceTracker: React.FC = () => {
|
||||
};
|
||||
|
||||
if (isLoading) {
|
||||
return <div className="mt-4 text-sm font-medium flex items-center gap-1"><Loader visible={true} />Loading...</div>;
|
||||
return (
|
||||
<div className="mt-4 text-sm font-medium flex items-center gap-1">
|
||||
<Loader visible={true} />
|
||||
Loading...
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -58,22 +63,23 @@ export const ServiceTracker: React.FC = () => {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{serviceData.data.services && Object.keys(serviceData.data.services).length > 0 && (
|
||||
<section className="grid grid-cols-1 md:grid-cols-2 mt-4 gap-2 md:gap-4">
|
||||
{Object.entries(serviceData.data.services).map(([name, data]) => {
|
||||
const { days, uptime, avgDelay } = processServiceData(data);
|
||||
return (
|
||||
<ServiceTrackerClient
|
||||
key={name}
|
||||
days={days}
|
||||
title={data.service.name}
|
||||
uptime={uptime}
|
||||
avgDelay={avgDelay}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</section>
|
||||
)}
|
||||
{serviceData.data.services &&
|
||||
Object.keys(serviceData.data.services).length > 0 && (
|
||||
<section className="grid grid-cols-1 md:grid-cols-2 mt-4 gap-2 md:gap-4">
|
||||
{Object.entries(serviceData.data.services).map(([name, data]) => {
|
||||
const { days, uptime, avgDelay } = processServiceData(data);
|
||||
return (
|
||||
<ServiceTrackerClient
|
||||
key={name}
|
||||
days={days}
|
||||
title={data.service.name}
|
||||
uptime={uptime}
|
||||
avgDelay={avgDelay}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</section>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user