浏览代码

AMBARI-6405. Move Wizard: get stuck if wizard is running second time for the same component without page refresh. (akovalenko)

Aleksandr Kovalenko 11 年之前
父节点
当前提交
e9d8264a55
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      ambari-web/app/mappers/service_metrics_mapper.js

+ 9 - 0
ambari-web/app/mappers/service_metrics_mapper.js

@@ -206,6 +206,15 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
 
 
       this.computeAdditionalRelations(hostComponents, services);
       this.computeAdditionalRelations(hostComponents, services);
       //load master components to model
       //load master components to model
+      App.HostComponent.find().filterProperty('isMaster').forEach(function (hostComponent) {
+        if (hostComponent && !hostComponents.someProperty('id', hostComponent.get('id'))) {
+          this.deleteRecord(hostComponent);
+          var serviceCache = services.findProperty('ServiceInfo.service_name', hostComponent.get('service.serviceName'));
+          if (serviceCache) {
+            serviceCache.host_components = serviceCache.host_components.without(hostComponent.get('id'));
+          }
+        }
+      }, this);
       App.store.loadMany(this.get('model3'), hostComponents);
       App.store.loadMany(this.get('model3'), hostComponents);
 
 
       //parse service metrics from components
       //parse service metrics from components