Change navigation structure
Change-Id: I12c819293ce1eda188dc9f257ae9370f1b73cb18
Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
diff --git a/app/server-control/controllers/bmc-reboot-controller.js b/app/server-control/controllers/bmc-reboot-controller.js
new file mode 100644
index 0000000..a28c6ad
--- /dev/null
+++ b/app/server-control/controllers/bmc-reboot-controller.js
@@ -0,0 +1,40 @@
+/**
+ * Controller for bmc-reboot
+ *
+ * @module app/serverControl
+ * @exports bmcRebootController
+ * @name bmcRebootController
+ * @version 0.1.0
+ */
+
+window.angular && (function (angular) {
+ 'use strict';
+
+ angular
+ .module('app.serverControl')
+ .controller('bmcRebootController', [
+ '$scope',
+ '$window',
+ 'APIUtils',
+ 'dataService',
+ function($scope, $window, APIUtils, dataService){
+ $scope.dataService = dataService;
+ $scope.confirm = false;
+ $scope.rebootConfirm = function(){
+ if($scope.confirm) {
+ return;
+ }
+ $scope.confirm = true;
+ };
+ $scope.reboot = function(){
+ dataService.setBootingState();
+ APIUtils.bmcReboot(function(response){
+ //@NOTE: using common event to reload server status, may be a better event listener name?
+ $scope.$emit('user-logged-in',{});
+ });
+ };
+ }
+ ]
+ );
+
+})(angular);