Update the GUI after an image activated
When activating an image the firmware page does not refresh
after the image is activated and show the image as "Active".
To get the image to show as "Active", a user must refresh the
page.
The activating image code now waits until the image is activated
and the REST call returns "Active" or "Failed" and then refreshes
the page.
Resolves openbmc/openbmc#2966
Tested: Activated an image and verfied it refreshed after
"Active".
Change-Id: Ic68e3c9e6cb5c2ea4f5d66f48fd09252c4807f26
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 980f1a2..c20b2ca 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -634,6 +634,19 @@
console.log(error);
});
},
+ getActivation: function(imageId){
+ return $http({
+ method: 'GET',
+ url: DataService.getHost() + "/xyz/openbmc_project/software/" + imageId + "/attr/Activation",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ withCredentials: true
+ }).then(function(response){
+ return response.data;
+ });
+ },
getFirmwares: function(){
var deferred = $q.defer();
$http({