From bc05106f5b6c28db54b5f0e66f41e22425dc7137 Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Sun, 3 Mar 2019 03:14:01 +0300 Subject: [PATCH] ds config page++ --- src/datasource/datasource.ts | 1 + src/datasource/module.ts | 24 ++++++++++++++++++++++++ src/datasource/partials/config.html | 25 +++++++++++++++++-------- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/datasource/datasource.ts b/src/datasource/datasource.ts index d343af8..ceecb23 100644 --- a/src/datasource/datasource.ts +++ b/src/datasource/datasource.ts @@ -2,6 +2,7 @@ export class HasticDatasource { /** @ngInject */ constructor(public instanceSettings: any) { + } async query(options: any) { diff --git a/src/datasource/module.ts b/src/datasource/module.ts index 263a3b0..1399371 100644 --- a/src/datasource/module.ts +++ b/src/datasource/module.ts @@ -1,11 +1,35 @@ import { HasticDatasource } from './datasource'; import { HasticQueryCtrl } from './query_ctrl'; +import { normalizeUrl } from '../utlis'; + import configTemplate from './partials/config.html'; class HasticConfigCtrl { public static template = configTemplate; + public accessOptions: any[]; + public current: any; + + constructor() { + 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)); + } + + normalizeUrl() { + // this.appModel.jsonData.hasticServerUrl = normalizeUrl(this.appModel.jsonData.hasticServerUrl); + } + } export { diff --git a/src/datasource/partials/config.html b/src/datasource/partials/config.html index 9802a49..83f9a4f 100644 --- a/src/datasource/partials/config.html +++ b/src/datasource/partials/config.html @@ -3,13 +3,18 @@
- URL - + Hastic Server URL + -

Specify a complete HTTP URL (for example http://your_server:8080)

+

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

Your access method is Browser, this means the URL needs to be accessible from the browser. @@ -22,11 +27,15 @@
-
+
Access
- +