Skip to content

Commit

Permalink
Refactor dashboard component to format memory and CPU usage values to…
Browse files Browse the repository at this point in the history
… two decimal places
  • Loading branch information
EliasDeHondt committed Feb 26, 2025
1 parent 8ee4d76 commit 725b358
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions App/Frontend/src/app/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { SpiderWebComponent } from "../spider-web/spider-web.component";
})

export class DashboardComponent implements AfterViewInit, OnInit {
// Fullscreen button
// Fullscreen button
@ViewChild('dashboardMain') dashboardMain!: ElementRef;
@ViewChild('dashboardTitle') dashboardTitle!: ElementRef;

Expand Down Expand Up @@ -100,10 +100,10 @@ export class DashboardComponent implements AfterViewInit, OnInit {

updateChartData(): void {
this.memoryChartData = [
{ name: 'Used', value: this.usage.MemUsage },
{ name: 'Used', value: parseFloat(this.usage.MemUsage.toFixed(2)) },
];
this.cpuChartData = [
{ name: 'Used', value: this.usage?.CpuUsage || 0 },
{ name: 'Used', value: parseFloat((this.usage?.CpuUsage || 0).toFixed(2)) },
];
this.diskUsagePercentage = (this.usage.DiskUsage / this.usage.DiskCapacity) * 100;

Expand Down

0 comments on commit 725b358

Please sign in to comment.