mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-25 01:58:35 +01:00
Merge pull request #6069 from pureshine/scan_btn
Disable scan button when vulnerability data is not ready.
This commit is contained in:
commit
7851404d0d
@ -40,7 +40,7 @@
|
|||||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||||
<clr-datagrid [clrDgLoading]="loading" [class.embeded-datagrid]="isEmbedded" [(clrDgSelected)]="selectedRow">
|
<clr-datagrid [clrDgLoading]="loading" [class.embeded-datagrid]="isEmbedded" [(clrDgSelected)]="selectedRow">
|
||||||
<clr-dg-action-bar>
|
<clr-dg-action-bar>
|
||||||
<button type="button" class="btn btn-sm btn-secondary" [disabled]="!(canScanNow(selectedRow) && selectedRow.length==1)" (click)="scanNow(selectedRow)"><clr-icon shape="shield-check" size="16"></clr-icon> {{'VULNERABILITY.SCAN_NOW' | translate}}</button>
|
<button type="button" class="btn btn-sm btn-secondary" [disabled]="!(canScanNow(selectedRow) && selectedRow.length==1) || !isClairDBFullyReady" (click)="scanNow(selectedRow)"><clr-icon shape="shield-check" size="16"></clr-icon> {{'VULNERABILITY.SCAN_NOW' | translate}}</button>
|
||||||
<button type="button" class="btn btn-sm btn-secondary" [disabled]="!(selectedRow.length==1)" (click)="showDigestId(selectedRow)" ><clr-icon shape="copy" size="16"></clr-icon> {{'REPOSITORY.COPY_DIGEST_ID' | translate}}</button>
|
<button type="button" class="btn btn-sm btn-secondary" [disabled]="!(selectedRow.length==1)" (click)="showDigestId(selectedRow)" ><clr-icon shape="copy" size="16"></clr-icon> {{'REPOSITORY.COPY_DIGEST_ID' | translate}}</button>
|
||||||
<clr-dropdown *ngIf="!withAdmiral">
|
<clr-dropdown *ngIf="!withAdmiral">
|
||||||
<button type="button" class="btn btn-sm btn-secondary" clrDropdownTrigger [disabled]="!(selectedRow.length==1) || isGuest" (click)="addLabels(selectedRow)" ><clr-icon shape="plus" size="16"></clr-icon>{{'REPOSITORY.ADD_LABELS' | translate}}</button>
|
<button type="button" class="btn btn-sm btn-secondary" clrDropdownTrigger [disabled]="!(selectedRow.length==1) || isGuest" (click)="addLabels(selectedRow)" ><clr-icon shape="plus" size="16"></clr-icon>{{'REPOSITORY.ADD_LABELS' | translate}}</button>
|
||||||
|
@ -56,6 +56,7 @@ import {CopyInputComponent} from "../push-image/copy-input.component";
|
|||||||
import {LabelService} from "../service/label.service";
|
import {LabelService} from "../service/label.service";
|
||||||
import {operateChanges, OperateInfo, OperationState} from "../operation/operate";
|
import {operateChanges, OperateInfo, OperationState} from "../operation/operate";
|
||||||
import {OperationService} from "../operation/operation.service";
|
import {OperationService} from "../operation/operation.service";
|
||||||
|
import {SystemInfo} from "../service/index";
|
||||||
|
|
||||||
export interface LabelState {
|
export interface LabelState {
|
||||||
iconsShow: boolean;
|
iconsShow: boolean;
|
||||||
@ -124,6 +125,7 @@ export class TagComponent implements OnInit, AfterViewInit {
|
|||||||
project_id: 0,
|
project_id: 0,
|
||||||
};
|
};
|
||||||
filterOneLabel: Label = this.initFilter;
|
filterOneLabel: Label = this.initFilter;
|
||||||
|
systemInfo: SystemInfo;
|
||||||
|
|
||||||
|
|
||||||
@ViewChild('confirmationDialog')
|
@ViewChild('confirmationDialog')
|
||||||
@ -213,6 +215,12 @@ export class TagComponent implements OnInit, AfterViewInit {
|
|||||||
return len > 210 ? 210 : len;
|
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) {
|
doSearchTagNames(tagName: string) {
|
||||||
this.lastFilteredTagName = tagName;
|
this.lastFilteredTagName = tagName;
|
||||||
this.currentPage = 1;
|
this.currentPage = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user