Added Login, TTS Login, Policies
This commit is contained in:
@ -4,7 +4,11 @@ export enum PolicyScope {
|
||||
}
|
||||
|
||||
export class Policy {
|
||||
constructor(public path: string, public usage: number, public span: number, public editing: boolean = false, public isNew: boolean = false) {
|
||||
public old_path: string|undefined;
|
||||
public old_usage: number|undefined;
|
||||
public old_span: number|undefined;
|
||||
|
||||
constructor(public id: string, public group_id: string, public path: string, public usage: number, public span: number, public temp_group_name: string = "", public editing: boolean = false, public isNew: boolean = false) {
|
||||
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import EventService from '../EventService';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@ -8,7 +9,7 @@ export class ApiAuthenticationService {
|
||||
private authenticated: boolean;
|
||||
private lastCheck: Date;
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
constructor(private http: HttpClient, private events: EventService) {
|
||||
this.authenticated = false;
|
||||
this.lastCheck = new Date();
|
||||
}
|
||||
@ -36,7 +37,16 @@ export class ApiAuthenticationService {
|
||||
}
|
||||
|
||||
private updateAuthenticated(value: boolean) {
|
||||
const previous = this.authenticated;
|
||||
this.authenticated = value;
|
||||
this.lastCheck = new Date();
|
||||
|
||||
if (previous != value) {
|
||||
if (value) {
|
||||
this.events.emit('login', null);
|
||||
} else {
|
||||
this.events.emit('logoff', null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user