template.html 2.2 KB
Newer Older
1
<!--
2
Copyright 2017 The Kubernetes Authors.
3 4 5 6 7 8 9 10 11 12 13 14 15 16

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

S
Sebastian Florek 已提交
17 18
<mat-menu #actions="matMenu">
  <div class="kd-auth-status kd-muted-light">
S
Sebastian Florek 已提交
19 20
    <ng-container *ngIf="isLoginStatusInitialized">
      <ng-container [ngSwitch]="true">
21
        <ng-container *ngSwitchCase="loginStatus.headerPresent && !loginStatus.impersonationPresent"
P
Philippe MARTIN 已提交
22 23 24
                      i18n>Logged in with auth header</ng-container>
        <ng-container *ngSwitchCase="loginStatus.tokenPresent"
                      i18n>Logged in with token</ng-container>
25
        <ng-container *ngSwitchCase="loginStatus.headerPresent && loginStatus.impersonationPresent">{{loginStatus.impersonatedUser}}</ng-container>
P
Philippe MARTIN 已提交
26 27
        <ng-container *ngSwitchDefault
                      i18n>Default service account</ng-container>
S
Sebastian Florek 已提交
28
      </ng-container>
29

S
Sebastian Florek 已提交
30 31 32 33
    </ng-container>
  </div>
  <mat-divider></mat-divider>
  <button mat-menu-item
S
Sebastian Florek 已提交
34
          *ngIf="isAuthSkipped()"
P
Philippe MARTIN 已提交
35 36
          (click)="logout()"
          i18n>Sign in
S
Sebastian Florek 已提交
37
  </button>
S
Sebastian Florek 已提交
38 39
  <button mat-menu-item
          *ngIf="isLoggedIn()"
P
Philippe MARTIN 已提交
40 41
          (click)="logout()"
          i18n>Sign out
S
Sebastian Florek 已提交
42
  </button>
S
Sebastian Florek 已提交
43 44
</mat-menu>

45
<button mat-icon-button
S
Sebastian Florek 已提交
46 47 48
        color="primary"
        [matMenuTriggerFor]="actions"
        (click)="$event.stopPropagation()">
49
  <mat-icon class="kd-user-panel-icon kd-primary-toolbar-icon">account_circle</mat-icon>
S
Sebastian Florek 已提交
50 51 52 53 54
  <svg class="kd-cross-style"
       *ngIf="isAuthSkipped()"
       width="40px"
       height="40px"
       viewBox="0 0 40 40">
55 56 57 58 59 60 61 62 63 64
    <line class="kd-cross-outline"
          x1="10"
          x2="30"
          y1="10"
          y2="30" />
    <line class="kd-cross-line-primary"
          x1="10"
          x2="30"
          y1="10"
          y2="30" />
S
Sebastian Florek 已提交
65
  </svg>
66
</button>