Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -4,23 +4,25 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage web
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
* @package observium
* @subpackage web
* @copyright (C) Adam Armstrong
*
*/
$link_array = array('page' => 'device',
'device' => $device['device_id'],
'tab' => 'health');
$link_array = ['page' => 'device',
'device' => $device['device_id'],
'tab' => 'health'];
//if (!$vars['metric']) { $vars['metric'] = "overview"; }
$navbar['brand'] = "SLAs";
$navbar['class'] = "navbar-narrow";
if (!isset($vars['rtt_type'])) { $navbar['options']['all']['class'] = "active"; }
$navbar['options']['all']['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'slas', 'rtt_type' => NULL));
if (!isset($vars['rtt_type'])) {
$navbar['options']['all']['class'] = "active";
}
$navbar['options']['all']['url'] = generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'slas', 'rtt_type' => NULL]);
$navbar['options']['all']['text'] = "All SLAs";
$vars_type = $vars;
@ -32,37 +34,37 @@ $slas = dbFetchRows($sql);
$rtt_types = [];
foreach ($slas as $sla) {
$rtt_type = $sla['rtt_type'];
$rtt_type = $sla['rtt_type'];
if (!isset($rtt_types[$rtt_type])) {
if (isset($config['sla_type_labels'][$rtt_type])) {
$text = $config['sla_type_labels'][$rtt_type];
} else {
$text = nicecase($rtt_type);
if (!isset($rtt_types[$rtt_type])) {
if (isset($config['sla_type_labels'][$rtt_type])) {
$text = $config['sla_type_labels'][$rtt_type];
} else {
$text = nicecase($rtt_type);
}
$rtt_types[$rtt_type] = $text;
}
$rtt_types[$rtt_type] = $text;
}
}
asort($rtt_types);
foreach ($rtt_types as $type => $text)
{
if ($vars['rtt_type'] == $type) { $navbar['options'][$type]['class'] = "active"; }
$navbar['options'][$type]['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'slas', 'rtt_type' => $type));
$navbar['options'][$type]['text'] = $text;
foreach ($rtt_types as $type => $text) {
if ($vars['rtt_type'] == $type) {
$navbar['options'][$type]['class'] = "active";
}
$navbar['options'][$type]['url'] = generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'slas', 'rtt_type' => $type]);
$navbar['options'][$type]['text'] = $text;
}
$navbar['options']['graphs']['text'] = 'Graphs';
$navbar['options']['graphs']['icon'] = $config['icon']['graphs'];
$navbar['options']['graphs']['right'] = TRUE;
if ($vars['view'] == "graphs")
{
$navbar['options']['graphs']['class'] = 'active';
$navbar['options']['graphs']['url'] = generate_url($vars, array('view' => NULL));
if ($vars['view'] == "graphs") {
$navbar['options']['graphs']['class'] = 'active';
$navbar['options']['graphs']['url'] = generate_url($vars, ['view' => NULL]);
} else {
$navbar['options']['graphs']['url'] = generate_url($vars, array('view' => "graphs"));
$navbar['options']['graphs']['url'] = generate_url($vars, ['view' => "graphs"]);
}
print_navbar($navbar);