Move server LED files

The WebUI has a main menu with 5 options: Server overview,
Server health, Server control, Server Configuration, Users.

These 5 main menu items each have a directory in /app/,
although the directory names differ slightly.
These 5 main menu items are also modules whose content includes
their sub-menu items (again names differ slightly).

E.g. "Firmware" and "Network settings" are sub-menu items of the
main menu item "Server configuration" which is located in the
app/configuration dir and part of the app.configuration module.

The Server LED sub menu item did not follow this pattern and was
under the wrong directory and in the wrong module. Moved it.
In a future commit I renamed it from unit-id.

Tested: Verified server LED still works.
Change-Id: I02e3a7995cf8ccc5b487c345866651d984c8d70c
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/server-control/controllers/unit-id-controller.html b/app/server-control/controllers/unit-id-controller.html
new file mode 100644
index 0000000..bc9c345
--- /dev/null
+++ b/app/server-control/controllers/unit-id-controller.html
@@ -0,0 +1,28 @@
+<div id="uid-switch">
+    <div class="row column">
+        <h1>Server LED</h1>
+        <div class="page-header">
+            <h2 class="h4">LED light control</h2>
+        </div>
+    </div>
+
+    <div class="row column" ng-class="{disabled: dataService.server_unreachable || dataService.loading}">
+        <div class="btm-border-grey">
+            <div class="toggle inline">
+                <input id="toggle__switch-round"
+                       class="toggle-switch toggle-switch__round-flat"
+                       type="checkbox"
+                       tabindex="0"
+                       ng-click="toggleLED()"
+                       ng-checked="dataService.LED_state == 'on'"
+                       ng-disabled="dataService.server_unreachable"
+                       >
+                <label for="toggle__switch-round" tabindex="0">Server indicator is <span class="uid-switch__status">{{dataService.LED_state}}</span></label>
+            </div>
+            <div class="uid-switch__label inline">
+                <p>Server LED light is <span class="uid-switch__status">{{dataService.LED_state}}</span></p>
+                <p>Turn the LED light on or off. If the server has an LCD, use this control to display text (on) or not to display text (off) on the LCD.</p>
+            </div>
+        </div>
+    </div>
+</div>
\ No newline at end of file
diff --git a/app/server-control/controllers/unit-id-controller.js b/app/server-control/controllers/unit-id-controller.js
new file mode 100644
index 0000000..3648acd
--- /dev/null
+++ b/app/server-control/controllers/unit-id-controller.js
@@ -0,0 +1,43 @@
+/**
+ * Controller for unit Id
+ *
+ * @module app/serverControl
+ * @exports unitIdController
+ * @name unitIdController
+ */
+
+window.angular && (function(angular) {
+  'use strict';
+
+  angular.module('app.serverControl').controller('unitIdController', [
+    '$scope', '$window', 'APIUtils', 'dataService',
+    function($scope, $window, APIUtils, dataService) {
+      $scope.dataService = dataService;
+
+      APIUtils.getLEDState().then(function(state) {
+        $scope.displayLEDState(state);
+      });
+
+      $scope.displayLEDState = function(state) {
+        if (state == APIUtils.LED_STATE.on) {
+          dataService.LED_state = APIUtils.LED_STATE_TEXT.on;
+        } else {
+          dataService.LED_state = APIUtils.LED_STATE_TEXT.off;
+        }
+      };
+
+      $scope.toggleLED = function() {
+        var toggleState =
+            (dataService.LED_state == APIUtils.LED_STATE_TEXT.on) ?
+            APIUtils.LED_STATE.off :
+            APIUtils.LED_STATE.on;
+        dataService.LED_state =
+            (dataService.LED_state == APIUtils.LED_STATE_TEXT.on) ?
+            APIUtils.LED_STATE_TEXT.off :
+            APIUtils.LED_STATE_TEXT.on;
+        APIUtils.setLEDState(toggleState, function(status) {});
+      };
+    }
+  ]);
+
+})(angular);
diff --git a/app/server-control/index.js b/app/server-control/index.js
index 0b0fa93..f9aaba9 100644
--- a/app/server-control/index.js
+++ b/app/server-control/index.js
@@ -21,8 +21,7 @@
                 authenticated: true
               })
               .when('/server-control/server-led', {
-                'template': require(
-                    '../server-health/controllers/unit-id-controller.html'),
+                'template': require('./controllers/unit-id-controller.html'),
                 'controller': 'unitIdController',
                 authenticated: true
               })
diff --git a/app/server-control/styles/index.scss b/app/server-control/styles/index.scss
index dfb6b6e..d469ecf 100644
--- a/app/server-control/styles/index.scss
+++ b/app/server-control/styles/index.scss
@@ -1,3 +1,4 @@
 @import "./bmc-reboot.scss";
 @import "./power-operations.scss";
-@import "./remote-console.scss";
\ No newline at end of file
+@import "./remote-console.scss";
+@import "./unit-id.scss";
diff --git a/app/server-control/styles/unit-id.scss b/app/server-control/styles/unit-id.scss
new file mode 100644
index 0000000..4b59437
--- /dev/null
+++ b/app/server-control/styles/unit-id.scss
@@ -0,0 +1,12 @@
+// UI Light
+
+#uid-switch {
+  .switch {margin-left: 1.7em;}
+  .uid-switch__label {
+    padding-bottom: 1.5em;
+  }
+  .uid-switch__label p {
+    margin: 0;
+    &:first-child {font-weight: 700;}
+  }
+}
\ No newline at end of file