diff --git a/AUTHORS.md b/AUTHORS.md index 63ef79d1f45f..369f93251ee2 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -217,6 +217,7 @@ LibreNMS contributors: - Jason Cheng (jasoncheng7115) - Daniel Baeza (TheGreatDoc) - Thom Cleary (thomcatdotrocks) +- Kayck Matias [KayckMatias](https://github.com/KayckMatias/) Observium was written by: - Adam Armstrong diff --git a/includes/html/pages/ports.inc.php b/includes/html/pages/ports.inc.php index a569df45d36b..128402558581 100644 --- a/includes/html/pages/ports.inc.php +++ b/includes/html/pages/ports.inc.php @@ -13,7 +13,6 @@ * @author LibreNMS Contributors */ -use App\Models\Device; use App\Models\Port; use Illuminate\Database\Eloquent\ModelNotFoundException; @@ -90,36 +89,7 @@ $output .= addslashes(csrf_field()); $output .= "
"; $output .= "
"; - $output .= " '; + $output .= " "; $hasvalue = ! empty($vars['hostname']) ? "value='" . $vars['hostname'] . "'" : ''; diff --git a/includes/html/pages/ports/graph.inc.php b/includes/html/pages/ports/graph.inc.php index 66ad53634670..63422e3f428e 100644 --- a/includes/html/pages/ports/graph.inc.php +++ b/includes/html/pages/ports/graph.inc.php @@ -13,6 +13,10 @@ $where = ''; $ignore_filter = 0; $disabled_filter = 0; +$device = DeviceCache::get((int) $vars['device_id']); + +$device_selected = json_encode($device->exists ? ['id' => $device->device_id, 'text' => $device->displayName()] : ''); +echo ''; foreach ($vars as $var => $value) { if ($value != '') { diff --git a/includes/html/pages/ports/list.inc.php b/includes/html/pages/ports/list.inc.php index cb44d932ed6a..bea04ed93fd5 100644 --- a/includes/html/pages/ports/list.inc.php +++ b/includes/html/pages/ports/list.inc.php @@ -16,6 +16,8 @@ $details_visible = var_export($vars['format'] == 'list_detail', 1); $errors_visible = var_export($vars['format'] == 'list_detail' || isset($vars['errors']), 1); $no_refresh = true; +$device = DeviceCache::get((int) $vars['device_id']); +$device_selected = json_encode($device->exists() ? ['id' => $device->device_id, 'text' => $device->displayName()] : ''); if (isset($vars['errors'])) { $error_sort = ' data-order="desc"'; @@ -130,4 +132,6 @@ function formatUnits(units,decimals,display,base) { $(".actionBar").append("
"); +init_select2('#device_id', 'device', {}, , 'All Devices'); +