From 33852973e3ed0359816fd3842f2decb46e76c6bb Mon Sep 17 00:00:00 2001 From: FangyuanCheng Date: Thu, 18 Apr 2019 16:03:31 +0800 Subject: [PATCH] Hide vulnrability if clair is not installed Signed-off-by: FangyuanCheng --- .../app/base/harbor-shell/harbor-shell.component.html | 6 +++--- .../src/app/base/harbor-shell/harbor-shell.component.ts | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/portal/src/app/base/harbor-shell/harbor-shell.component.html b/src/portal/src/app/base/harbor-shell/harbor-shell.component.html index db1997e19..eb3810d11 100644 --- a/src/portal/src/app/base/harbor-shell/harbor-shell.component.html +++ b/src/portal/src/app/base/harbor-shell/harbor-shell.component.html @@ -46,15 +46,15 @@ - + {{'SIDE_NAV.TASKS' | translate}} - + {{'SIDE_NAV.SYSTEM_MGMT.VULNERABILITY' | translate}} - + {{'SIDE_NAV.SYSTEM_MGMT.GARBAGE_COLLECTION' | translate}} diff --git a/src/portal/src/app/base/harbor-shell/harbor-shell.component.ts b/src/portal/src/app/base/harbor-shell/harbor-shell.component.ts index 23f3938bd..9bf9a1142 100644 --- a/src/portal/src/app/base/harbor-shell/harbor-shell.component.ts +++ b/src/portal/src/app/base/harbor-shell/harbor-shell.component.ts @@ -107,6 +107,15 @@ export class HarborShellComponent implements OnInit, OnDestroy { return account != null; } + public get withClair(): boolean { + return this.appConfigService.getConfig().with_clair; + } + + public get hasAdminRole(): boolean { + return this.session.getCurrentUser() && + this.session.getCurrentUser().has_admin_role; + } + // Open modal dialog openModal(event: ModalEvent): void { switch (event.modalName) {