implement show link speeds on links

This commit is contained in:
Oliver Gorwits
2017-12-30 08:58:04 +00:00
parent 72961f172d
commit 93f8181fc8
6 changed files with 52 additions and 5 deletions

View File

@@ -11,10 +11,11 @@ __PACKAGE__->table('device_links');
__PACKAGE__->result_source_instance->is_virtual(1);
__PACKAGE__->result_source_instance->view_definition(<<ENDSQL
SELECT dp.ip AS left_ip, dp.port AS left_port, dp.name AS left_descr,
dp.speed,
replace(replace(btrim(dp.speed, 'bps'), '.0', ''), ' ', '') AS speed,
dp2.ip AS right_ip, dp2.port AS right_port, dp2.name AS right_descr
FROM ( SELECT device_port.ip, device_port.port, device_port.name,
device_port.speed,
(CASE WHEN device_port.speed LIKE '%bps' THEN device_port.speed
ELSE '' END) as speed,
device_port.remote_ip, device_port.remote_port
FROM device_port
WHERE device_port.remote_port IS NOT NULL