diff --git a/src/datasource/module.ts b/src/datasource/module.ts index 1399371..9841c87 100644 --- a/src/datasource/module.ts +++ b/src/datasource/module.ts @@ -10,24 +10,24 @@ class HasticConfigCtrl { public static template = configTemplate; public accessOptions: any[]; public current: any; + private showAccessHelp: boolean = false; - constructor() { + constructor($scope) { console.log(this); this.accessOptions = [ { key: 'proxy', value: 'Server (Default)' }, { key: 'direct', value: 'Browser'} ]; - //this.current.access = 'proxy'; - // if(this.appModel.jsonData === undefined) { - // this.appModel.jsonData = {}; - // } - - // this.appEditCtrl.setPreUpdateHook(this.preUpdate.bind(this)); - // this.appEditCtrl.setPostUpdateHook(this.postUpdate.bind(this)); + this.current.access = 'proxy'; } normalizeUrl() { - // this.appModel.jsonData.hasticServerUrl = normalizeUrl(this.appModel.jsonData.hasticServerUrl); + this.current.url = normalizeUrl(this.current.url); + } + + toggleAccessHelp() { + console.log('hey'); + this.showAccessHelp = !this.showAccessHelp; } } diff --git a/src/datasource/partials/config.html b/src/datasource/partials/config.html index 83f9a4f..63ec451 100644 --- a/src/datasource/partials/config.html +++ b/src/datasource/partials/config.html @@ -8,10 +8,10 @@ class="gf-form-input" type="text" placeholder="http://localhost:8000" ng-model='current.url' - bs-typeahead="getSuggestUrls" min-length="0" ng-pattern="/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/" required + ng-blur="ctrl.normalizeUrl" />

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