mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Merge branch 'main' into cloudflare
This commit is contained in:
commit
4c746cf597
@ -246,12 +246,12 @@ export function NetworkChart({
|
|||||||
tickFormatter={(value) => `${value}ms`}
|
tickFormatter={(value) => `${value}ms`}
|
||||||
/>
|
/>
|
||||||
<ChartTooltip
|
<ChartTooltip
|
||||||
|
cursor={false}
|
||||||
|
defaultIndex={1}
|
||||||
content={
|
content={
|
||||||
<ChartTooltipContent
|
<ChartTooltipContent
|
||||||
indicator={"dot"}
|
indicator={"line"}
|
||||||
className="gap-2"
|
|
||||||
labelKey="created_at"
|
labelKey="created_at"
|
||||||
labelClassName="text-muted-foreground"
|
|
||||||
labelFormatter={(_, payload) => {
|
labelFormatter={(_, payload) => {
|
||||||
return formatTime(payload[0].payload.created_at);
|
return formatTime(payload[0].payload.created_at);
|
||||||
}}
|
}}
|
||||||
|
@ -178,7 +178,7 @@ const ChartTooltipContent = React.forwardRef<
|
|||||||
<div
|
<div
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn(
|
className={cn(
|
||||||
"grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
|
"grid min-w-[8rem] items-start gap-1.5 rounded-sm border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@ -238,8 +238,15 @@ const ChartTooltipContent = React.forwardRef<
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{item.value && (
|
{item.value && (
|
||||||
<span className="ml-2 font-mono font-medium tabular-nums text-foreground">
|
<span
|
||||||
{item.value.toLocaleString()}
|
className={cn(
|
||||||
|
"ml-2 font-mono font-medium tabular-nums text-foreground",
|
||||||
|
payload.length === 1 && "-ml-9",
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{typeof item.value === "number"
|
||||||
|
? item.value.toFixed(3).toLocaleString()
|
||||||
|
: item.value}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -103,7 +103,7 @@ export function formatTime(timestamp: number): string {
|
|||||||
const year = date.getFullYear();
|
const year = date.getFullYear();
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const day = date.getDate();
|
const day = date.getDate();
|
||||||
const hours = date.getHours();
|
const hours = date.getHours().toString().padStart(2, "0");
|
||||||
const minutes = date.getMinutes().toString().padStart(2, "0");
|
const minutes = date.getMinutes().toString().padStart(2, "0");
|
||||||
const seconds = date.getSeconds().toString().padStart(2, "0");
|
const seconds = date.getSeconds().toString().padStart(2, "0");
|
||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user