diff options
author | Dixsie Wolmers <dixsiew@gmail.com> | 2019-04-26 12:58:51 -0500 |
---|---|---|
committer | Dixsie Wolmers <dixsiew@gmail.com> | 2019-05-13 09:02:00 -0500 |
commit | c57ec32f4a98897c69bccc5a2a5ac32dcbe67b46 (patch) | |
tree | ffbc1d28e3e43da325a775743605e9792d9c1ce4 /app/server-control | |
parent | 565efda513bbcda6c1c675eaebac6138782febe4 (diff) | |
download | phosphor-webui-c57ec32f4a98897c69bccc5a2a5ac32dcbe67b46.tar.gz phosphor-webui-c57ec32f4a98897c69bccc5a2a5ac32dcbe67b46.zip |
Fix activate image and reboot BMC
- Change bmcReboot callback in apiutils.js to HTTP request that returns a promise that is resolved with response object
- Remove emitted 'user-logged-in' as it is not needed to reboot BMC on firmware controller and bmc reboot controller
- Add toast message for visual confirmation of successful BMC reboot
Tested: On Server Configuration > Firmware page uploaded new image to activate and automatically reboot. After 2-3 minutes confirmed image activated and then BMC rebooted after image activation. Tested Server Control > Reboot BMC page by selecting Reboot BMC, confirmed BMC rebooted.
Resolves openbmc/phosphor-webui#79
Signed-off-by: Dixsie Wolmers <dixsiew@gmail.com>
Change-Id: Ied6809ad1ed6cc3c73ac5c818c7a06607810c396
Diffstat (limited to 'app/server-control')
-rw-r--r-- | app/server-control/controllers/bmc-reboot-controller.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/app/server-control/controllers/bmc-reboot-controller.js b/app/server-control/controllers/bmc-reboot-controller.js index ea50bf3..2282627 100644 --- a/app/server-control/controllers/bmc-reboot-controller.js +++ b/app/server-control/controllers/bmc-reboot-controller.js @@ -10,8 +10,8 @@ window.angular && (function(angular) { 'use strict'; angular.module('app.serverControl').controller('bmcRebootController', [ - '$scope', '$window', 'APIUtils', 'dataService', - function($scope, $window, APIUtils, dataService) { + '$scope', '$window', 'APIUtils', 'dataService', 'toastService', + function($scope, $window, APIUtils, dataService, toastService) { $scope.dataService = dataService; $scope.confirm = false; APIUtils.getLastRebootTime().then( @@ -28,12 +28,14 @@ window.angular && (function(angular) { $scope.confirm = true; }; $scope.reboot = function() { - dataService.setUnreachableState(); - APIUtils.bmcReboot(function(response) { - //@NOTE: using common event to reload server status, may be a better - // event listener name? - $scope.$emit('user-logged-in', {}); - }); + APIUtils.bmcReboot().then( + function(response) { + toastService.success('BMC is rebooting.') + }, + function(error) { + console.log(JSON.stringify(error)); + toastService.error('Unable to reboot BMC.'); + }); }; } ]); |