mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
Add column with default sort to prioritize new Agents in the index view
This commit is contained in:
parent
a025923c3c
commit
7476d7dcf1
2 changed files with 5 additions and 1 deletions
|
@ -4,7 +4,7 @@ class AgentsController < ApplicationController
|
|||
include SortableTable
|
||||
|
||||
def index
|
||||
set_table_sort sorts: %w[name last_check_at last_event_at last_receive_at], default: { name: :asc }
|
||||
set_table_sort sorts: %w[name created_at last_check_at last_event_at last_receive_at], default: { created_at: :desc }
|
||||
|
||||
@agents = current_user.agents.preload(:scenarios, :controllers).reorder(table_sort).page(params[:page])
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<table class='table table-striped'>
|
||||
<tr>
|
||||
<th><%= sortable_column 'name', 'asc' %></th>
|
||||
<th><%= sortable_column 'created_at', 'desc', name: 'Age' %></th>
|
||||
<th>Schedule</th>
|
||||
<th><%= sortable_column 'last_check_at', name: 'Last Check' %></th>
|
||||
<th><%= sortable_column 'last_event_at', name: 'Last Event Out' %></th>
|
||||
|
@ -23,6 +24,9 @@
|
|||
</span>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class='<%= "agent-unavailable" if agent.unavailable? %>'>
|
||||
<%= time_ago_in_words agent.created_at %>
|
||||
</td>
|
||||
<td class='<%= "agent-unavailable" if agent.unavailable? %>'>
|
||||
<% if agent.can_be_scheduled? %>
|
||||
<%= agent_schedule(agent, ',<br/>') %>
|
||||
|
|
Loading…
Add table
Reference in a new issue