瀏覽代碼

AMBARI-11254. Incorrect Graph layout in Preview when zooming in.(xiwang)

Xi Wang 10 年之前
父節點
當前提交
d37bef923b

+ 3 - 0
ambari-web/app/styles/enhanced_service_dashboard.less

@@ -161,6 +161,9 @@
       .title {
         height: 0;
       }
+      .chart-container {
+        cursor: default;
+      }
     }
   }
 }

+ 1 - 1
ambari-web/app/views/common/chart/linear_time.js

@@ -674,7 +674,7 @@ App.ChartLinearTimeView = Ember.View.extend({
   },
 
   showGraphInPopup: function() {
-    if(!this.get('hasData')) {
+    if(!this.get('hasData') || this.get('isPreview')) {
       return;
     }
 

+ 3 - 0
ambari-web/app/views/common/widget/graph_widget_view.js

@@ -263,6 +263,9 @@ App.GraphWidgetView = Em.View.extend(App.WidgetMixin, {
     description: function () {
       return this.get('parentView.content.description');
     }.property('parentView.content.description'),
+    isPreview: function () {
+      return this.get('parentView.isPreview');
+    }.property('parentView.isPreview'),
 
     /**
      * set custom time range for graph widget

+ 1 - 1
ambari-web/app/views/main/service/widgets/create/wizard_view.js

@@ -28,7 +28,7 @@ App.WidgetWizardView = Em.View.extend(App.WizardMenuMixin, {
   previewWidgetClass: function () {
     switch (this.get('controller.content.widgetType')) {
       case 'GRAPH':
-        return App.GraphWidgetView.extend(App.WidgetPreviewMixin);
+        return App.GraphWidgetView.extend(App.WidgetPreviewMixin, {isPreview: true});
       case 'TEMPLATE':
         return App.TemplateWidgetView.extend(App.WidgetPreviewMixin);
       case 'NUMBER':