diff options
| author | Dixsie Wolmers <dixsiew@gmail.com> | 2019-10-04 12:49:32 -0500 |
|---|---|---|
| committer | Gunnar Mills <gmills@us.ibm.com> | 2019-10-11 20:02:24 +0000 |
| commit | ff7f10685d0ce060bf2d1a90872c0c6016711b41 (patch) | |
| tree | e424c2bf61d3fbe5dc7989c50ef52da005341757 | |
| parent | de2da859cb4d8e8bbdb4470794ffbf7198de4812 (diff) | |
| download | phosphor-webui-ff7f10685d0ce060bf2d1a90872c0c6016711b41.tar.gz phosphor-webui-ff7f10685d0ce060bf2d1a90872c0c6016711b41.zip | |
Add error message when image fails to activate
If an image fails to activate a toast message is displayed.
Tested on Witherspoon with master build image and
field mode turned on. When image fails to activate,
the failed activation status response returns a 200
ok and an error toast is displayed. Tested with field
mode turned off to verify image activates and BMC reboots.
Tested on all browsers.
Signed-off-by: Dixsie Wolmers <dixsiew@gmail.com>
Change-Id: I517f184549673e7b807cc0a553a728d05d6dbba1
| -rw-r--r-- | app/configuration/controllers/firmware-controller.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/configuration/controllers/firmware-controller.js b/app/configuration/controllers/firmware-controller.js index 6f8ec07..89cf9c6 100644 --- a/app/configuration/controllers/firmware-controller.js +++ b/app/configuration/controllers/firmware-controller.js @@ -59,12 +59,18 @@ window.angular && (function(angular) { pollActivationTimer = $interval(function() { APIUtils.getActivation(imageId).then( function(state) { - //@TODO: display an error message if image "Failed" - if (((/\.Active$/).test(state.data)) || - ((/\.Failed$/).test(state.data))) { + let imageStateActive = (/\.Active$/).test(state.data); + let imageStateFailed = (/\.Failed$/).test(state.data); + if (imageStateActive || imageStateFailed) { $interval.cancel(pollActivationTimer); pollActivationTimer = undefined; + } + if (imageStateActive) { deferred.resolve(state); + } else if (imageStateFailed) { + console.log('Image failed to activate: ', imageStateFailed); + toastService.error('Image failed to activate.'); + deferred.reject(error); } }, function(error) { |

