Skip to content

Commit

Permalink
Fixes exclusion buttons shown on unsupported alerts
Browse files Browse the repository at this point in the history
Addresses #5212
  • Loading branch information
simonemainardi committed Apr 27, 2021
1 parent 16d5a31 commit 23dd9a0
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions httpdocs/templates/pages/alerts/alert-stats.template
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,19 @@

/* Actions Column */
columns.push({width: '5%', targets: -1, className: 'text-center', orderable: false, data: null, render: (type) => {
const buttons = [
/* Bell button to disable alerts is only supported for hosts and flows */
{% if alert_stats.entity == 'host' or alert_stats.entity == 'flow' then %}
{icon: 'fa-bell-slash', label: "{{ i18n('disable') }}", modal: '#alerts_filter_dialog', class: "btn-warning {{ ((alert_stats.entity == 'host' or alert_stats.entity == 'flow') and '' or 'disabled') }}"},
{% end %}

return DataTableUtils.createActionButtons([
/* Disable */
{icon: 'fa-bell-slash', label: "{{ i18n('disable') }}", modal: '#alerts_filter_dialog', class: "btn-warning {{ ((alert_stats.entity == 'host' or alert_stats.entity == 'flow') and '' or 'disabled') }}"},
/* Release */
// {icon: 'fas fa-unlock', label: "{{ i18n('show_alerts.release_alert_action') }}", modal: '#release_single_alert', class: 'btn-info'},
/* Delete */
{% if alert_stats.status ~= "engaged" then %}
{icon: 'fa fa-trash', label: "{{ i18n('remove') }}", modal: '#delete_alert_dialog', class: 'btn-danger'},
]);
{% end %}
];

return DataTableUtils.createActionButtons(buttons);
}});

return columns;
Expand Down Expand Up @@ -562,4 +566,4 @@
*/

});
</script>
</script>

0 comments on commit 23dd9a0

Please sign in to comment.