Przeglądaj źródła

add postgresVersion to postgres settings

Sven Klemm 7 lat temu
rodzic
commit
1161c7bc3e

+ 7 - 1
public/app/plugins/datasource/postgres/module.ts

@@ -8,8 +8,14 @@ class PostgresConfigCtrl {
 
   /** @ngInject **/
   constructor($scope) {
-    this.current.jsonData.sslmode = this.current.jsonData.sslmode || 'require';
+    this.current.jsonData.sslmode = this.current.jsonData.sslmode || 'verify-full';
   }
+
+  /* the values are chosen to be equivalent to `select current_setting('server_version_num');` */
+  postgresVersions = [
+    { name: '8.0+', value: 80000 },
+    { name: '8.1+', value: 80100 },
+  ];
 }
 
 const defaultQuery = `SELECT

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

@@ -38,6 +38,22 @@
 	</div>
 </div>
 
+<h3 class="page-heading">PostgreSQL details</h3>
+
+<div class="gf-form-group">
+	<div class="gf-form">
+		<span class="gf-form-label width-8">
+      Version
+      <info-popover mode="right-normal" position="top center">
+        This option controls what functions are used when expanding grafana macros.
+      </info-popover>
+    </span>
+    <span class="gf-form-select-wrapper">
+        <select class="gf-form-input gf-size-auto" ng-model="ctrl.current.jsonData.postgresVersion" ng-options="f.value as f.name for f in ctrl.postgresVersions"></select>
+    </span>
+	</div>
+</div>
+
 <div class="gf-form-group">
 	<div class="grafana-info-box">
 		<h5>User Permission</h5>