Skip to content
Snippets Groups Projects
Commit 6aff4984 authored by Takuya Noguchi's avatar Takuya Noguchi
Browse files

Add sort runners on admin runners

parent 2828b768
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2,7 +2,8 @@ class Admin::RunnersController < Admin::ApplicationController
before_action :runner, except: :index
 
def index
@runners = Ci::Runner.order('id DESC')
sort = params[:sort] == 'contacted_asc' ? { contacted_at: :asc } : { id: :desc }
@runners = Ci::Runner.order(sort)
@runners = @runners.search(params[:search]) if params[:search].present?
@runners = @runners.page(params[:page]).per(30)
@active_runners_cnt = Ci::Runner.online.count
Loading
Loading
Loading
Loading
@@ -63,7 +63,7 @@
%th Projects
%th Jobs
%th Tags
%th Last contact
%th= link_to 'Last contact', admin_runners_path(params.slice(:search).merge(sort: 'contacted_asc'))
%th
 
- @runners.each do |runner|
Loading
Loading
---
title: Add sort runners on admin runners
merge_request: 14661
author: Takuya Noguchi
type: added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment