Commit 242aa5bd authored by Josh Frye's avatar Josh Frye

Round figures for system info

parent a8cf89a7
...@@ -3,10 +3,10 @@ class Admin::SystemInfoController < Admin::ApplicationController ...@@ -3,10 +3,10 @@ class Admin::SystemInfoController < Admin::ApplicationController
system_info = Vmstat.snapshot system_info = Vmstat.snapshot
@load = system_info.load_average.collect { |v| v.round(2) }.join(', ') @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_used = Filesize.from("#{system_info.memory.active_bytes} B").to_f('GB').round
@mem_total = Filesize.from("#{system_info.memory.total_bytes} B").to_s('GB') @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_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_s('GB') @disk_total = Filesize.from("#{system_info.disks[0].total_bytes} B").to_f('GB').round
end end
end end
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
.light-well .light-well
%h4 Memory %h4 Memory
.data .data
%h1= "#{@mem_used} / #{@mem_total}" %h1= "#{@mem_used}GB / #{@mem_total}GB"
.col-sm-4 .col-sm-4
.light-well .light-well
%h4 Disk %h4 Disk
.data .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