You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by is...@apache.org on 2018/06/05 20:10:02 UTC

[ambari] branch branch-feature-AMBARI-14714 updated: [AMBARI-24033] Use servicegroup api instead of service to show installed services in the UI.

This is an automated email from the ASF dual-hosted git repository.

ishanbha pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714 by this push:
     new 4e4cbb2  [AMBARI-24033] Use servicegroup api instead of service to show installed services in the UI.
4e4cbb2 is described below

commit 4e4cbb2bdc362c23b42af1e7dcdaf7f4576eacae
Author: Ishan Bhatt <is...@gmail.com>
AuthorDate: Mon Jun 4 17:17:04 2018 -0700

    [AMBARI-24033] Use servicegroup api instead of service to show installed services in the UI.
---
 ambari-web/app/controllers/global/update_controller.js | 2 +-
 ambari-web/app/mappers/service_mapper.js               | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js
index 5f38eef..6f06ad2 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -544,7 +544,7 @@ App.UpdateController = Em.Controller.extend({
 
   updateServices: function (callback) {
     var testUrl = '/data/services/HDP2/services.json';
-    var componentConfigUrl = this.getUrl(testUrl, '/services?fields=ServiceInfo/state,ServiceInfo/maintenance_state,components');
+    var componentConfigUrl = this.getUrl(testUrl, '/servicegroups?fields=services/ServiceInfo/state,services/ServiceInfo/maintenance_state,services/components');
     App.HttpClient.get(componentConfigUrl, App.serviceMapper, {
       complete: callback
     });
diff --git a/ambari-web/app/mappers/service_mapper.js b/ambari-web/app/mappers/service_mapper.js
index 1d00d84..99d8adb 100644
--- a/ambari-web/app/mappers/service_mapper.js
+++ b/ambari-web/app/mappers/service_mapper.js
@@ -32,7 +32,12 @@ App.serviceMapper = App.QuickDataMapper.create({
     console.time("App.serviceMapper execution time");
     var self = this;
     var passiveStateMap = this.get('passiveStateMap');
-    json.items.forEach(function (service) {
+    var services = [];
+    json.items.forEach(function (item) {
+      services = services.concat(item.services);
+    });
+
+    services.forEach(function (service) {
       if(!service.ServiceInfo.service_name.includes('CLIENT')) {
         var cachedService = App.cache['services'].findProperty('ServiceInfo.service_name', service.ServiceInfo.service_name);
         if (cachedService) {

-- 
To stop receiving notification emails like this one, please contact
ishanbha@apache.org.