2021-12-15 23:32:00 +01:00
|
|
|
<a
|
|
|
|
class="account-switcher"
|
|
|
|
(click)="toggle()"
|
|
|
|
cdkOverlayOrigin
|
|
|
|
#trigger="cdkOverlayOrigin"
|
|
|
|
[hidden]="!showSwitcher"
|
|
|
|
>
|
2022-01-24 13:28:39 +01:00
|
|
|
<ng-container *ngIf="activeAccountEmail != null; else noActiveAccount">
|
|
|
|
<app-avatar
|
|
|
|
[data]="activeAccountEmail"
|
|
|
|
size="25"
|
|
|
|
[circle]="true"
|
|
|
|
[fontSize]="14"
|
|
|
|
[dynamic]="true"
|
|
|
|
*ngIf="activeAccountEmail != null"
|
|
|
|
></app-avatar>
|
|
|
|
<span>{{ activeAccountEmail }}</span>
|
|
|
|
</ng-container>
|
|
|
|
<ng-template #noActiveAccount>
|
|
|
|
<span>{{ "switchAccount" | i18n }}</span>
|
|
|
|
</ng-template>
|
2021-12-15 23:32:00 +01:00
|
|
|
<i
|
|
|
|
class="fa"
|
|
|
|
aria-hidden="true"
|
|
|
|
[ngClass]="{ 'fa-chevron-down': !isOpen, 'fa-chevron-up': isOpen }"
|
|
|
|
></i>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ng-template
|
|
|
|
cdkConnectedOverlay
|
|
|
|
[cdkConnectedOverlayOrigin]="trigger"
|
2022-01-12 17:20:19 +01:00
|
|
|
[cdkConnectedOverlayHasBackdrop]="true"
|
|
|
|
[cdkConnectedOverlayBackdropClass]="'cdk-overlay-transparent-backdrop'"
|
|
|
|
(backdropClick)="toggle()"
|
2022-01-18 21:43:14 +01:00
|
|
|
[cdkConnectedOverlayOpen]="showSwitcher && isOpen"
|
2022-01-20 16:32:05 +01:00
|
|
|
[cdkConnectedOverlayPositions]="overlayPostition"
|
2021-12-15 23:32:00 +01:00
|
|
|
cdkConnectedOverlayMinWidth="250px"
|
|
|
|
>
|
|
|
|
<div class="account-switcher-dropdown" [@transformPanel]="'open'">
|
2022-01-21 17:57:09 +01:00
|
|
|
<div class="accounts" *ngIf="numberOfAccounts > 0">
|
2021-12-15 23:32:00 +01:00
|
|
|
<a
|
|
|
|
*ngFor="let a of accounts | keyvalue"
|
|
|
|
class="account"
|
|
|
|
[ngClass]="{ active: a.value.profile.authenticationStatus == 'active' }"
|
|
|
|
href="#"
|
2022-01-12 15:23:00 +01:00
|
|
|
(mousedown)="switch(a.key)"
|
2021-12-15 23:32:00 +01:00
|
|
|
>
|
2022-01-19 17:03:34 +01:00
|
|
|
<app-avatar
|
|
|
|
[data]="a.value.profile.email"
|
|
|
|
size="25"
|
|
|
|
[circle]="true"
|
|
|
|
[fontSize]="14"
|
|
|
|
[dynamic]="true"
|
|
|
|
*ngIf="a.value.profile.email != null"
|
|
|
|
></app-avatar>
|
|
|
|
<div class="accountInfo">
|
|
|
|
<span class="email">{{ a.value.profile.email }}</span>
|
|
|
|
<span class="server" *ngIf="a.value.serverUrl != 'bitwarden.com'">{{
|
|
|
|
a.value.serverUrl
|
|
|
|
}}</span>
|
|
|
|
<span class="status">{{ a.value.profile.authenticationStatus }}</span>
|
|
|
|
</div>
|
|
|
|
<i
|
|
|
|
class="fa fa-unlock fa-2x text-muted"
|
|
|
|
*ngIf="a.value.profile.authenticationStatus == 'unlocked'"
|
|
|
|
></i>
|
|
|
|
<i
|
|
|
|
class="fa fa-lock fa-2x text-muted"
|
|
|
|
*ngIf="a.value.profile.authenticationStatus == 'locked'"
|
|
|
|
></i>
|
2021-12-15 23:32:00 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
2022-01-24 13:28:39 +01:00
|
|
|
<ng-container *ngIf="activeAccountEmail != null">
|
|
|
|
<div class="border" *ngIf="numberOfAccounts > 0"></div>
|
|
|
|
<ng-container *ngIf="numberOfAccounts < 4">
|
|
|
|
<a class="add" routerLink="/login" (click)="addAccount()">
|
|
|
|
<i class="fa fa-plus" aria-hidden="true"></i> {{ "addAccount" | i18n }}
|
|
|
|
</a>
|
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="numberOfAccounts == 4">
|
|
|
|
<span class="accountLimitReached">{{ "accountSwitcherLimitReached" | i18n }} </span>
|
|
|
|
</ng-container>
|
2022-01-19 17:03:34 +01:00
|
|
|
</ng-container>
|
2021-12-20 15:47:17 +01:00
|
|
|
</div>
|
2021-12-15 23:32:00 +01:00
|
|
|
</ng-template>
|