From 82875bb7c0fa15b29c286da3efbed15962e2b21f Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Mon, 4 Mar 2019 02:41:15 +0400 Subject: [PATCH] ds ui++ --- src/datasource/module.ts | 11 ++++++----- src/datasource/partials/config.html | 4 ++-- src/utlis.ts | 17 +++++++++-------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/datasource/module.ts b/src/datasource/module.ts index a9d2daa..3b01f9e 100644 --- a/src/datasource/module.ts +++ b/src/datasource/module.ts @@ -8,7 +8,7 @@ import configTemplate from './partials/config.html'; class HasticConfigCtrl { public static template = configTemplate; - public ACCESS_OPTIONS: any[] = [ + public ACCESS_OPTIONS = [ { key: 'proxy', value: 'Server (Default)' }, { key: 'direct', value: 'Browser'} ]; @@ -16,13 +16,14 @@ class HasticConfigCtrl { public current: any; private showAccessHelp: boolean = false; - constructor($scope) { - this.current.access = 'proxy'; - console.log($scope); + constructor(private $scope) { } normalizeUrl() { - this.current.url = normalizeUrl(this.current.url); + if(this.$scope.current.url === "") { + return; + } + this.$scope.current.url = normalizeUrl(this.$scope.current.url); } toggleAccessHelp() { diff --git a/src/datasource/partials/config.html b/src/datasource/partials/config.html index 3345562..1a98b3a 100644 --- a/src/datasource/partials/config.html +++ b/src/datasource/partials/config.html @@ -14,7 +14,7 @@ ng-blur="ctrl.normalizeUrl()" /> -

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

+

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

Your access method is Browser, this means the URL needs to be accessible from the browser. @@ -34,7 +34,7 @@