mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +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">
|
[(clrDgSelected)]="selectedRow">
|
||||||
<clr-dg-action-bar>
|
<clr-dg-action-bar>
|
||||||
<button [clrLoading]="scanBtnState" type="button" class="btn btn-secondary scan-btn"
|
<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}}
|
<clr-icon shape="shield-check" size="16"></clr-icon> {{'VULNERABILITY.SCAN_NOW' | translate}}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ import { errorHandler } from "../../../../../../lib/utils/shared/shared.utils";
|
|||||||
import { ArtifactFront as Artifact, mutipleFilter } from "../../../artifact/artifact";
|
import { ArtifactFront as Artifact, mutipleFilter } from "../../../artifact/artifact";
|
||||||
import { Project } from "../../../../project";
|
import { Project } from "../../../../project";
|
||||||
import { ArtifactService as NewArtifactService } from "../../../../../../../ng-swagger-gen/services/artifact.service";
|
import { ArtifactService as NewArtifactService } from "../../../../../../../ng-swagger-gen/services/artifact.service";
|
||||||
|
import { ADDITIONS } from "../../../artifact/artifact-additions/models";
|
||||||
export interface LabelState {
|
export interface LabelState {
|
||||||
iconsShow: boolean;
|
iconsShow: boolean;
|
||||||
label: Label;
|
label: Label;
|
||||||
@ -863,6 +864,12 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
|||||||
this.channel.publishScanEvent(this.repoName + "/" + this.selectedRow[0].digest);
|
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) {
|
submitFinish(e: boolean) {
|
||||||
this.onSendingScanCommand = e;
|
this.onSendingScanCommand = e;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user