%# (C) COPYRIGHT HELP/SYSTEMS, L.L.C. 2009 %>
<% tbarSettings = ""
tbarSettings << %Q~
tbar="{items: [
{
text: '#{t("agents.agent.update_all_agents")}',
actsOn: 'none',
ajaxRequest: true,
confirmText: '#{t("agents.agent.update_all_agents_confirm")}',
method: 'POST',
actionUrl: '#{update_all_agents_agents_path()}'
}, {xtype: 'tbfill'},
~
tbarSettings << %Q~
{
cls: '',
text: '#{ t_label("common.status") + " " + (all_agents_on_hold ? t("home.current_status.locked_label"): t("home.current_status.released"))}',
actsOn: 'none',
xtype: 'tbtext',
usePopup: false
},' ',{
text: '#{ all_agents_on_hold ? t("agents.agent.release_job_queues") : t("agents.agent.hold-job-queues")}',
actsOn: 'none',
ajaxRequest: true,
confirmText: '#{ all_agents_on_hold ? t("agents.agent.release_job_queues_confirm") : t("agents.agent.hold-job-queues_confirm")}',
method: 'POST',
actionUrl: '#{ all_agents_on_hold ? toggle_job_queues_agents_path(:hold => false) : toggle_job_queues_agents_path(:hold => true)}'
}
~
tbarSettings << ']}"' %>
"
helpUrl="<%=help_link(HELP_URL_CONFIG['agents']['agent_manager'])%>"
region="center"
lazyRender="true"
dojoType="helpsys.ext.LiveGrid"
authenticity_token="<%= form_authenticity_token %>"
dataColumns="[
{ name: 'id'},
{ name: 'status' },
{ name: 'agent_name'},
{ name: 'description'},
{ name: 'operating_system'},
{ name: 'time_zone'},
{ name: 'jobs_on_queues'},
{ name: 'active_jobs'},
{ name: 'queues_locked'},
{ name: 'version'}
]"
customDelete="true"
includeAutoRefresh="true"
editPath="<%= edit_agent_path(-1) %>"
editInPopup="false"
deletePath="<%= agent_path(-1) %>"
autoFill="false"
forceFit="false"
layout="fit"
autoExpandColumn="agentsGridDescription"
gridColumns="[
{dataIndex: 'status', header: '<%= t("common.status") %>', id: 'agentsRuntimeState',
locked: true, sortable: true, width: 100, filter: true, filterType: 'list', filterList: <%= "[[1, '#{t('common.active')}'],[2, '#{t('common.inactive')}'],[3, '#{t('common.failed')}'],[0, '#{t('common.unknown')}']]" %>},
{dataIndex: 'agent_name', header: '<%= t("common.name") %>', id: 'agentsGridName',
locked: false, sortable: true, width: 175, filter: true, filterType: 'string'},
{dataIndex: 'description', header: '<%= t("common.description") %>', id: 'agentsGridDescription',
locked: false, sortable: true, width: 150, filter: true, filterType: 'string'},
{dataIndex: 'operating_system', header: '<%= t("common.operating_system") %>', id: 'agentsGridOperating_system',
locked: false, sortable: true, width: 130, filter: true, filterType: 'string'},
{dataIndex: 'version', header: '<%= t("agents.product_rel_mod") %>', id: 'agentsGridVersion',
locked: false, sortable: true, width: 130, filter: false},
{dataIndex: 'time_zone', header: '<%= t("agents.timezone") %>', id: 'agentsGridTime_zone',
locked: false, sortable: true, width: 100, filter: true, filterType: 'string', hidden: true},
{dataIndex: 'jobs_on_queues', header: '<%= t(".jobs_on_queues") %>', id: 'agentsGridJobsOnQueues',
locked: false, sortable: false, width: 100},
{dataIndex: 'active_jobs', header: '<%= t(".active_jobs") %>', id: 'agentsGridActiveJobs',
locked: false, sortable: false, width: 90},
{dataIndex: 'queues_locked', header: '<%= t(".queues_locked") %>', id: 'agentsGridQueuesLocked',
locked: false, sortable: true, width: 100, filterType: 'boolean', yesText: '<%= t('common.key_yes') %>', noText: '<%= t('common.key_no') %>'}
]"
includeDelete="true"
includeEdit="true"
includeShow="true"
includeTagFilter="true"
tagMatchAnyDefault="<%= match_any_default %>"
itemType='<%= t('common.job') %>'
menuCfg="{items: [{
iconCls: 'icon_edit',
text: '<%=t ".edit_agent" %>',
actsOn: 'one',
actionUrl: '<%= edit_agent_path(-1) %>'
},{
iconCls: 'icon_delete',
text: '<%=t(".delete_agent")%>',
actsOn: 'one',
customDelete: true,
method: 'DELETE',
actionUrl: '<%= agent_path(-1) %>',
ajaxRequest: true,
confirmText: '<%=t ".delete_confirmation" %>'
},{
iconCls: 'icon_audit',
text: '<%=t "common.show_audit_changes" %>',
actsOn: 'one',
actionUrl: '<%= audits_path(:auditable_id => -1, :auditable_type => 'Agent') %>'
},{
iconCls: 'icon_whereused',
text: '<%= t("common.where_used") %>',
actsOn: 'one',
actionUrl: '<%= whereused_agent_path(-1) %>'
}, {
iconCls: '',
text: '<%= t(".replace") %>',
actsOn: 'one',
actionUrl: '<%= replace_agent_agent_path(-1) %>'
}, '-', {
iconCls: 'icon_stop',
text: '<%= t(".stop_agent") %>',
actsOn: 'one',
method: 'POST',
actionUrl: '<%= stop_agent_path(-1) %>',
ajaxRequest: true,
confirmText: '<%= t(".stop_agent_confirm") %>'
}, {
iconCls: 'icon_restart',
text: '<%= t(".restart_agent") %>',
actsOn: 'one',
method: 'POST',
actionUrl: '<%= restart_agent_path(-1) %>',
ajaxRequest: true,
confirmText: '<%= t(".restart_agent_confirm") %>'
}, '-', {
iconCls: 'icon_job_history',
text: '<%=t "common.history" %>',
menu: {
items: [{
iconCls: '',
text: '<%=t "application.agent_event_histories" %>',
actsOn: 'one',
actionUrl: '<%= agent_event_histories_path(:target_id => -1, :target_type => Agent.to_s) %>',
usePopup: false
},{
iconCls: '',
text: '<%=t ".job_history_all_jobs" %>',
actsOn: 'one',
actionUrl: '<%= job_histories_path(:agent_id => -1) %>',
usePopup: false
},{
iconCls: '',
text: '<%=t ".job_history_active_jobs" %>',
actsOn: 'one',
actionUrl: '<%= job_histories_path(:agent_id => -1, :job_status => "active") %>',
usePopup: false
},{
iconCls: '',
text: '<%=t "common.server_history" %>',
actsOn: 'one',
actionUrl: '<%= schedule_logs_path(:agent_id => -1) %>',
usePopup: false
}]
}
}, '-', {
iconCls: 'icon_job',
text: '<%=t ".display_jobs" %>',
actsOn: 'one',
actionUrl: '<%= jobs_path(:agent_id => -1) %>'
}, {
iconCls: 'icon_display_agent_event_monitors',
text: '<%=t ".display_agent_event_monitors" %>',
actsOn: 'one',
actionUrl: '<%= agent_event_monitors_path(:agent_id=>-1) %>'
}, '-', {
iconCls: '',
text: '<%=t ".view_agent_queues" %>',
actsOn: 'one',
actionUrl: '<%= job_queues_path(:agent_id=>-1) %>'
},{
iconCls: '',
text: '<%=t ".lock_agent_queues" %>',
actsOn: 'one',
method: 'POST',
actionUrl: '<%= lock_agent_queues_agent_path(-1) %>',
ajaxRequest: true,
confirmText: '<%=t ".lock_agent_queue_confirm" %>'
},{
iconCls: '',
text: '<%=t ".unlock_agent_queues" %>',
actsOn: 'one',
method: 'POST',
actionUrl: '<%= unlock_agent_queues_agent_path(-1) %>',
ajaxRequest: true,
confirmText: '<%=t ".unlock_agent_queue_confirm" %>'
}, '-',{
text: '<%=t "agents.view_diag_log" %>',
actsOn: 'one',
actionUrl: '<%= diagnostic_log_index_path(:type => "agent", :id => -1) %>'
},{
text: '<%=t "agents.view_daig_page" %>',
actsOn: 'one',
hrefTarget: '_blank',
actionUrl: '<%= diag_page_agent_path(:id => -1) %>'
}, '-', {
iconCls: 'icon_update_agent',
text: '<%=t ".update_agent" %>',
actsOn: 'one',
actionUrl: '<%= update_agent_agent_path(:id=>-1) %>',
usePopup: true
},{
text: '<%=t "agents.view_update_log" %>',
actsOn: 'one',
actionUrl: '<%= diagnostic_log_index_path(:type => "agent_update", :id => -1) %>'
}]}"
sortField="{field: 'agent_name', direction: 'ASC'}"
<%= tbarSettings %>
url="<%= agents_path(:format => 'json') %>" style="height:100%;">