Merge branch 'ent-1880-Umbrales-inversos-en-negativo' into 'develop'

Ent 1880 umbrales inversos en negativo

See merge request artica/pandorafms!2818
This commit is contained in:
Daniel Rodriguez 2019-10-22 12:56:21 +02:00
commit 0cf3e01f74
4 changed files with 24 additions and 8 deletions

View File

@ -842,7 +842,9 @@ foreach ($modules as $module) {
$module['str_warning'],
$module['max_critical'],
$module['min_critical'],
$module['str_critical']
$module['str_critical'],
$module['warning_inverse'],
$module['critical_inverse']
);
} else {
$data[7] = '';

View File

@ -1113,7 +1113,7 @@ if (check_login()) {
}
if ($module['id_tipo_modulo'] != 25) {
$data[6] = ui_print_module_warn_value($module['max_warning'], $module['min_warning'], $module['str_warning'], $module['max_critical'], $module['min_critical'], $module['str_critical']);
$data[6] = ui_print_module_warn_value($module['max_warning'], $module['min_warning'], $module['str_warning'], $module['max_critical'], $module['min_critical'], $module['str_critical'], $module['warning_inverse'], $module['critical_inverse']);
} else {
$data[6] = '';
}

View File

@ -2527,9 +2527,22 @@ function ui_print_module_warn_value(
$str_warning,
$max_critical,
$min_critical,
$str_critical
$str_critical,
$warning_inverse=0,
$critical_inverse=0
) {
$data = "<span title='".__('Warning').': '.__('Max').$max_warning.'/'.__('Min').$min_warning.' - '.__('Critical').': '.__('Max').$max_critical.'/'.__('Min').$min_critical."'>";
$war_inv = '';
$crit_inv = '';
if ($warning_inverse == 1) {
$war_inv = ' (inv)';
}
if ($critical_inverse == 1) {
$crit_inv = ' (inv)';
}
$data = "<span title='".__('Warning').': '.__('Max').$max_warning.'/'.__('Min').$min_warning.$war_inv.' - '.__('Critical').': '.__('Max').$max_critical.'/'.__('Min').$min_critical.$crit_inv."'>";
if ($max_warning != $min_warning) {
$data .= format_for_graph($max_warning).'/'.format_for_graph($min_warning);
@ -5696,11 +5709,10 @@ function ui_print_comments($comments)
// Only show the last comment. If commment its too long,the comment will short with ...
// If $config['prominent_time'] is timestamp the date show Month, day, hour and minutes.
// Else show comments hours ago
if ($last_comment[0][0]['action'] != 'Added comment'){
if ($last_comment[0][0]['action'] != 'Added comment') {
$last_comment[0][0]['comment'] = $last_comment[0][0]['action'];
}
$short_comment = substr($last_comment[0][0]['comment'], 0, '80px');
if ($config['prominent_time'] == 'timestamp') {
$comentario = '<i>'.date($config['date_format'], $last_comment[0][0]['utimestamp']).'&nbsp;('.$last_comment[0][0]['id_user'].'):&nbsp;'.$last_comment[0][0]['comment'].'';

View File

@ -1541,7 +1541,9 @@ if (!empty($result)) {
$row['str_warning'],
$row['max_critical'],
$row['min_critical'],
$row['str_critical']
$row['str_critical'],
$row['warning_inverse'],
$row['critical_inverse']
);
if (is_numeric($row['datos']) && !modules_is_string_type($row['module_type'])) {