1<?php
2
3$link_array = [
4    'page'   => 'device',
5    'device' => $device['device_id'],
6    'tab'    => 'loadbalancer',
7];
8
9$type_text['loadbalancer_rservers'] = 'Rservers';       // Cisco ACE
10$type_text['loadbalancer_vservers'] = 'Serverfarms';    // Cisco ACE
11$type_text['netscaler_vsvr'] = 'VServers';              // Citrix Netscaler
12$type_text['ltm_vs'] = 'LTM Virtual Servers';           // F5 BigIP
13$type_text['ltm_pool'] = 'LTM Pools';                   // F5 BigIP
14$type_text['ltm_bwc'] = 'LTM Bandwidth Controller';     // F5 BigIP
15$type_text['gtm_wide'] = 'GTM Wide IPs';                // F5 BigIP
16$type_text['gtm_pool'] = 'GTM Pools';                   // F5 BigIP
17
18print_optionbar_start();
19
20$pagetitle[] = 'Load Balancer';
21
22echo "<span style='font-weight: bold;'>Load Balancer</span> &#187; ";
23
24unset($sep);
25foreach ($loadbalancer_tabs as $type) {
26    if (! $vars['type']) {
27        $vars['type'] = $type;
28    }
29
30    echo $sep;
31
32    if ($vars['type'] == $type) {
33        echo '<span class="pagemenu-selected">';
34    }
35
36    echo generate_link($type_text[$type] . ' (' . $device_loadbalancer_count[$type] . ')', $link_array, ['type' => $type]);
37    if ($vars['type'] == $type) {
38        echo '</span>';
39    }
40
41    $sep = ' | ';
42}
43
44print_optionbar_end();
45
46$type = basename($vars['type']);
47if (is_file("includes/html/pages/device/loadbalancer/$type.inc.php")) {
48    include "includes/html/pages/device/loadbalancer/$type.inc.php";
49} else {
50    foreach ($loadbalancer_tabs as $type) {
51        if ($type != 'overview') {
52            if (is_file('includes/html/pages/device/loadbalancer/overview/' . $type . '.inc.php')) {
53                $g_i++;
54                if (! is_integer($g_i / 2)) {
55                    $row_colour = \LibreNMS\Config::get('list_colour.even');
56                } else {
57                    $row_colour = \LibreNMS\Config::get('list_colour.odd');
58                }
59
60                echo '<div style="background-color: ' . $row_colour . ';">';
61                echo '<div style="padding:4px 0px 0px 8px;"><span class=graphhead>' . $type_text[$type] . '</span>';
62
63                include 'includes/html/pages/device/loadbalancer/overview/' . $type . '.inc.php';
64
65                echo '</div>';
66                echo '</div>';
67            } else {
68                $graph_title = $type_text[$type];
69                $graph_type = 'device_' . $type;
70
71                include 'includes/html/print-device-graph.php';
72            }//end if
73        }//end if
74    }//end foreach
75}//end if
76