Browse Source

fix new setting default value handling.

Ramiro Morales 7 years ago
parent
commit
90de703ef2

+ 10 - 0
public/app/plugins/datasource/mssql/config_ctrl.ts

@@ -0,0 +1,10 @@
+export class MssqlConfigCtrl {
+  static templateUrl = 'partials/config.html';
+
+  current: any;
+
+  /** @ngInject */
+  constructor($scope) {
+    this.current.jsonData.encrypt = this.current.jsonData.encrypt || 'false';
+  }
+}

+ 1 - 4
public/app/plugins/datasource/mssql/module.ts

@@ -1,9 +1,6 @@
 import { MssqlDatasource } from './datasource';
 import { MssqlDatasource } from './datasource';
 import { MssqlQueryCtrl } from './query_ctrl';
 import { MssqlQueryCtrl } from './query_ctrl';
-
-class MssqlConfigCtrl {
-  static templateUrl = 'partials/config.html';
-}
+import { MssqlConfigCtrl } from './config_ctrl';
 
 
 const defaultQuery = `SELECT
 const defaultQuery = `SELECT
     <time_column> as time,
     <time_column> as time,

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

@@ -31,7 +31,7 @@
 	<div class="gf-form">
 	<div class="gf-form">
 		<label class="gf-form-label width-7">Encrypt</label>
 		<label class="gf-form-label width-7">Encrypt</label>
 		<div class="gf-form-select-wrapper max-width-15 gf-form-select-wrapper--has-help-icon">
 		<div class="gf-form-select-wrapper max-width-15 gf-form-select-wrapper--has-help-icon">
-			<select class="gf-form-input" ng-model="ctrl.current.jsondata.encrypt" ng-options="mode for mode in ['disable', 'false', 'true']" ng-init="ctrl.current.jsondata.encrypt"></select>
+			<select class="gf-form-input" ng-model="ctrl.current.jsonData.encrypt" ng-options="mode for mode in ['disable', 'false', 'true']" ng-init="ctrl.current.jsonData.encrypt"></select>
 			<info-popover mode="right-absolute">
 			<info-popover mode="right-absolute">
 				Determines whether or to which extent a secure SSL TCP/IP connection will be negotiated with the server.
 				Determines whether or to which extent a secure SSL TCP/IP connection will be negotiated with the server.
 				<ul>
 				<ul>