Skip to content
Snippets Groups Projects
Commit 242aa5bd authored by Josh Frye's avatar Josh Frye
Browse files

Round figures for system info

parent a8cf89a7
Branches
Tags
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
@@ -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"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment