Visual fixes into the alerts list

This commit is contained in:
Alejandro Gallardo Escobar 2015-06-16 17:53:27 +02:00
parent 5e026a03e1
commit 1905c8a038
2 changed files with 39 additions and 47 deletions

View File

@ -39,12 +39,13 @@ function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_st
global $config; global $config;
require_once ($config['homedir'] . "/include/functions_tags.php"); require_once ($config['homedir'] . "/include/functions_tags.php");
$table = new StdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters alert-status-filter';
$table->cellpadding = '0'; $table->cellpadding = '0';
$table->cellspacing = '0'; $table->cellspacing = '0';
if(defined('METACONSOLE')){ if (defined('METACONSOLE')) {
$table->class = 'databox_filters'; $table->class = 'databox_filters alert-status-filter';
$table->width = '96%'; $table->width = '96%';
$table->cellpadding = '0'; $table->cellpadding = '0';
$table->cellspacing = '0'; $table->cellspacing = '0';

View File

@ -319,11 +319,11 @@ $options_simple = array('offset' => $offset_simple,
'limit' => $config['block_size'], 'order' => $order); 'limit' => $config['block_size'], 'order' => $order);
$filter_alert = array(); $filter_alert = array();
if($filter_standby == 'standby_on') { if ($filter_standby == 'standby_on') {
$filter_alert['disabled'] = $filter; $filter_alert['disabled'] = $filter;
$filter_alert['standby'] = '1'; $filter_alert['standby'] = '1';
} }
else if($filter_standby == 'standby_off') { else if ($filter_standby == 'standby_off') {
$filter_alert['disabled'] = $filter; $filter_alert['disabled'] = $filter;
$filter_alert['standby'] = '0'; $filter_alert['standby'] = '0';
} }
@ -373,11 +373,11 @@ if ($pure) {
// Filter form // Filter form
if ($print_agent) { if ($print_agent) {
if(defined('METACONSOLE')){ if (defined('METACONSOLE')) {
ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, $tag_filter, true, $strict_user),__('Show Options'));; ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, $tag_filter, true, $strict_user), __('Show Options'));
} }
else{ else {
ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, $tag_filter, true, $strict_user),__('Alert control filter'), __('Toggle filter(s)')); ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, $tag_filter, true, $strict_user), __('Alert control filter'), __('Toggle filter(s)'));
} }
} }
@ -556,13 +556,8 @@ $table->data = array ();
$rowPair = true; $rowPair = true;
$iterator = 0; $iterator = 0;
foreach ($alerts['alerts_simple'] as $alert) { foreach ($alerts['alerts_simple'] as $alert) {
if ($rowPair) $row = ui_format_alert_row ($alert, $print_agent, $url, 'font-size: 7pt;');
$table->rowclass[$iterator] = 'rowPair'; $table->data[] = $row;
else
$table->rowclass[$iterator] = 'rowOdd';
$rowPair = !$rowPair;
array_push ($table->data, ui_format_alert_row ($alert, $print_agent, $url, 'font-size: 7pt;'));
} }
if (!empty ($table->data)) { if (!empty ($table->data)) {
@ -607,7 +602,8 @@ ui_require_jquery_file('cluetip');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready (function () {
$(document).ready (function () {
$("a.template_details").cluetip ({ $("a.template_details").cluetip ({
arrows: true, arrows: true,
attribute: 'href', attribute: 'href',
@ -615,32 +611,27 @@ $(document).ready (function () {
}).click (function () { }).click (function () {
return false; return false;
}); });
});
if ($('#ag_group').val() != 0) { $('table.alert-status-filter #ag_group').change (function () {
$("#tag_filter").css('display', 'none'); var strict_user = $("#text-strict_user_hidden").val();
$("#table2-0-4").css('display', 'none'); var is_meta = $("#text-is_meta_hidden").val();
}
});
if (($(this).val() != 0) && (strict_user != 0)) {
$('#ag_group').change (function (){ $("table.alert-status-filter #tag_filter").hide();
strict_user = $("#text-strict_user_hidden").val();
is_meta = $("#text-is_meta_hidden").val();
if (($("#ag_group").val() != 0) && (strict_user != 0)) {
$("#tag_filter").css('display', 'none');
if (is_meta) { if (is_meta) {
$("#table1-0-4").css('display', 'none'); $("table.alert-status-filter #table1-0-4").hide();
} else { } else {
$("#table2-0-4").css('display', 'none'); $("table.alert-status-filter #table2-0-4").hide();
} }
} else { } else {
$("#tag_filter").css('display', ''); $("#tag_filter").show();
if (is_meta) { if (is_meta) {
$("#table1-0-4").css('display', ''); $("table.alert-status-filter #table1-0-4").show();
} else { } else {
$("#table2-0-4").css('display', ''); $("table.alert-status-filter #table2-0-4").show();
} }
} }
}).change(); }).change();
</script> </script>