fixed abnormal percentage in avg cpu and memory
This commit is contained in:
@@ -131,7 +131,7 @@ export default function Dashboard() {
|
|||||||
</SummaryCard>
|
</SummaryCard>
|
||||||
<SummaryCard
|
<SummaryCard
|
||||||
className="text-chart-2"
|
className="text-chart-2"
|
||||||
value={`${serverData.cpu.toFixed(0)}%`}
|
value={`${Math.floor(serverData.cpu)}%`}
|
||||||
icon={Cpu}
|
icon={Cpu}
|
||||||
>
|
>
|
||||||
<span className="hidden sm:inline">Avg CPU Usage</span>
|
<span className="hidden sm:inline">Avg CPU Usage</span>
|
||||||
@@ -139,7 +139,7 @@ export default function Dashboard() {
|
|||||||
</SummaryCard>
|
</SummaryCard>
|
||||||
<SummaryCard
|
<SummaryCard
|
||||||
className="text-chart-1"
|
className="text-chart-1"
|
||||||
value={`${serverData.memory.toFixed(0)}%`}
|
value={`${Math.floor(serverData.memory)}%`}
|
||||||
icon={MemoryStick}
|
icon={MemoryStick}
|
||||||
>
|
>
|
||||||
<span className="hidden sm:inline">Avg Memory Usage</span>
|
<span className="hidden sm:inline">Avg Memory Usage</span>
|
||||||
@@ -157,13 +157,13 @@ export default function Dashboard() {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="flex flex-col gap-4 w-full md:w-96">
|
<CardContent className="flex flex-col gap-4 w-full md:w-96">
|
||||||
<UsageBar
|
<UsageBar
|
||||||
value={serverData.cpu}
|
value={Math.floor(serverData.cpu)}
|
||||||
Icon={Cpu}
|
Icon={Cpu}
|
||||||
text="CPU"
|
text="CPU"
|
||||||
color="var(--chart-2)"
|
color="var(--chart-2)"
|
||||||
/>
|
/>
|
||||||
<UsageBar
|
<UsageBar
|
||||||
value={serverData.memory}
|
value={Math.floor(serverData.memory)}
|
||||||
Icon={MemoryStick}
|
Icon={MemoryStick}
|
||||||
text="Memory"
|
text="Memory"
|
||||||
color="var(--chart-1)"
|
color="var(--chart-1)"
|
||||||
|
|||||||
Reference in New Issue
Block a user