Sfoglia il codice sorgente

improve description for timescaledb option

Sven Klemm 7 anni fa
parent
commit
62d82920e6

+ 6 - 0
public/app/plugins/datasource/postgres/config_ctrl.ts

@@ -5,12 +5,14 @@ export class PostgresConfigCtrl {
 
   current: any;
   datasourceSrv: any;
+  showTimescaleDBHelp: boolean;
 
   /** @ngInject **/
   constructor($scope, datasourceSrv) {
     this.datasourceSrv = datasourceSrv;
     this.current.jsonData.sslmode = this.current.jsonData.sslmode || 'verify-full';
     this.current.jsonData.postgresVersion = this.current.jsonData.postgresVersion || 903;
+    this.showTimescaleDBHelp = false;
     this.autoDetectFeatures();
   }
 
@@ -46,6 +48,10 @@ export class PostgresConfigCtrl {
     });
   }
 
+  toggleTimescaleDBHelp() {
+    this.showTimescaleDBHelp = !this.showTimescaleDBHelp;
+  }
+
   // the value portion is derived from postgres server_version_num/100
   postgresVersions = [
     { name: '9.3', value: 903 },

+ 16 - 1
public/app/plugins/datasource/postgres/partials/config.html

@@ -65,10 +65,25 @@
 		</span>
 	</div>
 	<div class="gf-form">
-		<gf-form-switch class="gf-form" label="TimescaleDB" tooltip="Use TimescaleDB features (e.g., time_bucket) in Grafana" label-class="width-9" checked="ctrl.current.jsonData.timescaledb" switch-class="max-width-6"></gf-form-switch>
+		<gf-form-switch class="gf-form" label="TimescaleDB" label-class="width-9" checked="ctrl.current.jsonData.timescaledb" switch-class="max-width-6"></gf-form-switch>
+    <label class="gf-form-label query-keyword pointer" ng-click="ctrl.toggleTimescaleDBHelp()">
+      Help&nbsp;
+      <i class="fa fa-caret-down" ng-show="ctrl.showTimescaleDBHelp"></i>
+      <i class="fa fa-caret-right" ng-hide="ctrl.showTimescaleDBHelp">&nbsp;</i>
+    </label>
 	</div>
+
+<div class="grafana-info-box alert alert-info" ng-show="ctrl.showTimescaleDBHelp">
+  <div class="alert-body">
+    <p>
+			<a href="https://www.timescale.com/" class="pointer" target="_blank">TimescaleDB</a> is a time-series database built as a PostgreSQL extension. If enabled, Grafana will use <code>time_bucket</code> in the <code>$__timeGroup</code> macro and display TimescaleDB specific aggregate functions in the query builder.
+    </p>
+  </div>
+</div>
+
 </div>
 
+
 <div class="gf-form-group">
 	<div class="grafana-info-box">
 		<h5>User Permission</h5>