mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-10 12:40:19 +01:00
Improve scan funciton
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
3a6b675dbd
commit
f46a61e522
@ -91,7 +91,7 @@
|
||||
[(clrDgSelected)]="selectedRow">
|
||||
<clr-dg-action-bar>
|
||||
<button [clrLoading]="scanBtnState" type="button" class="btn btn-secondary scan-btn"
|
||||
[disabled]="!(canScanNow() && selectedRow.length==1 && hasEnabledScanner && hasScanImagePermission && !depth)" (click)="scanNow()">
|
||||
[disabled]="!(canScanNow() && hasVul() && selectedRow.length==1 && hasEnabledScanner && hasScanImagePermission && !depth)" (click)="scanNow()">
|
||||
<clr-icon shape="shield-check" size="16"></clr-icon> {{'VULNERABILITY.SCAN_NOW' | translate}}
|
||||
</button>
|
||||
|
||||
|
@ -64,6 +64,7 @@ import { errorHandler } from "../../../../../../lib/utils/shared/shared.utils";
|
||||
import { ArtifactFront as Artifact, mutipleFilter } from "../../../artifact/artifact";
|
||||
import { Project } from "../../../../project";
|
||||
import { ArtifactService as NewArtifactService } from "../../../../../../../ng-swagger-gen/services/artifact.service";
|
||||
import { ADDITIONS } from "../../../artifact/artifact-additions/models";
|
||||
export interface LabelState {
|
||||
iconsShow: boolean;
|
||||
label: Label;
|
||||
@ -863,6 +864,12 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
||||
this.channel.publishScanEvent(this.repoName + "/" + this.selectedRow[0].digest);
|
||||
}
|
||||
}
|
||||
hasVul(): boolean {
|
||||
return !!(this.selectedRow
|
||||
&& this.selectedRow[0]
|
||||
&& this.selectedRow[0].addition_links
|
||||
&& this.selectedRow[0].addition_links[ADDITIONS.VULNERABILITIES]);
|
||||
}
|
||||
submitFinish(e: boolean) {
|
||||
this.onSendingScanCommand = e;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user