Selaa lähdekoodia

get timecolumn datatype on timecolumn change

Sven Klemm 7 vuotta sitten
vanhempi
commit
c9bbdf244c
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      public/app/plugins/datasource/postgres/query_ctrl.ts

+ 5 - 0
public/app/plugins/datasource/postgres/query_ctrl.ts

@@ -190,6 +190,11 @@ export class PostgresQueryCtrl extends QueryCtrl {
 
   timeColumnChanged() {
     this.target.timeColumn = this.timeColumnSegment.value;
+    this.datasource.metricFindQuery(this.metaBuilder.buildDatatypeQuery(this.target.timeColumn)).then(result => {
+      if (result.length === 1) {
+        this.target.timeColumnType = result[0];
+      }
+    });
     this.panelCtrl.refresh();
   }