Commit 88519e90 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Refactor and restyle Admin#background_jobs page

parent 9f31fbc9
class Admin::BackgroundJobsController < Admin::ApplicationController class Admin::BackgroundJobsController < Admin::ApplicationController
def show def show
@sidekiq_processes = `ps -U #{Settings.gitlab.user} -o euser,pid,pcpu,pmem,stat,start,command | grep sidekiq | grep -v grep`
end end
end end
%h3.page-title Background Jobs %h3.page-title Background Jobs
%br %p.light GitLab use #{link_to "sidekiq", "http://sidekiq.org/"} library for async job processing
%hr
.ui-box .ui-box
%iframe{src: sidekiq_path, width: '100%', height: 900, style: "border: none"} .title Sidekiq running processes
%h4 Sidekiq running processes .ui-box-body
- sidekiq_processes = `ps -U #{Settings.gitlab.user} -o euser,pid,pcpu,pmem,stat,start,command | grep sidekiq | grep -v grep` - if @sidekiq_processes.empty?
- if sidekiq_processes.empty? %h4.cred
%b There are no running sidekiq processes %i.icon-warning-sign
%b Please restart GitLab There are no running sidekiq processes. Please restart GitLab
- else - else
.ui-box %table.table
%table.zebra-striped
%thead %thead
%th USER %th USER
%th %th
...@@ -25,7 +27,7 @@ ...@@ -25,7 +27,7 @@
%th %th
%th COMMAND %th COMMAND
%th %th
- sidekiq_processes.split("\n").each do |process| - @sidekiq_processes.split("\n").each do |process|
- next unless process.match(/(sidekiq \d+\.\d+\.\d+.+$)/) - next unless process.match(/(sidekiq \d+\.\d+\.\d+.+$)/)
- data = process.gsub!(/\s+/m, '|').strip.split('|') - data = process.gsub!(/\s+/m, '|').strip.split('|')
%tr %tr
...@@ -33,6 +35,16 @@ ...@@ -33,6 +35,16 @@
%td= data.shift %td= data.shift
%td %td
%td= data.join(" ") %td= data.join(" ")
%b If '[25 of 25 busy]' is shown, restart GitLab with 'sudo service gitlab reload'.
%br .clearfix
%b If more than one sidekiq process is listed, stop GitLab, kill the remaining sidekiq processes (sudo pkill -u #{Settings.gitlab.user} -f sidekiq) and restart GitLab. %p
%i.icon-exclamation-sign
If '[25 of 25 busy]' is shown, restart GitLab with 'sudo service gitlab reload'.
%p
%i.icon-exclamation-sign
If more than one sidekiq process is listed, stop GitLab, kill the remaining sidekiq processes (sudo pkill -u #{Settings.gitlab.user} -f sidekiq) and restart GitLab.
.ui-box
%iframe{src: sidekiq_path, width: '100%', height: 900, style: "border: none"}
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