2017-11-02 15:19:12 +01:00
|
|
|
import { Component, OnInit} from '@angular/core';
|
2017-09-14 12:37:36 +02:00
|
|
|
import { ServerService } from './services/server.service';
|
|
|
|
import { FieldBase } from '../app/form/fields/field-base';
|
|
|
|
import { JsonObjest } from '../app/entities/JsonObject.class';
|
2017-11-01 18:18:27 +01:00
|
|
|
import { TokenService, TokenProvider } from './services/login/token.service';
|
|
|
|
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
|
|
|
import { MainSignInComponent } from './login/main-sign-in/main-sign-in.component';
|
2017-09-14 12:37:36 +02:00
|
|
|
|
2017-11-08 14:33:14 +01:00
|
|
|
import { AutocompleteRemoteComponent } from './form/fields/autocomplete-remote/autocomplete-remote.component';
|
|
|
|
|
|
|
|
|
2017-11-03 18:57:06 +01:00
|
|
|
declare var $ :any;
|
2017-09-14 12:37:36 +02:00
|
|
|
@Component({
|
|
|
|
selector: 'app-root',
|
2017-11-01 18:18:27 +01:00
|
|
|
templateUrl: './app.component.html',
|
|
|
|
styleUrls: ['./app.component.css'],
|
2017-09-14 12:37:36 +02:00
|
|
|
providers: []
|
|
|
|
})
|
2017-11-02 15:19:12 +01:00
|
|
|
export class AppComponent implements OnInit {
|
2017-09-14 12:37:36 +02:00
|
|
|
|
|
|
|
fields: any[];
|
|
|
|
|
2017-11-03 18:57:06 +01:00
|
|
|
sliderExpanded : boolean = false;
|
2017-11-01 18:18:27 +01:00
|
|
|
|
|
|
|
constructor(private tokenService : TokenService, private router: Router) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-11-02 15:19:12 +01:00
|
|
|
ngOnInit() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-11-01 18:18:27 +01:00
|
|
|
|
2017-11-03 18:57:06 +01:00
|
|
|
|
|
|
|
slideNav(){
|
|
|
|
|
|
|
|
$("#appSidebar").toggleClass("expanded");
|
|
|
|
$("#appBody").toggleClass("expanded");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-01 18:18:27 +01:00
|
|
|
//loggedInAs : string = null;
|
|
|
|
|
|
|
|
showLogin : boolean = false;
|
|
|
|
|
|
|
|
|
|
|
|
login(){
|
|
|
|
//redirect to login page
|
2017-11-02 10:11:29 +01:00
|
|
|
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
2017-11-01 18:18:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
logout(){
|
|
|
|
this.tokenService.logout();
|
2017-11-02 10:11:29 +01:00
|
|
|
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
2017-11-01 18:18:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-09-14 12:37:36 +02:00
|
|
|
}
|
2017-11-01 18:18:27 +01:00
|
|
|
|