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

only show first/last aggregate when timescaledb is enabled

Sven Klemm 7 лет назад
Родитель
Сommit
c90eb45cef
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      public/app/plugins/datasource/postgres/query_ctrl.ts

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

@@ -114,9 +114,11 @@ export class PostgresQueryCtrl extends QueryCtrl {
       ],
     };
 
-    // first and last are timescaledb specific
-    aggregates.submenu.push({ text: 'First', value: 'first' });
-    aggregates.submenu.push({ text: 'Last', value: 'last' });
+    // first and last aggregate are timescaledb specific
+    if (this.datasource.jsonData.timescaledb === true) {
+      aggregates.submenu.push({ text: 'First', value: 'first' });
+      aggregates.submenu.push({ text: 'Last', value: 'last' });
+    }
 
     this.selectMenu.push(aggregates);