|
|
@ -64,6 +64,7 @@ import { |
|
|
} from 'ionicons/icons'; |
|
|
} from 'ionicons/icons'; |
|
|
import ms, { StringValue } from 'ms'; |
|
|
import ms, { StringValue } from 'ms'; |
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; |
|
|
|
|
|
import { switchMap } from 'rxjs'; |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
changeDetection: ChangeDetectionStrategy.OnPush, |
|
|
changeDetection: ChangeDetectionStrategy.OnPush, |
|
|
@ -105,6 +106,8 @@ export class GfAdminOverviewComponent implements OnInit { |
|
|
protected readonly info: InfoItem; |
|
|
protected readonly info: InfoItem; |
|
|
protected isDataGatheringEnabled: boolean; |
|
|
protected isDataGatheringEnabled: boolean; |
|
|
protected isLoading = false; |
|
|
protected isLoading = false; |
|
|
|
|
|
protected isReadOnlyMode: boolean; |
|
|
|
|
|
protected isUserSignupEnabled: boolean; |
|
|
protected readonly permissions = permissions; |
|
|
protected readonly permissions = permissions; |
|
|
protected systemMessage: SystemMessage; |
|
|
protected systemMessage: SystemMessage; |
|
|
protected userCount: number; |
|
|
protected userCount: number; |
|
|
@ -179,6 +182,8 @@ export class GfAdminOverviewComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ngOnInit() { |
|
|
public ngOnInit() { |
|
|
|
|
|
this.isLoading = true; |
|
|
|
|
|
|
|
|
this.fetchAdminData(); |
|
|
this.fetchAdminData(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -270,9 +275,15 @@ export class GfAdminOverviewComponent implements OnInit { |
|
|
.flush() |
|
|
.flush() |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.subscribe(() => { |
|
|
.subscribe(() => { |
|
|
setTimeout(() => { |
|
|
this.dataService.updateInfo(); |
|
|
window.location.reload(); |
|
|
|
|
|
}, 300); |
|
|
this.snackBar.open( |
|
|
|
|
|
'✅ ' + $localize`Cache has been flushed.`, |
|
|
|
|
|
undefined, |
|
|
|
|
|
{ |
|
|
|
|
|
duration: ms('3 seconds') |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
confirmType: ConfirmationDialogType.Warn, |
|
|
confirmType: ConfirmationDialogType.Warn, |
|
|
@ -330,8 +341,6 @@ export class GfAdminOverviewComponent implements OnInit { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private fetchAdminData() { |
|
|
private fetchAdminData() { |
|
|
this.isLoading = true; |
|
|
|
|
|
|
|
|
|
|
|
this.adminService |
|
|
this.adminService |
|
|
.fetchAdminData() |
|
|
.fetchAdminData() |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
@ -344,6 +353,11 @@ export class GfAdminOverviewComponent implements OnInit { |
|
|
this.isDataGatheringEnabled = |
|
|
this.isDataGatheringEnabled = |
|
|
settings[PROPERTY_IS_DATA_GATHERING_ENABLED] === false ? false : true; |
|
|
settings[PROPERTY_IS_DATA_GATHERING_ENABLED] === false ? false : true; |
|
|
|
|
|
|
|
|
|
|
|
this.isReadOnlyMode = settings[PROPERTY_IS_READ_ONLY_MODE] === true; |
|
|
|
|
|
|
|
|
|
|
|
this.isUserSignupEnabled = |
|
|
|
|
|
settings[PROPERTY_IS_USER_SIGNUP_ENABLED] === false ? false : true; |
|
|
|
|
|
|
|
|
this.systemMessage = settings[PROPERTY_SYSTEM_MESSAGE] as SystemMessage; |
|
|
this.systemMessage = settings[PROPERTY_SYSTEM_MESSAGE] as SystemMessage; |
|
|
this.userCount = userCount; |
|
|
this.userCount = userCount; |
|
|
this.version = version; |
|
|
this.version = version; |
|
|
@ -372,11 +386,16 @@ export class GfAdminOverviewComponent implements OnInit { |
|
|
.putAdminSetting(key, { |
|
|
.putAdminSetting(key, { |
|
|
value: value || value === false ? JSON.stringify(value) : undefined |
|
|
value: value || value === false ? JSON.stringify(value) : undefined |
|
|
}) |
|
|
}) |
|
|
.pipe(takeUntilDestroyed(this.destroyRef)) |
|
|
.pipe( |
|
|
|
|
|
switchMap(() => { |
|
|
|
|
|
return this.userService.get(true); |
|
|
|
|
|
}), |
|
|
|
|
|
takeUntilDestroyed(this.destroyRef) |
|
|
|
|
|
) |
|
|
.subscribe(() => { |
|
|
.subscribe(() => { |
|
|
setTimeout(() => { |
|
|
this.dataService.updateInfo(); |
|
|
window.location.reload(); |
|
|
|
|
|
}, 300); |
|
|
this.fetchAdminData(); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|