reorganize the reports a little
authorDenis Ovsienko <denis@ovsienko.info>
Thu, 8 Nov 2018 21:42:29 +0000 (21:42 +0000)
committerDenis Ovsienko <denis@ovsienko.info>
Thu, 8 Nov 2018 21:44:50 +0000 (21:44 +0000)
* renderRackCodeReports(): merge into renderSystemReports()
* renderIPv4Reports(): idem
* renderIPv6Reports(): idem
* renderPortsReport(): idem
* renderReports(): change the meters TD to fit better into a wider table
* renderTagStats(): update the table style for readability

wwwroot/inc/interface-reports.php
wwwroot/inc/navigation.php

index b43b9f0..e5b326a 100644 (file)
@@ -32,72 +32,36 @@ function renderSystemReports ()
                        'type' => 'custom',
                        'func' => 'renderTagStats'
                ),
-       );
-       renderReports ($tmp);
-}
-
-function renderLocalReports ()
-{
-       global $localreports;
-       renderReports ($localreports);
-}
-
-function renderRackCodeReports ()
-{
-       $tmp = array
-       (
                array
                (
-                       'title' => 'Stats',
+                       'title' => 'RackCode stats',
                        'type' => 'counters',
                        'func' => 'getRackCodeStats',
                ),
                array
                (
-                       'title' => 'Warnings',
+                       'title' => 'RackCode warnings',
                        'type' => 'messages',
                        'func' => 'getRackCodeWarnings',
                ),
-       );
-       renderReports ($tmp);
-}
-
-function renderIPv4Reports ()
-{
-       $tmp = array
-       (
                array
                (
-                       'title' => 'Stats',
+                       'title' => 'IPv4',
                        'type' => 'counters',
                        'func' => 'getIPv4Stats'
                ),
-       );
-       renderReports ($tmp);
-}
-
-function renderIPv6Reports ()
-{
-       $tmp = array
-       (
                array
                (
-                       'title' => 'Stats',
+                       'title' => 'IPv6',
                        'type' => 'counters',
                        'func' => 'getIPv6Stats'
                ),
        );
-       renderReports ($tmp);
-}
-
-function renderPortsReport ()
-{
-       $tmp = array();
        foreach (getPortIIFOptions() as $iif_id => $iif_name)
                if (count (getPortIIFStats ($iif_id)))
                        $tmp[] = array
                        (
-                               'title' => $iif_name,
+                               'title' => "{$iif_name} ports",
                                'type' => 'meters',
                                'func' => 'getPortIIFStats',
                                'args' => $iif_id,
@@ -105,6 +69,12 @@ function renderPortsReport ()
        renderReports ($tmp);
 }
 
+function renderLocalReports ()
+{
+       global $localreports;
+       renderReports ($localreports);
+}
+
 function render8021QReport ()
 {
        if (!count ($domains = getVLANDomainOptions()))
@@ -207,9 +177,9 @@ function renderReports ($what)
                                        $data = $item['func'] ();
                                foreach ($data as $meter)
                                {
-                                       echo "<tr><td class=tdright>${meter['title']}:</td><td class=tdcenter>";
+                                       echo "<tr><td class=tdright>${meter['title']}:</td><td class=tdleft>";
                                        renderProgressBar ($meter['max'] ? $meter['current'] / $meter['max'] : 0);
-                                       echo '<br><small>' . ($meter['max'] ? $meter['current'] . '/' . $meter['max'] : '0') . '</small></td></tr>';
+                                       echo ' <small>' . ($meter['max'] ? $meter['current'] . '/' . $meter['max'] : '0') . '</small></td></tr>';
                                }
                                break;
                        case 'custom':
@@ -228,7 +198,7 @@ function renderReports ($what)
 function renderTagStats ()
 {
        global $taglist;
-       echo '<table border=1><tr><th>tag</th><th>total</th><th>objects</th><th>IPv4 nets</th><th>IPv6 nets</th>';
+       echo '<table class="zebra widetable"><tr><th>tag</th><th>total</th><th>objects</th><th>IPv4 nets</th><th>IPv6 nets</th>';
        echo '<th>racks</th><th>IPv4 VS</th><th>IPv4 RS pools</th><th>users</th><th>files</th></tr>';
        $pagebyrealm = array
        (
index 00b47e7..9b8e47b 100644 (file)
@@ -702,11 +702,7 @@ $interface_requires['cableconf-*'] = 'interface-cables.php';
 
 $page['reports']['title'] = 'Reports';
 $page['reports']['parent'] = 'index';
-$tab['reports']['default'] = 'System';
-$tab['reports']['rackcode'] = 'RackCode';
-$tab['reports']['ipv4'] = 'IPv4';
-$tab['reports']['ipv6'] = 'IPv6';
-$tab['reports']['ports'] = 'Ports';
+$tab['reports']['default'] = 'Totals';
 $tab['reports']['8021q'] = '802.1Q';
 $tab['reports']['warranty'] = 'Expirations';
 $tab['reports']['integrity'] = 'Data Integrity';
@@ -714,16 +710,12 @@ $tab['reports']['serverconf'] = 'Server configuration';
 $tab['reports']['local'] = 'local'; // this one is set later in init.php
 $trigger['reports']['local'] = 'trigger_localreports';
 $tabhandler['reports']['default'] = 'renderSystemReports';
-$tabhandler['reports']['rackcode'] = 'renderRackCodeReports';
-$tabhandler['reports']['ipv4'] = 'renderIPv4Reports';
-$tabhandler['reports']['ipv6'] = 'renderIPv6Reports';
-$tabhandler['reports']['ports'] = 'renderPortsReport';
 $tabhandler['reports']['8021q'] = 'render8021QReport';
 $tabhandler['reports']['warranty'] = 'renderExpirations';
 $tabhandler['reports']['integrity'] = 'renderDataIntegrityReport';
 $tabhandler['reports']['serverconf'] = 'renderServerConfigurationReport';
 $tabhandler['reports']['local'] = 'renderLocalReports';
-$interface_requires['reports-rackcode'] = 'code.php';
+$interface_requires['reports-default'] = 'code.php';
 $interface_requires['reports-serverconf'] = 'dictionary.php';
 $interface_requires['reports-*'] = 'interface-reports.php';