BigW Consortium Gitlab

Commit 242aa5bd by Josh Frye

Round figures for system info

parent a8cf89a7
......@@ -3,10 +3,10 @@ class Admin::SystemInfoController < Admin::ApplicationController
system_info = Vmstat.snapshot
@load = system_info.load_average.collect { |v| v.round(2) }.join(', ')
@mem_used = Filesize.from("#{system_info.memory.active_bytes} B").to_s('GB')
@mem_total = Filesize.from("#{system_info.memory.total_bytes} B").to_s('GB')
@mem_used = Filesize.from("#{system_info.memory.active_bytes} B").to_f('GB').round
@mem_total = Filesize.from("#{system_info.memory.total_bytes} B").to_f('GB').round
@disk_used = Filesize.from("#{system_info.disks[0].used_bytes} B").to_s('GB')
@disk_total = Filesize.from("#{system_info.disks[0].total_bytes} B").to_s('GB')
@disk_used = Filesize.from("#{system_info.disks[0].used_bytes} B").to_f('GB').round
@disk_total = Filesize.from("#{system_info.disks[0].total_bytes} B").to_f('GB').round
end
end
......@@ -14,9 +14,9 @@
.light-well
%h4 Memory
.data
%h1= "#{@mem_used} / #{@mem_total}"
%h1= "#{@mem_used}GB / #{@mem_total}GB"
.col-sm-4
.light-well
%h4 Disk
.data
%h1= "#{@disk_used} / #{@disk_total}"
%h1= "#{@disk_used}GB / #{@disk_total}GB"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment