Ver Fonte

AMBARI-7108. JS error after stop all services from Dashboard page. (onechiporenko)

Oleg Nechiporenko há 10 anos atrás
pai
commit
b6abb3d19a

+ 5 - 2
ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js

@@ -68,8 +68,11 @@ App.PieChartDashboardWidgetView = App.DashboardWidgetView.extend({
 
   calc: function() {
     this.set('hiddenInfo', this.calcHiddenInfo());
-    this.set('isPieExist', this.calcIsPieExists());
-    this.set('dataForPieChart', this.calcDataForPieChart());
+    var isPieExists = this.calcIsPieExists();
+    this.set('isPieExist', isPieExists);
+    if (isPieExists) {
+      this.set('dataForPieChart', this.calcDataForPieChart());
+    }
   },
 
   didInsertElement: function() {