Skip to content

Commit

Permalink
fix(ui): chart consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Sep 26, 2023
1 parent 2f8bd01 commit 8c52786
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/QuickStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ export function QuickStats(props: Props) {
<div className="stat">
<span className="stat-big">{bytesToReadable(memoryUse)}</span>
<span className="stat-small">{
(memoryUse / props.sysinfo.mem_size * 100).toFixed(2)
((memoryUse / props.sysinfo.mem_size * 100) || 0).toFixed(2)
}% of total memory ({bytesToReadable(props.sysinfo.mem_size)})</span>
</div>

<div className="stat">
<span className="stat-big">{bytesToReadable(swapUse)}</span>
<span className="stat-small">{
(swapUse / props.sysinfo.swap_size * 100).toFixed(2)
((swapUse / props.sysinfo.swap_size * 100) || 0).toFixed(2)
}% of total swap ({bytesToReadable(props.sysinfo.swap_size)})</span>
</div>

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/pages/Home/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export function DataHome(props: Props) {
)}
xLabel="Time"
yLabel="Memory Usage (MB)"
max={sysinfo.mem_size / 1024 / 1024}
min={0}
datasets={[
{
data: memoryData.map((v) => {
Expand Down Expand Up @@ -126,6 +128,7 @@ export function DataHome(props: Props) {
)}
xLabel="Time"
yLabel="Network Usage (MB)"
min={0}
datasets={Object.keys(networkData).map((network, i) => {
return {
data: networkData[network].map((v) => {
Expand Down

0 comments on commit 8c52786

Please sign in to comment.