implement token exp
This commit is contained in:
@@ -2,6 +2,7 @@ import { Component, Input, OnInit } from "@angular/core";
|
||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||
import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap";
|
||||
import { BuildingService } from "../../service/monitoring-api.service";
|
||||
import { LoginService } from "../../service/login.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-add-edit-master",
|
||||
@@ -21,10 +22,12 @@ export class AddEditMasterComponent implements OnInit {
|
||||
constructor(
|
||||
public activeModal: NgbActiveModal,
|
||||
private fb: FormBuilder,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.createForm();
|
||||
this.dataListMaster();
|
||||
if (this.mode === "add") {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Component, Input } from "@angular/core";
|
||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||
import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap";
|
||||
import { BuildingService } from "../../../service/monitoring-api.service";
|
||||
import { LoginService } from "../../../service/login.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-add-edit-master-building",
|
||||
@@ -21,10 +22,12 @@ export class AddEditMasterBuildingComponent {
|
||||
constructor(
|
||||
public activeModal: NgbActiveModal,
|
||||
private fb: FormBuilder,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.createForm();
|
||||
this.listDataStatus();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { Router } from '@angular/router';
|
||||
import { BuildingService } from '../../service/monitoring-api.service';
|
||||
import { AddEditMasterBuildingComponent } from './add-edit-master-building/add-edit-master-building.component';
|
||||
import { LoginService } from '../../service/login.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-master-building',
|
||||
@@ -22,10 +23,12 @@ export class MasterBuildingComponent {
|
||||
private tableApiservice: TableApiService,
|
||||
private modalService: NgbModal,
|
||||
private router: Router,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Master Building",
|
||||
links: [
|
||||
|
||||
@@ -6,6 +6,7 @@ import { TableApiService } from "src/app/_services/table-api.service";
|
||||
import { BuildingService } from "../../service/monitoring-api.service";
|
||||
import { AddEditMasterComponent } from "../add-edit-master/add-edit-master.component";
|
||||
import { ToastrService } from "ngx-toastr";
|
||||
import { LoginService } from "../../service/login.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-master-category",
|
||||
@@ -27,10 +28,12 @@ export class MasterCategoryComponent implements OnInit {
|
||||
private modalService: NgbModal,
|
||||
private router: Router,
|
||||
private monitoringApiService: BuildingService,
|
||||
private toastr: ToastrService
|
||||
private toastr: ToastrService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Master Category",
|
||||
links: [
|
||||
|
||||
@@ -4,6 +4,7 @@ import { TableApiService } from 'src/app/_services/table-api.service';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { Router } from '@angular/router';
|
||||
import { BuildingService } from '../../service/monitoring-api.service';
|
||||
import { LoginService } from '../../service/login.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-master-duration-use',
|
||||
@@ -22,10 +23,12 @@ export class MasterDurationUseComponent {
|
||||
private tableApiservice: TableApiService,
|
||||
private modalService: NgbModal,
|
||||
private router: Router,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Master Duration Use",
|
||||
links: [
|
||||
|
||||
@@ -4,6 +4,7 @@ import { TableApiService } from 'src/app/_services/table-api.service';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { Router } from '@angular/router';
|
||||
import { BuildingService } from '../../service/monitoring-api.service';
|
||||
import { LoginService } from '../../service/login.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-master-floor',
|
||||
@@ -22,10 +23,12 @@ export class MasterFloorComponent {
|
||||
private tableApiservice: TableApiService,
|
||||
private modalService: NgbModal,
|
||||
private router: Router,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Master Floor",
|
||||
links: [
|
||||
|
||||
@@ -4,6 +4,7 @@ import { TableApiService } from 'src/app/_services/table-api.service';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { Router } from '@angular/router';
|
||||
import { BuildingService } from '../../service/monitoring-api.service';
|
||||
import { LoginService } from '../../service/login.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-master-role',
|
||||
@@ -22,10 +23,12 @@ export class MasterRoleComponent {
|
||||
private tableApiservice: TableApiService,
|
||||
private modalService: NgbModal,
|
||||
private router: Router,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Master Role",
|
||||
links: [
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Component, Input } from "@angular/core";
|
||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||
import { NgbActiveModal } from "@ng-bootstrap/ng-bootstrap";
|
||||
import { BuildingService } from "../../../service/monitoring-api.service";
|
||||
import { LoginService } from "../../../service/login.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-add-edit-master-room",
|
||||
@@ -24,10 +25,12 @@ export class AddEditMasterRoomComponent {
|
||||
constructor(
|
||||
public activeModal: NgbActiveModal,
|
||||
private fb: FormBuilder,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.createForm();
|
||||
this.listDataStatus();
|
||||
this.listDataBuilding();
|
||||
|
||||
@@ -4,6 +4,7 @@ import { TableApiService } from "src/app/_services/table-api.service";
|
||||
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
|
||||
import { Router } from "@angular/router";
|
||||
import { BuildingService } from "../../service/monitoring-api.service";
|
||||
import { LoginService } from "../../service/login.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-master-room",
|
||||
@@ -19,10 +20,12 @@ export class MasterRoomComponent {
|
||||
|
||||
constructor(
|
||||
private modalService: NgbModal,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Master Room",
|
||||
links: [
|
||||
|
||||
@@ -4,6 +4,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TableApiService } from 'src/app/_services/table-api.service';
|
||||
import { BuildingService } from '../../service/monitoring-api.service';
|
||||
import { AddEditMasterComponent } from '../add-edit-master/add-edit-master.component';
|
||||
import { LoginService } from '../../service/login.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-master-status',
|
||||
@@ -22,10 +23,12 @@ export class MasterStatusComponent {
|
||||
private tableApiservice: TableApiService,
|
||||
private modalService: NgbModal,
|
||||
private router: Router,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Master Status",
|
||||
links: [
|
||||
|
||||
@@ -4,6 +4,7 @@ import { TableApiService } from 'src/app/_services/table-api.service';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { Router } from '@angular/router';
|
||||
import { BuildingService } from '../../service/monitoring-api.service';
|
||||
import { LoginService } from '../../service/login.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-master-type',
|
||||
@@ -22,10 +23,12 @@ export class MasterTypeComponent {
|
||||
private tableApiservice: TableApiService,
|
||||
private modalService: NgbModal,
|
||||
private router: Router,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Master Type",
|
||||
links: [
|
||||
|
||||
@@ -4,6 +4,7 @@ import { TableApiService } from 'src/app/_services/table-api.service';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { Router } from '@angular/router';
|
||||
import { BuildingService } from '../../service/monitoring-api.service';
|
||||
import { LoginService } from '../../service/login.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-master-voltage',
|
||||
@@ -22,10 +23,12 @@ export class MasterVoltageComponent {
|
||||
private tableApiservice: TableApiService,
|
||||
private modalService: NgbModal,
|
||||
private router: Router,
|
||||
private monitoringApiService: BuildingService
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Master Voltage",
|
||||
links: [
|
||||
|
||||
Reference in New Issue
Block a user