mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
Merge pull request #10934 from AllForNothing/improve-scan
Improve scan funciton
This commit is contained in:
commit
b72a102d37
@ -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