Просмотр исходного кода

fix: graphite issue with metricFind and sending from/until in normal format, fixes #8997

Torkel Ödegaard 8 лет назад
Родитель
Сommit
d3680d290c

+ 9 - 5
public/app/features/dashboard/save_as_modal.ts

@@ -44,12 +44,16 @@ export class SaveDashboardAsModalCtrl {
     this.clone.editable = true;
     this.clone.hideControls = false;
 
-    // remove alerts
-    this.clone.rows.forEach(row => {
-      row.panels.forEach(panel => {
-        delete panel.alert;
+    // remove alerts if source dashboard is already persisted
+    // do not want to create alert dupes
+    if (dashboard.id > 0) {
+      this.clone.rows.forEach(row => {
+        row.panels.forEach(panel => {
+          delete panel.thresholds;
+          delete panel.alert;
+        });
       });
-    });
+    }
 
     delete this.clone.autoUpdate;
   }

+ 2 - 2
public/app/plugins/datasource/graphite/datasource.ts

@@ -176,8 +176,8 @@ export function GraphiteDatasource(instanceSettings, $q, backendSrv, templateSrv
     };
 
     if (options && options.range) {
-      httpOptions.params.from = this.translateTime(options.range.raw.from, false);
-      httpOptions.params.until = this.translateTime(options.range.raw.to, true);
+      httpOptions.params.from = this.translateTime(options.range.from, false);
+      httpOptions.params.until = this.translateTime(options.range.to, true);
     }
 
     return this.doGraphiteRequest(httpOptions).then(results => {