From 2a3c1134585893cd26ce2941a9b2a08f73b65979 Mon Sep 17 00:00:00 2001 From: FangyuanCheng Date: Wed, 17 Oct 2018 23:48:10 +0800 Subject: [PATCH] Disable scan button when vulnerability data is not ready. Signed-off-by: FangyuanCheng --- src/portal/lib/src/tag/tag.component.html | 2 +- src/portal/lib/src/tag/tag.component.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/portal/lib/src/tag/tag.component.html b/src/portal/lib/src/tag/tag.component.html index e54e00cde..c7ba2de64 100644 --- a/src/portal/lib/src/tag/tag.component.html +++ b/src/portal/lib/src/tag/tag.component.html @@ -40,7 +40,7 @@
- + diff --git a/src/portal/lib/src/tag/tag.component.ts b/src/portal/lib/src/tag/tag.component.ts index 3b4073799..c2c53cea4 100644 --- a/src/portal/lib/src/tag/tag.component.ts +++ b/src/portal/lib/src/tag/tag.component.ts @@ -56,6 +56,7 @@ import {CopyInputComponent} from "../push-image/copy-input.component"; import {LabelService} from "../service/label.service"; import {operateChanges, OperateInfo, OperationState} from "../operation/operate"; import {OperationService} from "../operation/operation.service"; +import {SystemInfo} from "../service/index"; export interface LabelState { iconsShow: boolean; @@ -124,6 +125,7 @@ export class TagComponent implements OnInit, AfterViewInit { project_id: 0, }; filterOneLabel: Label = this.initFilter; + systemInfo: SystemInfo; @ViewChild('confirmationDialog') @@ -213,6 +215,12 @@ export class TagComponent implements OnInit, AfterViewInit { return len > 210 ? 210 : len; } + get isClairDBFullyReady(): boolean { + return this.systemInfo && + this.systemInfo.clair_vulnerability_status && + this.systemInfo.clair_vulnerability_status.overall_last_update > 0; + } + doSearchTagNames(tagName: string) { this.lastFilteredTagName = tagName; this.currentPage = 1;