Browse Source

ui++

master
Coin de Gamma 5 years ago
parent
commit
42fd749b1b
  1. 18
      src/datasource/module.ts
  2. 2
      src/datasource/partials/config.html

18
src/datasource/module.ts

@ -10,24 +10,24 @@ class HasticConfigCtrl {
public static template = configTemplate; public static template = configTemplate;
public accessOptions: any[]; public accessOptions: any[];
public current: any; public current: any;
private showAccessHelp: boolean = false;
constructor() { constructor($scope) {
console.log(this); console.log(this);
this.accessOptions = [ this.accessOptions = [
{ key: 'proxy', value: 'Server (Default)' }, { key: 'proxy', value: 'Server (Default)' },
{ key: 'direct', value: 'Browser'} { key: 'direct', value: 'Browser'}
]; ];
//this.current.access = 'proxy'; 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() { 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;
} }
} }

2
src/datasource/partials/config.html

@ -8,10 +8,10 @@
class="gf-form-input" type="text" class="gf-form-input" type="text"
placeholder="http://localhost:8000" placeholder="http://localhost:8000"
ng-model='current.url' ng-model='current.url'
bs-typeahead="getSuggestUrls"
min-length="0" min-length="0"
ng-pattern="/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/" ng-pattern="/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/"
required required
ng-blur="ctrl.normalizeUrl"
/> />
<info-popover mode="right-absolute"> <info-popover mode="right-absolute">
<p>Specify a complete Hastic Server HTTP URL (for example http://your_hastic_server:8080)</p> <p>Specify a complete Hastic Server HTTP URL (for example http://your_hastic_server:8080)</p>

Loading…
Cancel
Save