From 618701528165d746993a599ebd9c19e859b07f8f Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Sun, 3 Mar 2019 15:43:30 +0300 Subject: [PATCH] ds config ui++ --- src/datasource/module.ts | 13 +++++----- src/datasource/partials/config.html | 38 +++++++++++++++++------------ 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/datasource/module.ts b/src/datasource/module.ts index 9841c87..a9d2daa 100644 --- a/src/datasource/module.ts +++ b/src/datasource/module.ts @@ -8,17 +8,17 @@ import configTemplate from './partials/config.html'; class HasticConfigCtrl { public static template = configTemplate; - public accessOptions: any[]; + public ACCESS_OPTIONS: any[] = [ + { key: 'proxy', value: 'Server (Default)' }, + { key: 'direct', value: 'Browser'} + ]; + public current: any; private showAccessHelp: boolean = false; constructor($scope) { - console.log(this); - this.accessOptions = [ - { key: 'proxy', value: 'Server (Default)' }, - { key: 'direct', value: 'Browser'} - ]; this.current.access = 'proxy'; + console.log($scope); } normalizeUrl() { @@ -26,7 +26,6 @@ class HasticConfigCtrl { } toggleAccessHelp() { - console.log('hey'); this.showAccessHelp = !this.showAccessHelp; } diff --git a/src/datasource/partials/config.html b/src/datasource/partials/config.html index 63ec451..3345562 100644 --- a/src/datasource/partials/config.html +++ b/src/datasource/partials/config.html @@ -11,7 +11,7 @@ min-length="0" ng-pattern="/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/" required - ng-blur="ctrl.normalizeUrl" + ng-blur="ctrl.normalizeUrl()" />

Specify a complete Hastic Server HTTP URL (for example http://your_hastic_server:8080)

@@ -39,39 +39,45 @@
-
-
+

- Access mode controls how requests to the data source will be handled. - Server should be the preferred way if nothing else stated. + Access mode controls how requests to the data source will be handled. + Server access mode should be the preferred way if nothing else stated.

Server access mode (Default):

- All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source - and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements. - The URL needs to be accessible from the grafana backend/server if you select this access mode. + All requests will be made from the browser to Grafana backend/server which in turn will + forward the requests to the data source and by that circumvent possible + Cross-Origin Resource Sharing (CORS) requirements. + The URL needs to be accessible from the grafana backend/server if you select this access mode.

Browser access mode:

- All requests will be made from the browser directly to the data source and may be subject to - Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this - access mode. + All requests will be made from the browser directly to the data source and may be subject to + Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser + if you select this access mode. +

Whitelisted Cookies - - + - Grafana Proxy deletes forwarded cookies by default. Specify cookies by name that should be forwarded to the data source. + Grafana Proxy deletes forwarded cookies by default. Specify cookies by name + that should be forwarded to the data source.