From 885d4ff28b43557e4d43ae1c52028e66873a0003 Mon Sep 17 00:00:00 2001 From: Andrew Kim Date: Tue, 9 Jul 2013 12:42:44 -0500 Subject: [PATCH] Add operational port status Port status that is operationally down will be colored yellow Signed-off-by: Andrew Kim --- .../controller/devices/web/Devices.java | 15 ++++++++++++--- .../web/root/src/main/resources/css/one.less | 17 +++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java b/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java index 04f9863312..34aef8af9f 100644 --- a/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java +++ b/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java @@ -29,6 +29,7 @@ import org.opendaylight.controller.sal.core.Config; import org.opendaylight.controller.sal.core.Name; import org.opendaylight.controller.sal.core.Node; import org.opendaylight.controller.sal.core.NodeConnector; +import org.opendaylight.controller.sal.core.State; import org.opendaylight.controller.sal.core.Tier; import org.opendaylight.controller.sal.utils.GlobalConstants; import org.opendaylight.controller.sal.utils.HexEncode; @@ -136,6 +137,9 @@ public class Devices implements IDaylightWeb { Config portStatus = ((Config) switchManager .getNodeConnectorProp(nodeConnector, Config.ConfigPropName)); + State portState = ((State) switchManager + .getNodeConnectorProp(nodeConnector, + State.StatePropName)); String nodeConnectorName = (ncName != null) ? ncName .getValue() : ""; @@ -143,10 +147,15 @@ public class Devices implements IDaylightWeb { if (portStatus != null) { if (portStatus.getValue() == Config.ADMIN_UP) { - nodeConnectorName = "" - + nodeConnectorName + ""; + if (portState.getValue() == State.EDGE_UP) { + nodeConnectorName = "" + + nodeConnectorName + ""; + } else if (portState.getValue() == State.EDGE_DOWN) { + nodeConnectorName = "" + + nodeConnectorName + ""; + } } else if (portStatus.getValue() == Config.ADMIN_DOWN) { - nodeConnectorName = "" + nodeConnectorName = "" + nodeConnectorName + ""; } } diff --git a/opendaylight/web/root/src/main/resources/css/one.less b/opendaylight/web/root/src/main/resources/css/one.less index b5ab76f323..6ec818c18c 100644 --- a/opendaylight/web/root/src/main/resources/css/one.less +++ b/opendaylight/web/root/src/main/resources/css/one.less @@ -7,6 +7,10 @@ @topologyOffset: -4px; // ensure calibration +@interface-admin-up: #46A040; +@interface-admin-down: #C41230; +@interface-edge-down: #F58025; + // mixins .dash-size (@width, @height) { width: @width; @@ -259,6 +263,19 @@ cursor: pointer; } +// interfaces +table { + .admin-up { + color: @interface-admin-up; + } + .admin-down { + color: @interface-admin-down; + } + .edge-down { + color: @interface-edge-down; + } +} + // hide .modal { .help { -- 2.36.6