Skip to content

Commit

Permalink
feat: display memory size using binary units
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Mar 21, 2024
1 parent e2ea86a commit 7098efe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<br/>
Total Logical Cores: {{status.by_arch && status.by_arch[arch].total_logical_cores}}
<br/>
Total Memory: {{status.by_arch && prettyBytes(Number(status.by_arch[arch].total_memory_bytes))}}
Total Memory: {{status.by_arch && prettyBytes(Number(status.by_arch[arch].total_memory_bytes), { binary: true })}}
<br/>
Total Jobs: {{status.by_arch && status.by_arch[arch].total_job_count}}
<br/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/workers/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<br/>
Git commit: {{ worker.git_commit }}
<br/>
Memory size: {{ worker.memory_bytes !== undefined && prettyBytes(worker.memory_bytes) }}
Memory size: {{ worker.memory_bytes !== undefined && prettyBytes(worker.memory_bytes, { binary: true }) }}
<br/>
Disk free space size: {{ worker.disk_free_space_bytes !== undefined && prettyBytes(worker.disk_free_space_bytes) }}
<br/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/workers/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
{ title: 'Hostname', key: 'hostname', sortable: false },
{ title: 'Architecture', key: 'arch', sortable: false },
{ title: 'Logical Cores', key: 'logical_cores', sortable: false },
{ title: 'Memory Size', key: 'memory_bytes', sortable: false, value: (item: any) => prettyBytes(item.memory_bytes) },
{ title: 'Memory Per Core', key: 'memory_per_core', sortable: false, value: (item: any) => prettyBytes(item.memory_bytes / item.logical_cores) },
{ title: 'Memory Size', key: 'memory_bytes', sortable: false, value: (item: any) => prettyBytes(item.memory_bytes, { binary: true }) },
{ title: 'Memory Per Core', key: 'memory_per_core', sortable: false, value: (item: any) => prettyBytes(item.memory_bytes / item.logical_cores, { binary: true }) },
{ title: 'Disk Free Space Size', key: 'disk_free_space_bytes', sortable: false, value: (item: any) => prettyBytes(item.disk_free_space_bytes) },
{ title: 'Status', key: 'status', sortable: false },
],
Expand Down

0 comments on commit 7098efe

Please sign in to comment.