Change navigation structure
Change-Id: I12c819293ce1eda188dc9f257ae9370f1b73cb18
Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
diff --git a/app/server-health/controllers/unit-id-controller.js b/app/server-health/controllers/unit-id-controller.js
new file mode 100644
index 0000000..5494c61
--- /dev/null
+++ b/app/server-health/controllers/unit-id-controller.js
@@ -0,0 +1,46 @@
+/**
+ * Controller for unit Id
+ *
+ * @module app/serverHealth
+ * @exports unitIdController
+ * @name unitIdController
+ * @version 0.1.0
+ */
+
+window.angular && (function (angular) {
+ 'use strict';
+
+ angular
+ .module('app.serverHealth')
+ .controller('unitIdController', [
+ '$scope',
+ '$window',
+ 'APIUtils',
+ 'dataService',
+ function($scope, $window, APIUtils, dataService, userModel){
+ $scope.dataService = dataService;
+
+ $scope.getLEDState = function(){
+ APIUtils.getLEDState(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){
+ });
+ }
+
+ $scope.getLEDState();
+ }
+ ]
+ );
+
+})(angular);