implement refresh token

This commit is contained in:
2024-07-16 13:46:58 +07:00
parent fa12fcec50
commit 6b91c937ab
27 changed files with 113 additions and 65 deletions

View File

@@ -41,7 +41,8 @@ export class AddEditDeviceComponent implements OnInit{
) {}
ngOnInit() {
this.authService.checkTokenAndRedirect();
this.authService.startTokenCheck();
this.authService.startTrackingActivity();
this.route.params.subscribe(params => {
const id = params['id'];
this.deviceId = id;
@@ -79,27 +80,27 @@ export class AddEditDeviceComponent implements OnInit{
const dataCategory = data.data.find(
(item) => item.name === "master_category"
).headerDetailParam;
this.dataMasterCategori = dataCategory.filter(item => item.statusName.toLowerCase() === "aktif")
this.dataMasterCategori = dataCategory.filter(item => item.statusName.toLowerCase() === "aktif" || item.status.toLowerCase() === "71")
const dataVoltage = data.data.find(
(item) => item.name === "master_voltage"
).headerDetailParam;
this.dataMasterVoltage = dataVoltage.filter(item => item.statusName.toLowerCase() === "aktif")
this.dataMasterVoltage = dataVoltage.filter(item => item.statusName.toLowerCase() === "aktif" || item.status.toLowerCase() === "71")
const dataType = data.data.find(
(item) => item.name === "master_type"
).headerDetailParam;
this.dataMasterType = dataType.filter(item => item.statusName.toLowerCase() === "aktif")
this.dataMasterType = dataType.filter(item => item.statusName.toLowerCase() === "aktif" || item.status.toLowerCase() === "71")
const dataDuration = data.data.find(
(item) => item.name === "master_duration"
).headerDetailParam;
this.dataMasterDuration = dataDuration.filter(item => item.statusName.toLowerCase() === "aktif")
this.dataMasterDuration = dataDuration.filter(item => item.statusName.toLowerCase() === "aktif" || item.status.toLowerCase() === "71")
const dataStatus = data.data.find(
(item) => item.name === "master_status"
).headerDetailParam;
this.dataMasterStatus = dataStatus.filter(item => item.statusName.toLowerCase() === "aktif")
this.dataMasterStatus = dataStatus.filter(item => item.statusName.toLowerCase() === "aktif" || item.status.toLowerCase() === "71")
});
}

View File

@@ -38,7 +38,8 @@ export class DeviceControlComponent {
) {}
ngOnInit() {
this.authService.checkTokenAndRedirect();
this.authService.startTokenCheck();
this.authService.startTrackingActivity();
this.breadcrumb = {
mainlabel: "Device",
links: [

View File

@@ -53,7 +53,8 @@ export class DeviceComponent implements OnInit {
) {}
ngOnInit() {
this.authService.checkTokenAndRedirect();
this.authService.startTokenCheck();
this.authService.startTrackingActivity();
this.breadcrumb = {
mainlabel: "Device",
links: [