mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Custom ssh,telnet port with oxidized (#15255)
* Custom ssh,telnet,http port with oxidized * Lint fixes * copy paste minors
This commit is contained in:
@@ -192,9 +192,10 @@ class DeviceController extends Controller
|
||||
}
|
||||
|
||||
// Web
|
||||
$http_port = $device->attribs->firstWhere('attrib_type', 'override_device_http_port') ? ':' . $device->attribs->firstWhere('attrib_type', 'override_device_http_port')->attrib_value : '';
|
||||
$device_links['web'] = [
|
||||
'icon' => 'fa-globe',
|
||||
'url' => 'https://' . $device->hostname,
|
||||
'url' => 'https://' . $device->hostname . $http_port,
|
||||
'title' => __('Web'),
|
||||
'external' => true,
|
||||
'onclick' => 'http_fallback(this); return false;',
|
||||
@@ -212,9 +213,10 @@ class DeviceController extends Controller
|
||||
}
|
||||
|
||||
// SSH
|
||||
$ssh_port = $device->attribs->firstWhere('attrib_type', 'override_device_ssh_port') ? ':' . $device->attribs->firstWhere('attrib_type', 'override_device_ssh_port')->attrib_value : '';
|
||||
$ssh_url = Config::has('gateone.server')
|
||||
? Config::get('gateone.server') . '?ssh=ssh://' . (Config::get('gateone.use_librenms_user') ? Auth::user()->username . '@' : '') . $device['hostname'] . '&location=' . $device['hostname']
|
||||
: 'ssh://' . $device->hostname;
|
||||
: 'ssh://' . $device->hostname . $ssh_port;
|
||||
$device_links['ssh'] = [
|
||||
'icon' => 'fa-lock',
|
||||
'url' => $ssh_url,
|
||||
@@ -223,9 +225,10 @@ class DeviceController extends Controller
|
||||
];
|
||||
|
||||
// Telnet
|
||||
$telnet_port = $device->attribs->firstWhere('attrib_type', 'override_device_telnet_port') ? ':' . $device->attribs->firstWhere('attrib_type', 'override_device_telnet_port')->attrib_value : '';
|
||||
$device_links['telnet'] = [
|
||||
'icon' => 'fa-terminal',
|
||||
'url' => 'telnet://' . $device->hostname,
|
||||
'url' => 'telnet://' . $device->hostname . $telnet_port,
|
||||
'title' => __('Telnet'),
|
||||
'external' => true,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user