<%# (C) COPYRIGHT HELP/SYSTEMS, L.L.C. 2015 %>
title="<%= t("#{controller.controller_name}.page_title") + ' » ' + "#{@PAGE_TITLE_LIMIT}" %>" baseParameters="{ agent_id: '<%= h params[:agent_id] %>', tag: '<%= params[:tag] %>' }" <% else lockConfText = all_agents_on_hold ? t("agents.agent.release_job_queues_confirm") : t("agents.agent.hold-job-queues_confirm") %> title="<%= t("#{controller.controller_name}.page_title") %>" baseParameters="{ tag: '<%= params[:tag] %>' }" <% end %> helpUrl="<%= help_link(HELP_URL_CONFIG['job_queues']['home']) %>" cls="full-page-grid" customDelete="true" helpUrl="" region="center" lazyRender="true" layout="fit" forceFit="false" dojoType="helpsys.ext.LiveGrid" autoExpandColumn="job_queuesGridDescription" authenticity_token="<%= form_authenticity_token %>" dataColumns="[{name: 'id'}, {name: 'status'},{name: 'name'},{name: 'description'},{name: 'agent'},{name: 'agent_status'},{name: 'jobs_on_queue'},{name: 'active_jobs'},{name: 'max_active_jobs'},{name: 'limiter_minimum_priority'},{name: 'limiter_max_active'}, {name: 'limiter_enabled'}, {name: 'max_active_per_agent'},{name: 'hold_on_failure'}]" deletePath="<%= job_queue_path(-1) %>" editPath="<%= edit_job_queue_path(-1) %>" editInPopup="false" gridColumns="[ {dataIndex: 'status', header: '<%= t('common.status') %>', id: 'job_queuesGridStatus', locked: false, sortable: false, width: 100, filter: false, filterType: 'boolean'}, {dataIndex: 'name', header: '<%= t('common.name') %>', id: 'job_queuesGridName', locked: true, sortable: true, width: 120, filter: true, filterType: 'string'}, {dataIndex: 'description', header: '<%= t('common.description') %>', id: 'job_queuesGridDescription', locked: true, sortable: true, width: 120, filter: true, filterType: 'string'}, {dataIndex: 'agent', header: '<%= t('common.agent') %>', id: 'job_queuesGridAgent', locked: true, sortable: true, width: 150, filter: true, filterType: 'string'}, {dataIndex: 'agent_status', header: '<%= t('common.agent_status') %>', id: 'job_queuesGridAgentStatus', 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: 'jobs_on_queue', header: '<%= t('job_queues.index.jobs_on_queue') %>', id: 'job_queuesGridJobsOnQueue', width: 100, locked: true, sortable: false,}, {dataIndex: 'active_jobs', header: '<%= t('job_queues.index.active_jobs') %>', id: 'job_queuesGridActiveJobs', locked: true, sortable: false, width: 90}, {dataIndex: 'max_active_jobs', header: '<%= t('job_queues.index.max_active_jobs') %>', id: 'job_queuesGridMaxActiveJobs', locked: false, sortable: false, width: 90}, {dataIndex: 'priority_limit', header: '<%= t('job_queues.index.priority_limit_max') %>', id: 'job_queuesGridPriorityLimit', locked: false, sortable: false, width: 90, filter: false, filterType: 'string', renderer: controller.getPriorityLimit}, {dataIndex: 'max_active_per_agent', header: '<%= t('job_queues.index.max_active_per_agent') %>', id: 'job_queuesGridMaxActivePerAgent', locked: false, sortable: false, width: 90, filter: false, filterType: 'string'}, {dataIndex: 'hold_on_failure', header: '<%= t ('field_names.hold_on_failure') %>', id: 'job_queuesGridHoldOnFailure', locked: true, sortable: true, width: 100, filter: true, xtype: 'booleancolumn', filterType: 'boolean', trueText: '<%= t('common.key_yes') %>', falseText: '<%= t('common.key_no') %>', yesText: '<%= t('common.key_yes') %>', noText: '<%= t('common.key_no') %>' } ]" restoreURLs="<%= hold_multiple_job_queues_path(:format => :json) %>, <%= release_multiple_job_queues_path(:format => :json) %>" includeAutoRefresh="true" <%# {preferences button}%> includeDelete="true" includeEdit="true" includeShow="true" includeTagFilter="true" tagMatchAnyDefault="<%= match_any_default %>" menuCfg="{ items:[ { iconCls: 'icon_edit', text: '<%= t ".edit_job_queue" %>', actsOn: 'one', actionUrl: '<%= edit_job_queue_path(-1) %>' },{ iconCls: 'icon_copy', text: '<%= t ".copy_job_queue" %>', actsOn: 'one', actionUrl: '<%= copy_job_queue_path(-1) %>' },{ iconCls: 'icon_delete', text: '<%= t ".delete_job_queue" %>', actsOn: 'one', customDelete: true, method: 'DELETE', actionUrl: '<%= job_queue_path(-1) %>', ajaxRequest: true, confirmText: '<%= t ".delete_confirmation" %>' },'-',{ text: '<%= t(".view_job_queue_schedule") %>', actsOn: 'one', actionUrl: '<%= job_queue_job_queue_schedule_entries_path(:job_queue_id => -1) %>', usePopup: false },'-', { iconCls: 'icon_export', text: '<%= t ".export_job_queue" %>', actsOn: 'many', method: 'EXPORT', customAction: true, hideLoadWindow: true, handler: function(){window.exportController.openExportPopup.call(exportController)} },{ iconCls: 'icon_audit', text: '<%= t "common.show_audit_changes" %>', actsOn: 'one', actionUrl: '<%= audits_path(:auditable_id => -1, :auditable_type => 'JobQueue') %>' },{ iconCls: 'icon_whereused', text: '<%= t("common.where_used") %>', actsOn: 'one', actionUrl: '<%= whereused_job_queue_path(-1) %>' },'-',{ iconCls: 'icon_job_history', text: '<%= t "common.history" %>', menu: { items: [ { text: '<%= t(".job_history_all_jobs") %>', actsOn: 'one', actionUrl: '<%= job_histories_path(:job_queue_id => -1) %>' },{ text: '<%= t(".job_history_active_jobs") %>', actsOn: 'one', actionUrl: '<%= job_histories_path(:job_queue_id => -1, :job_status => "active") %>', usePopup: false }] } },'-',{ text: '<%= t(".display_jobs") %>', actsOn: 'one', actionUrl: '<%= jobs_path(:job_queue_id => -1) %>', usePopup: false }, '-', { iconCls: 'icon_display_jobq', text: '<%= t ".display_job_queue" %>', actsOn: 'one', actionUrl: '<%= job_queue_job_queue_entries_path(:job_queue_id => -1) %>' },{ iconCls: 'icon_hold_jobq', text: '<%= t ".hold_job_queue" %>', actsOn: 'many', actionId: 'hold_job_queue', method: 'POST', customAction: true, actionUrl: '<%= hold_queue_job_queue_path(-1) %>', ajaxRequest: true, confirmText: '<%= t ".hold_job_queue_confirm" %>' },{ iconCls: 'icon_release_jobq', text: '<%= t ".release_job_queue" %>', actsOn: 'many', actionId: 'release_job_queue', method: 'POST', customAction: true, actionUrl: '<%= release_queue_job_queue_path(-1) %>', ajaxRequest: true, confirmText: '<%= t ".release_job_queue_confirm" %>' }] }" sortField="{field: 'name', direction: 'ASC'}" tbar="{items: [ { iconCls: 'icon_create', text: '<%= t("job_queues.index.create_job_queue") %>', actionUrl: '<%= new_job_queue_path %>', actsOn: 'many' }, { xtype: 'tbfill' }, { 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: 'many', ajaxRequest: true, method: 'POST', confirmText: '<%= lockConfText.html_safe %>', actionUrl: '<%= all_agents_on_hold ? toggle_agent_job_queues_job_queues_path(:hold => false, :agent_id => params[:agent_id]) : toggle_agent_job_queues_job_queues_path(:hold => true, :agent_id => params[:agent_id]) %>' } ]}" url="<%= job_queues_path(:format => 'json') %>" style="height:100%;">