Last power operation
Displays correct power operation time. In the case
that there has not been a power operation, 'not
available' is displayed.
Resolves openbmc/openbmc#2957
Tested: The GUI displayed 'not available' when it
received a 0 value and the correct date when an
epoch was recieved.
Signed-off-by: beccabroek <rebecca.shaw@ibm.com>
Change-Id: I9573a1cdcd31ba4c02888bd46d195c91fdb916a7
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index cfdd39f..37aacf6 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -653,6 +653,21 @@
}
});
},
+ getLastPowerTime: function() {
+ return $http({
+ method: 'GET',
+ url: DataService.getHost() +
+ '/xyz/openbmc_project/state/chassis0/attr/LastStateChangeTime',
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ withCredentials: true
+ })
+ .then(function(response) {
+ return response.data;
+ });
+ },
getLogs: function() {
var deferred = $q.defer();
$http({