summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJosh Frye <joshfng@gmail.com>2016-06-23 10:37:20 -0400
committerJosh Frye <joshfng@gmail.com>2016-06-28 21:35:42 -0400
commit13ba3bd4fdaa59b2836efa907433d5e807ed5d5e (patch)
tree0151d7d986f640fbcaa2180d7faff647d08376cf /app
parent242aa5bd66038e5c7393f17be51a73deaedd7d06 (diff)
downloadgitlab-ce-13ba3bd4fdaa59b2836efa907433d5e807ed5d5e.tar.gz
Use number_to_human_size for system info and remove dependency on Filesize gem.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/system_info_controller.rb8
-rw-r--r--app/views/admin/system_info/show.html.haml4
-rw-r--r--app/views/layouts/nav/_admin.html.haml2
3 files changed, 7 insertions, 7 deletions
diff --git a/app/controllers/admin/system_info_controller.rb b/app/controllers/admin/system_info_controller.rb
index ab05ed2612a..b7333139c57 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_f('GB').round
- @mem_total = Filesize.from("#{system_info.memory.total_bytes} B").to_f('GB').round
+ @mem_used = system_info.memory.active_bytes
+ @mem_total = system_info.memory.total_bytes
- @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
+ @disk_used = system_info.disks[0].used_bytes
+ @disk_total = system_info.disks[0].total_bytes
end
end
diff --git a/app/views/admin/system_info/show.html.haml b/app/views/admin/system_info/show.html.haml
index 316a94f4d41..542498cfb22 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}GB / #{@mem_total}GB"
+ %h1= "#{number_to_human_size(@mem_used)} / #{number_to_human_size(@mem_total)}"
.col-sm-4
.light-well
%h4 Disk
.data
- %h1= "#{@disk_used}GB / #{@disk_total}GB"
+ %h1= "#{number_to_human_size(@disk_used)} / #{number_to_human_size(@disk_total)}"
diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml
index e6c5ec06252..5ee8772882e 100644
--- a/app/views/layouts/nav/_admin.html.haml
+++ b/app/views/layouts/nav/_admin.html.haml
@@ -10,7 +10,7 @@
%span
Overview
= nav_link(controller: %w(system_info background_jobs logs health_check)) do
- = link_to admin_background_jobs_path, title: 'Monitoring' do
+ = link_to admin_system_info_path, title: 'Monitoring' do
%span
Monitoring
= nav_link(controller: :broadcast_messages) do