From 37e57d1caa49c819dd10410ceb905c8cab26eab1 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Sat, 2 May 2015 03:35:18 +0000 Subject: [PATCH] Status Graph: Auto-load first interface found. --- app/traffic_graph/app_languages.php | 8 ++ app/traffic_graph/status_graph.php | 115 ++++++++++++++-------------- 2 files changed, 64 insertions(+), 59 deletions(-) diff --git a/app/traffic_graph/app_languages.php b/app/traffic_graph/app_languages.php index 6d0304c090..3230ef3d0a 100644 --- a/app/traffic_graph/app_languages.php +++ b/app/traffic_graph/app_languages.php @@ -8,6 +8,14 @@ $text['title-traffic_graph']['pt-br'] = "Gráfico de tráfego"; $text['title-traffic_graph']['pl'] = "Wykres przesyłu danych"; $text['title-traffic_graph']['sv-se'] = "Trafik Graf"; +$text['message-no_interfaces_found']['en-us'] = "No interfaces found."; +$text['message-no_interfaces_found']['es-cl'] = "Sin interfaces encontrados."; +$text['message-no_interfaces_found']['pt-pt'] = "Sem interfaces encontrados."; +$text['message-no_interfaces_found']['fr-fr'] = "Aucune interface trouvé."; +$text['message-no_interfaces_found']['pt-br'] = "Sem interfaces encontrados."; +$text['message-no_interfaces_found']['pl'] = "Nie znaleziono interfejsy."; +$text['message-no_interfaces_found']['sv-se'] = "Inga gränssnitt hittades."; + $text['label-interface']['en-us'] = "Interface"; $text['label-interface']['es-cl'] = "Interfaz"; $text['label-interface']['pt-pt'] = "Interface"; diff --git a/app/traffic_graph/status_graph.php b/app/traffic_graph/status_graph.php index a8e7cb5a21..f504473a6b 100644 --- a/app/traffic_graph/status_graph.php +++ b/app/traffic_graph/status_graph.php @@ -71,71 +71,68 @@ require_once "resources/header.php"; $document['title'] = $text['title-traffic_graph']; ?> - - - -
-

-
-
- : - + + - + } + //output form, if interfaces exist' + if (sizeof($options)) { + ?> + +    + + + + + + +
+ $value) { + if ($value != "Kernel Interface table") { + if ($x != 0) { + //get the values + $interface_info = preg_split("/\s+/", $result_array[$key]); + //list all the interfaces + $options[] = ""; + //auto-select first interface + if ($interface == '') { $interface = $interface_info[0]; } + } + $x++; } - else { - echo ""; - } - } - $x++; - } - } - ?> - - - - -
- + +

- -
-
-
-
+

- - - - +

+ 0) { + ?> + + + + +



"; + echo $text['message-no_interfaces_found']; + echo "




"; + } + ?>
-

+