From 2e27c45bbef9a6707c8cbf67c998be1fb83d1eea Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 25 Dec 2022 00:23:53 +0100 Subject: [PATCH] move sidekiq panel into separate partial --- app/views/admin/dashboard/_sidekiq.html.haml | 26 +++++++++++++++++++ app/views/admin/dashboard/index.html.haml | 27 +------------------- 2 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 app/views/admin/dashboard/_sidekiq.html.haml diff --git a/app/views/admin/dashboard/_sidekiq.html.haml b/app/views/admin/dashboard/_sidekiq.html.haml new file mode 100644 index 00000000..c937154d --- /dev/null +++ b/app/views/admin/dashboard/_sidekiq.html.haml @@ -0,0 +1,26 @@ +.card + .card-header + %a.d-flex{ href: sidekiq_web_path } + %strong Sidekiq + %i.fa.fa-chevron-right.ml-auto.align-self-center + - unless @sidekiq[:processes].count.positive? + .card-body.bg-danger.text-light + %strong There are no Sidekiq processes running. + Background jobs will not be processed. + %br + To fix this, run + %tt RAILS_ENV=#{Rails.env} bundle exec sidekiq + + .list-group + .list-group-item.d-flex + %span Processes + %span.ml-auto= @sidekiq[:processes].count + .list-group-item.d-flex + %span Enqueued + %span.ml-auto= @sidekiq[:stats].enqueued + .list-group-item.d-flex + %span Retries + %span.ml-auto= @sidekiq[:stats].retry_size + .list-group-item.d-flex + %span Dead + %span.ml-auto= @sidekiq[:stats].dead_size diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 6957a87b..a6422046 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -1,30 +1,5 @@ .row .col-sm-6 - .card - .card-header - %a.d-flex{ href: sidekiq_web_path } - %strong Sidekiq - %i.fa.fa-chevron-right.ml-auto.align-self-center - - unless @sidekiq[:processes].count.positive? - .card-body.bg-danger.text-light - %strong There are no Sidekiq processes running. - Background jobs will not be processed. - %br - To fix this, run - %tt RAILS_ENV=#{Rails.env} bundle exec sidekiq - - .list-group - .list-group-item.d-flex - %span Processes - %span.ml-auto= @sidekiq[:processes].count - .list-group-item.d-flex - %span Enqueued - %span.ml-auto= @sidekiq[:stats].enqueued - .list-group-item.d-flex - %span Retries - %span.ml-auto= @sidekiq[:stats].retry_size - .list-group-item.d-flex - %span Dead - %span.ml-auto= @sidekiq[:stats].dead_size + = render "admin/dashboard/sidekiq" - parent_layout "admin"