Add Time Owner and Time Mode

Added the Time Owner and the Time Mode
Created a new function that enumerates /xyz/openbmc_project/time.

Tested: See Time Mode and Time Owner
Change-Id: I3d1788bdb87b99028000d13c868b4a0cbfbc3006
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 042dde4..284d54e 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -1169,6 +1169,21 @@
                 return response.data;
               });
         },
+        getTime: function() {
+          return $http({
+                   method: 'GET',
+                   url: DataService.getHost() +
+                       '/xyz/openbmc_project/time/enumerate',
+                   headers: {
+                     'Accept': 'application/json',
+                     'Content-Type': 'application/json'
+                   },
+                   withCredentials: true
+                 })
+              .then(function(response) {
+                return response.data;
+              });
+        },
         getHardwares: function(callback) {
           $http({
             method: 'GET',
diff --git a/app/configuration/controllers/date-time-controller.html b/app/configuration/controllers/date-time-controller.html
index 33fc953..042b0c7 100644
--- a/app/configuration/controllers/date-time-controller.html
+++ b/app/configuration/controllers/date-time-controller.html
@@ -13,6 +13,14 @@
 					<p class="content-label">BMC Time</p>
 					<p class="courier-bold">{{bmc_time | date:'medium'}}</p>
 				</li>
+				<li class="date-time__metadata-block">
+					<p class="content-label">Time Owner</p>
+					<p class="courier-bold">{{time_owner}}</p>
+				</li>
+				<li class="date-time__metadata-block">
+					<p class="content-label">Time Mode</p>
+					<p class="courier-bold">{{time_mode}}</p>
+				</li>
 			</ul>
 		</div>
 	</fieldset>
diff --git a/app/configuration/controllers/date-time-controller.js b/app/configuration/controllers/date-time-controller.js
index 9eab295..5604df5 100644
--- a/app/configuration/controllers/date-time-controller.js
+++ b/app/configuration/controllers/date-time-controller.js
@@ -13,17 +13,27 @@
     '$scope', '$window', 'APIUtils',
     function($scope, $window, APIUtils) {
       $scope.bmc_time = '';
+      $scope.time_mode = '';
+      $scope.time_owner = '';
       $scope.loading = true;
 
-      var getBMCTimePromise = APIUtils.getBMCTime().then(
+      var getTimePromise = APIUtils.getTime().then(
           function(data) {
-            $scope.bmc_time = data.data.Elapsed / 1000;
+            $scope.bmc_time =
+                data.data['/xyz/openbmc_project/time/bmc'].Elapsed / 1000;
+            $scope.time_owner = data.data['/xyz/openbmc_project/time/owner']
+                                    .TimeOwner.split('.')
+                                    .pop();
+            $scope.time_mode =
+                data.data['/xyz/openbmc_project/time/sync_method']
+                    .TimeSyncMethod.split('.')
+                    .pop();
           },
           function(error) {
             console.log(JSON.stringify(error));
           });
 
-      getBMCTimePromise.finally(function() {
+      getTimePromise.finally(function() {
         $scope.loading = false;
       });
     }