Commit version 24.12.13800
This commit is contained in:
@ -6,36 +6,38 @@
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage web
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
/// SEARCH ACCESSPOINTS
|
||||
$results = dbFetchRows("SELECT * FROM `wifi_aps`
|
||||
WHERE `ap_name` LIKE ? $query_permitted_device
|
||||
ORDER BY `ap_name` LIMIT $query_limit", array($query_param));
|
||||
$results = dbFetchRows("SELECT * FROM `wifi_aps`" .
|
||||
generate_where_clause('`ap_name` LIKE ?', $GLOBALS['cache']['where']['devices_permitted']) .
|
||||
" ORDER BY `ap_name` LIMIT $query_limit", [ $query_param ]);
|
||||
|
||||
if (!safe_empty($results)) {
|
||||
$max_len = 35;
|
||||
foreach ($results as $result) {
|
||||
if (safe_empty($results)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$max_len = 35;
|
||||
foreach ($results as $result) {
|
||||
$name = truncate($result['ap_name']);
|
||||
|
||||
/// FIXME: once we have alerting, colour this to the sensor's status
|
||||
$tab_colour = '#194B7F'; // FIXME: This colour pulled from functions.inc.php humanize_device, maybe set it centrally in definitions?
|
||||
|
||||
$ap_search_results[] = array(
|
||||
'url' => generate_url(array('page' => 'device', 'device' => $result['device_id'], 'tab' => 'wifi', 'view' => 'accesspoints', 'accesspoint' => $result['wifi_ap_id'])),
|
||||
'name' => $name,
|
||||
'colour' => $tab_colour,
|
||||
'icon' => $config['icon']['wifi'],
|
||||
'data' => array(
|
||||
$result['ap_name'],
|
||||
escape_html($result['ap_location']) . ' | Access point'),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
$search_results['accesspoints'] = array('descr' => 'APs found', 'results' => $ap_search_results);
|
||||
$ap_search_results[] = [
|
||||
'url' => generate_url(['page' => 'device', 'device' => $result['device_id'], 'tab' => 'wifi', 'view' => 'accesspoints', 'accesspoint' => $result['wifi_ap_id']]),
|
||||
'name' => $name,
|
||||
'colour' => $tab_colour,
|
||||
'icon' => $config['icon']['wifi'],
|
||||
'data' => [
|
||||
$result['ap_name'],
|
||||
escape_html($result['ap_location']) . ' | Access point'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
$search_results['accesspoints'] = ['descr' => 'APs found', 'results' => $ap_search_results];
|
||||
|
||||
// EOF
|
||||
|
Reference in New Issue
Block a user