summaryrefslogtreecommitdiff
path: root/app/views/admin/runners
diff options
context:
space:
mode:
authorAlexis Reigel <alexis.reigel.ext@siemens.com>2018-06-08 13:26:41 +0200
committerAlexis Reigel <alexis.reigel.ext@siemens.com>2018-08-20 17:15:11 +0200
commit16d12491c538121a4634ae69403cd66497bee82a (patch)
tree99c54aff76f92e4272088e46ac6f20ae419e4547 /app/views/admin/runners
parentbbc305b1a24785d780fe0672d9e49f2c53af463b (diff)
downloadgitlab-ce-16d12491c538121a4634ae69403cd66497bee82a.tar.gz
add status filter to admin runners page
Diffstat (limited to 'app/views/admin/runners')
-rw-r--r--app/views/admin/runners/_statuses.html.haml13
-rw-r--r--app/views/admin/runners/index.html.haml18
2 files changed, 24 insertions, 7 deletions
diff --git a/app/views/admin/runners/_statuses.html.haml b/app/views/admin/runners/_statuses.html.haml
new file mode 100644
index 00000000000..4e91b6be6c4
--- /dev/null
+++ b/app/views/admin/runners/_statuses.html.haml
@@ -0,0 +1,13 @@
+- active_status = params[:status].presence
+
+- toggle_text = 'Status'
+- if active_status
+ = hidden_field_tag :status, params[:status]
+ - toggle_text = params[:status].titleize
+
+= dropdown_tag(toggle_text, options: { wrapper_class: 'dropdown-menu-selectable', title: 'Statuses' }) do
+ %ul
+ %li= link_to 'Any Status', admin_runners_path(safe_params.slice(:search)), class: ('is-active' unless active_status)
+ %li.divider
+ - Ci::Runner::AVAILABLE_STATUSES.each do |status|
+ %li= link_to status.titleize, admin_runners_path(safe_params.slice(:search).merge(status: status)), class: ('is-active' if active_status == status)
diff --git a/app/views/admin/runners/index.html.haml b/app/views/admin/runners/index.html.haml
index 9280ff4d478..81dfc23641b 100644
--- a/app/views/admin/runners/index.html.haml
+++ b/app/views/admin/runners/index.html.haml
@@ -42,14 +42,18 @@
locals: { registration_token: Gitlab::CurrentSettings.runners_registration_token }
.append-bottom-20.clearfix
- .float-left
- = form_tag admin_runners_path, id: 'runners-search', class: 'form-inline', method: :get do
- .form-group
- = search_field_tag :search, params[:search], class: 'form-control input-short', placeholder: 'Runner description or token', spellcheck: false
- = submit_tag 'Search', class: 'btn'
+ = form_tag admin_runners_path, id: 'runners-search', method: :get do
+ .float-left
+ .form-inline
+ .form-group
+ = search_field_tag :search, params[:search], class: 'form-control input-short', placeholder: 'Runner description or token', spellcheck: false
+ = submit_tag 'Search', class: 'btn'
+
+ .float-left.prepend-left-10
+ = render 'statuses'
- .float-right.light
- Runners currently online: #{@active_runners_cnt}
+ .float-right.light
+ Runners currently online: #{@active_runners_cnt}
%br