diff options
author | Sean McGivern <sean@gitlab.com> | 2016-08-24 20:06:19 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-08-25 10:28:35 +0300 |
commit | 085e1f89f327ad4d679696fe4673d09e1840b236 (patch) | |
tree | 585a47ab6e78653692d249158cb0f689bdd573d3 /app/views/admin/system_info | |
parent | b2bf01f4c271be66e93ed6f4b48a1da4d50e558d (diff) |
Handle unavailable system info
For Linux with the grsecurity patches applied, paths in `/proc` may not
be readable, so handle those cases and show a message rather than
blowing up.
Diffstat (limited to 'app/views/admin/system_info')
-rw-r--r-- | app/views/admin/system_info/show.html.haml | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/views/admin/system_info/show.html.haml b/app/views/admin/system_info/show.html.haml index 6956e5ab795..7f3b95699db 100644 --- a/app/views/admin/system_info/show.html.haml +++ b/app/views/admin/system_info/show.html.haml @@ -9,12 +9,20 @@ .light-well %h4 CPU .data - %h1= "#{@cpus} cores" + - if @cpus + %h1= "#{@cpus.length} cores" + - else + %i.fa.fa-warning.text-warning + Unable to collect CPU info .col-sm-4 .light-well %h4 Memory .data - %h1= "#{number_to_human_size(@mem_used)} / #{number_to_human_size(@mem_total)}" + - if @memory + %h1= "#{number_to_human_size(@memory.active_bytes)} / #{number_to_human_size(@memory.total_bytes)}" + - else + %i.fa.fa-warning.text-warning + Unable to collect memory info .col-sm-4 .light-well %h4 Disks |