Merge pull request #3078 from SteadEXE/patch-1

fix: parse CPU value for progress component in monitoring dashboard
This commit is contained in:
Mauricio Siu
2025-12-02 20:22:58 -06:00
committed by GitHub
@@ -10,7 +10,7 @@ import { DockerNetworkChart } from "./docker-network-chart";
const defaultData = { const defaultData = {
cpu: { cpu: {
value: 0, value: "0%",
time: "", time: "",
}, },
memory: { memory: {
@@ -46,7 +46,7 @@ interface Props {
} }
export interface DockerStats { export interface DockerStats {
cpu: { cpu: {
value: number; value: string;
time: string; time: string;
}; };
memory: { memory: {
@@ -220,7 +220,13 @@ export const ContainerFreeMonitoring = ({
<span className="text-sm text-muted-foreground"> <span className="text-sm text-muted-foreground">
Used: {currentData.cpu.value} Used: {currentData.cpu.value}
</span> </span>
<Progress value={currentData.cpu.value} className="w-[100%]" /> <Progress
value={Number.parseInt(
currentData.cpu.value.replace("%", ""),
10,
)}
className="w-[100%]"
/>
<DockerCpuChart acummulativeData={acummulativeData.cpu} /> <DockerCpuChart acummulativeData={acummulativeData.cpu} />
</div> </div>
</CardContent> </CardContent>