Add operational port status 85/585/1
authorAndrew Kim <andrekim@cisco.com>
Tue, 9 Jul 2013 17:42:44 +0000 (12:42 -0500)
committerAndrew Kim <andrekim@cisco.com>
Wed, 10 Jul 2013 18:40:59 +0000 (13:40 -0500)
Port status that is operationally down will be colored yellow

Signed-off-by: Andrew Kim <andrekim@cisco.com>
opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java
opendaylight/web/root/src/main/resources/css/one.less

index 04f9863..34aef8a 100644 (file)
@@ -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 = "<span style='color:green;'>"
-                                        + nodeConnectorName + "</span>";
+                                if (portState.getValue() == State.EDGE_UP) {
+                                    nodeConnectorName = "<span class='admin-up'>"
+                                            + nodeConnectorName + "</span>";
+                                } else if (portState.getValue() == State.EDGE_DOWN) {
+                                    nodeConnectorName = "<span class='edge-down'>"
+                                            + nodeConnectorName + "</span>";
+                                }
                             } else if (portStatus.getValue() == Config.ADMIN_DOWN) {
-                                nodeConnectorName = "<span style='color:red;'>"
+                                nodeConnectorName = "<span class='admin-down'>"
                                         + nodeConnectorName + "</span>";
                             }
                         }
index b5ab76f..6ec818c 100644 (file)
@@ -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;
        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 {