diff --git a/src/app/accounts/environment.component.html b/src/app/accounts/environment.component.html index 723b8681..62f8f9ff 100644 --- a/src/app/accounts/environment.component.html +++ b/src/app/accounts/environment.component.html @@ -27,7 +27,8 @@ diff --git a/src/app/accounts/login.component.html b/src/app/accounts/login.component.html index 2117c8df..a1bb9599 100644 --- a/src/app/accounts/login.component.html +++ b/src/app/accounts/login.component.html @@ -15,11 +15,12 @@ - - diff --git a/src/app/accounts/two-factor.component.html b/src/app/accounts/two-factor.component.html index 4c370f5d..f952c957 100644 --- a/src/app/accounts/two-factor.component.html +++ b/src/app/accounts/two-factor.component.html @@ -41,8 +41,9 @@

{{'noTwoStepProviders' | i18n}}

{{'noTwoStepProviders2' | i18n}}

- diff --git a/src/app/tabs/dashboard.component.html b/src/app/tabs/dashboard.component.html index 24634350..3f0334f6 100644 --- a/src/app/tabs/dashboard.component.html +++ b/src/app/tabs/dashboard.component.html @@ -1,9 +1,30 @@

{{'sync' | i18n}}

+

+ Last group sync: + - + {{lastGroupSync | date:'medium'}} +
Last user sync: + - + {{lastUserSync | date:'medium'}} +

+

+ Sync status: + Running + Stopped +

+ +
@@ -11,8 +32,9 @@

Testing

diff --git a/src/app/tabs/dashboard.component.ts b/src/app/tabs/dashboard.component.ts index 276a82b7..e009f113 100644 --- a/src/app/tabs/dashboard.component.ts +++ b/src/app/tabs/dashboard.component.ts @@ -1,4 +1,7 @@ -import { Component } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { I18nService } from 'jslib/abstractions/i18n.service'; @@ -10,12 +13,13 @@ import { SyncService } from '../../services/sync.service'; import { Entry } from '../../models/entry'; import { GroupEntry } from '../../models/groupEntry'; import { UserEntry } from '../../models/userEntry'; +import { ConfigurationService } from '../../services/configuration.service'; @Component({ selector: 'app-dashboard', templateUrl: 'dashboard.component.html', }) -export class DashboardComponent { +export class DashboardComponent implements OnInit { simGroups: GroupEntry[]; simUsers: UserEntry[]; simEnabledUsers: UserEntry[] = []; @@ -24,8 +28,25 @@ export class DashboardComponent { simPromise: Promise; simSinceLast: boolean = false; syncPromise: Promise; + lastGroupSync: Date; + lastUserSync: Date; + syncRunning: boolean; - constructor(private i18nService: I18nService, private syncService: SyncService) { } + constructor(private i18nService: I18nService, private syncService: SyncService, + private configurationService: ConfigurationService) { } + + async ngOnInit() { + this.lastGroupSync = await this.configurationService.getLastGroupSyncDate(); + this.lastUserSync = await this.configurationService.getLastUserSyncDate(); + } + + async start() { + this.syncRunning = true; + } + + async stop() { + this.syncRunning = false; + } async sync() { this.syncPromise = this.syncService.sync(false, false); diff --git a/src/app/tabs/more.component.html b/src/app/tabs/more.component.html index f902897e..e6cb41a7 100644 --- a/src/app/tabs/more.component.html +++ b/src/app/tabs/more.component.html @@ -4,11 +4,14 @@

{{'about' | i18n}}

- {{'bitwardenDirectoryConnector' | i18n}}
- {{'version' | i18n : version}} + {{'bitwardenDirectoryConnector' | i18n}} +
{{'version' | i18n : version}}
© 8bit Solutions LLC 2015-{{year}}

- +
@@ -16,7 +19,9 @@

{{'other' | i18n}}

- +
diff --git a/src/services/sync.service.ts b/src/services/sync.service.ts index d8bcb7b5..2493b67b 100644 --- a/src/services/sync.service.ts +++ b/src/services/sync.service.ts @@ -12,12 +12,13 @@ import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service import { LogService } from 'jslib/abstractions/log.service'; import { StorageService } from 'jslib/abstractions/storage.service'; +import { Utils } from 'jslib/misc/utils'; + import { AzureDirectoryService } from './azure-directory.service'; import { ConfigurationService } from './configuration.service'; import { DirectoryService } from './directory.service'; import { GSuiteDirectoryService } from './gsuite-directory.service'; import { LdapDirectoryService } from './ldap-directory.service'; -import { Utils } from 'jslib/misc/utils'; const Keys = { };