Bläddra i källkod

AMBARI-1927. In background operations popup, requests with same context are showing hosts/tasks info from last request

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1468265 13f79535-47bb-0310-9956-ffa450edef68
Jaimin Jetly 12 år sedan
förälder
incheckning
61cd9b37d0
2 ändrade filer med 16 tillägg och 2 borttagningar
  1. 3 0
      CHANGES.txt
  2. 13 2
      ambari-web/app/utils/host_progress_popup.js

+ 3 - 0
CHANGES.txt

@@ -730,6 +730,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1927. In background operations popup, requests with same context
+ are showing hosts/tasks info from last request. (yusaku via jaimin)
+
  AMBARI-1907. Service check commands are not getting created on a
  cluster install -> start. (yusaku via jaimin)
 

+ 13 - 2
ambari-web/app/utils/host_progress_popup.js

@@ -27,6 +27,7 @@ App.HostPopup = Em.Object.create({
   hosts: null,
   inputData: null,
   serviceName: "",
+  currentServiceId: null,
   popupHeaderName: "",
   serviceController: null,
   showServices: false,
@@ -130,6 +131,7 @@ App.HostPopup = Em.Object.create({
       this.set("servicesInfo", null);
       this.get("inputData").forEach(function (service) {
         var newService = Ember.Object.create({
+          id: service.id,
           displayName: service.displayName,
           detailMessage: service.detailMessage,
           message: service.message,
@@ -182,8 +184,16 @@ App.HostPopup = Em.Object.create({
           hosts.push.apply(hosts, host);
         });
       } else {
-        hostsData = hostsData.filterProperty("name", this.get("serviceName")).objectAt(0);
-        hosts = hostsData.hosts;
+        if(this.get("currentServiceId") != null){
+          hostsData = hostsData.filterProperty("id", this.get("currentServiceId")).objectAt(0);
+        }else{
+          hostsData = hostsData.filterProperty("name", this.get("serviceName")).objectAt(0);
+        }
+
+        if(hostsData.hosts){
+          hosts = hostsData.hosts;
+        }
+
         hosts.setEach("serviceName", this.get("serviceName"));
       }
     }
@@ -528,6 +538,7 @@ App.HostPopup = Em.Object.create({
          */
         gotoHosts: function (event, context) {
           this.get("controller").set("serviceName", event.context.get("name"));
+          this.get("controller").set("currentServiceId", event.context.get("id"));
           this.get("controller").onHostUpdate();
           var servicesInfo = this.get("controller.hosts");
           if (servicesInfo.length) {