';
// All SLA's support the RTT metric
include 'sla/rtt.inc.php';
// Load the per-type SLA metrics
$rtt_type = basename($sla['rtt_type']);
if (file_exists("includes/html/pages/device/sla/$rtt_type.inc.php")) {
include "includes/html/pages/device/sla/$rtt_type.inc.php";
}
echo '
';
} else {
print_optionbar_start();
$slas = dbFetchRows('SELECT * FROM `slas` WHERE `device_id` = ? AND `deleted` = 0 ORDER BY `sla_nr`', [$device['device_id']]);
// Collect types
$sla_types = ['all' => 'All'];
foreach ($slas as $sla) {
$sla_type = $sla['rtt_type'];
$sla_types[$sla_type] = trans_fb("modules.slas.{$sla_type}", ucfirst($sla_type));
}
asort($sla_types);
$status_options = [
'all' => 'All',
'up' => 'Up',
'down' => 'Down',
];
echo "SLA » ";
// SLA Types, on the left.
$sep = '';
foreach ($sla_types as $sla_type => $text) {
if (! $vars['view']) {
$vars['view'] = $sla_type;
}
echo $sep;
if ($vars['view'] == $sla_type) {
echo "";
}
echo generate_link($text, $vars, ['view' => $sla_type]);
if ($vars['view'] == $sla_type) {
echo '';
}
$sep = ' | ';
}
unset($sep);
// The status option - on the right
echo '