You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
724 B
33 lines
724 B
5 years ago
|
import { normalizeUrl } from '../utlis';
|
||
|
import configTemplate from './partials/config.html';
|
||
|
|
||
|
|
||
|
export class HasticConfigCtrl {
|
||
|
public static template = configTemplate;
|
||
|
public ACCESS_OPTIONS = [
|
||
|
{ key: 'proxy', value: 'Server (Default)' },
|
||
|
{ key: 'direct', value: 'Browser' }
|
||
|
];
|
||
|
|
||
|
private showAccessHelp: boolean = false;
|
||
|
|
||
|
constructor(private $scope: any) {
|
||
|
if(this.$scope.current === undefined) {
|
||
|
this.$scope.current = {
|
||
|
access: 'proxy'
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
normalizeUrl() {
|
||
|
if(this.$scope.current.url === '') {
|
||
|
return;
|
||
|
}
|
||
|
this.$scope.current.url = normalizeUrl(this.$scope.current.url);
|
||
|
}
|
||
|
|
||
|
toggleAccessHelp() {
|
||
|
this.showAccessHelp = !this.showAccessHelp;
|
||
|
}
|
||
|
}
|