diff options
author | Josh Frye <joshfng@gmail.com> | 2016-06-23 08:52:19 -0400 |
---|---|---|
committer | Josh Frye <joshfng@gmail.com> | 2016-06-28 21:35:42 -0400 |
commit | 242aa5bd66038e5c7393f17be51a73deaedd7d06 (patch) | |
tree | 47118e033c15481efb73c8523e028a8a57617688 | |
parent | a8cf89a78c7fbcfc0a32b11f2ff4a33e2ecebb38 (diff) | |
download | gitlab-ce-242aa5bd66038e5c7393f17be51a73deaedd7d06.tar.gz |
Round figures for system info
-rw-r--r-- | app/controllers/admin/system_info_controller.rb | 8 | ||||
-rw-r--r-- | app/views/admin/system_info/show.html.haml | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/admin/system_info_controller.rb b/app/controllers/admin/system_info_controller.rb index a548f941dc5..ab05ed2612a 100644 --- a/app/controllers/admin/system_info_controller.rb +++ b/app/controllers/admin/system_info_controller.rb @@ -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 diff --git a/app/views/admin/system_info/show.html.haml b/app/views/admin/system_info/show.html.haml index 2a1fac6e48b..316a94f4d41 100644 --- a/app/views/admin/system_info/show.html.haml +++ b/app/views/admin/system_info/show.html.haml @@ -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" |