From 49310dc693503de6f13d6ecb80dbead7b9ff9055 Mon Sep 17 00:00:00 2001 From: Jason Cheng <30381035+jasoncheng7115@users.noreply.github.com> Date: Wed, 21 Aug 2019 03:49:59 +0800 Subject: [PATCH] Allow adding custom quick links to device navigation (#10403) * Add Open-Audit link display device asset details * Add an external link using the template method * Add external system link setting. * Update device.inc.php * Update Customizing-the-Web-UI.md --- doc/Extensions/Customizing-the-Web-UI.md | 15 +++++++++++++++ includes/html/pages/device.inc.php | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/doc/Extensions/Customizing-the-Web-UI.md b/doc/Extensions/Customizing-the-Web-UI.md index 2bfbcc9ac1..ca05d16fdc 100644 --- a/doc/Extensions/Customizing-the-Web-UI.md +++ b/doc/Extensions/Customizing-the-Web-UI.md @@ -28,3 +28,18 @@ Example contents: ``` + + +## Custom device menu entry + +You can add custom external links in the menu on the device page. + +This feature allows you to easily link applications to related systems, as shown in the example of Open-audIT. + +The Links value is parsed by Laravel Blade's templating engine so you can use Device variables such as `hostname`, `sysName` and more. + +`config.php:` + +```php +$config['html']['device']['links'][] = ['url' => 'http://atssrv/open-audit/index/devices/{{ $device[\'sysName\'] }}', 'title' => 'Open-AudIT']; +``` diff --git a/includes/html/pages/device.inc.php b/includes/html/pages/device.inc.php index 54c979bea2..78aa91588b 100644 --- a/includes/html/pages/device.inc.php +++ b/includes/html/pages/device.inc.php @@ -454,6 +454,12 @@ if (device_permitted($vars['device']) || $permitted_by_port) {