From d20e1bdf5d19736c16bcb4c315fe4cb0e196a79c Mon Sep 17 00:00:00 2001 From: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com> Date: Thu, 18 Feb 2021 15:10:32 +0100 Subject: [PATCH] GUI - Fix the detailed access point view (#12543) * Fix the detailed access point view * Removing unused old tab file --- includes/html/functions.inc.php | 2 +- includes/html/pages/device/accesspoint.inc.php | 13 ------------- includes/html/pages/device/accesspoints.inc.php | 6 +++++- includes/html/print-accesspoint.inc.php | 4 ++-- 4 files changed, 8 insertions(+), 17 deletions(-) delete mode 100644 includes/html/pages/device/accesspoint.inc.php diff --git a/includes/html/functions.inc.php b/includes/html/functions.inc.php index 2929d46938..15aa0f8489 100644 --- a/includes/html/functions.inc.php +++ b/includes/html/functions.inc.php @@ -804,7 +804,7 @@ function generate_ap_link($args, $text = null, $type = null) function generate_ap_url($ap, $vars = []) { - return generate_url(['page' => 'device', 'device' => $ap['device_id'], 'tab' => 'accesspoint', 'ap' => $ap['accesspoint_id']], $vars); + return generate_url(['page' => 'device', 'device' => $ap['device_id'], 'tab' => 'accesspoints', 'ap' => $ap['accesspoint_id']], $vars); }//end generate_ap_url() // Find all the files in the given directory that match the pattern diff --git a/includes/html/pages/device/accesspoint.inc.php b/includes/html/pages/device/accesspoint.inc.php deleted file mode 100644 index dc8244cdae..0000000000 --- a/includes/html/pages/device/accesspoint.inc.php +++ /dev/null @@ -1,13 +0,0 @@ -"; - -$i = '1'; - -$ap = dbFetchRow("SELECT * FROM `access_points` WHERE `device_id` = ? AND `accesspoint_id` = ? AND `deleted` = '0' ORDER BY `name`,`radio_number` ASC", [$device['device_id'], $vars['ap']]); - -echo "
"; - -require 'includes/html/print-accesspoint.inc.php'; - -echo '
'; diff --git a/includes/html/pages/device/accesspoints.inc.php b/includes/html/pages/device/accesspoints.inc.php index 5741b2f9cd..7526a39ee0 100644 --- a/includes/html/pages/device/accesspoints.inc.php +++ b/includes/html/pages/device/accesspoints.inc.php @@ -4,7 +4,11 @@ echo "
0) { //We have a selected AP + $aps = dbFetchRows("SELECT * FROM `access_points` WHERE `device_id` = ? AND `accesspoint_id` = ? AND `deleted` = '0' ORDER BY `name`,`radio_number` ASC", [$device['device_id'], $vars['ap']]); +} else { + $aps = dbFetchRows("SELECT * FROM `access_points` WHERE `device_id` = ? AND `deleted` = '0' ORDER BY `name`,`radio_number` ASC", [$device['device_id']]); +} echo "
"; foreach ($aps as $ap) { include 'includes/html/print-accesspoint.inc.php'; diff --git a/includes/html/print-accesspoint.inc.php b/includes/html/print-accesspoint.inc.php index 77d2ed3f58..94d6874cd6 100644 --- a/includes/html/print-accesspoint.inc.php +++ b/includes/html/print-accesspoint.inc.php @@ -12,7 +12,7 @@ if ($int_colour) { } } -$text = $ap['name'] . ' ' . $ap['type']; +$text = $ap['name'] . ' (' . $ap['type'] . ')'; $ap['text'] = $text; echo " @@ -43,7 +43,7 @@ echo " " . format_ echo ''; -if ($vars['tab'] == 'accesspoint') { +if ($vars['ap'] > 0) { // We have a selected AP, let's show details $graph_type = 'accesspoints_numasoclients'; echo "
"; echo "
Associated Clients
";