mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
Add new status "scan unsupported" for artifact list
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
e79f4fd270
commit
5b440082dc
@ -91,7 +91,7 @@
|
||||
[(clrDgSelected)]="selectedRow">
|
||||
<clr-dg-action-bar>
|
||||
<button [clrLoading]="scanBtnState" type="button" class="btn btn-secondary scan-btn"
|
||||
[disabled]="!(canScanNow() && hasVul() && selectedRow.length==1 && hasEnabledScanner && hasScanImagePermission && !depth)" (click)="scanNow()">
|
||||
[disabled]="!(canScanNow() && selectedRowHasVul() && selectedRow.length==1 && hasEnabledScanner && hasScanImagePermission )" (click)="scanNow()">
|
||||
<clr-icon shape="shield-check" size="16"></clr-icon> {{'VULNERABILITY.SCAN_NOW' | translate}}
|
||||
</button>
|
||||
|
||||
@ -238,7 +238,10 @@
|
||||
</clr-dg-cell>
|
||||
<clr-dg-cell>
|
||||
<div class="cell">
|
||||
<hbr-vulnerability-bar [scanner]="handleScanOverview(artifact.scan_overview)?.scanner"
|
||||
<span *ngIf="!hasVul(artifact)">
|
||||
{{'ARTIFACT.SCAN_UNSUPPORTED' | translate}}
|
||||
</span>
|
||||
<hbr-vulnerability-bar *ngIf="hasVul(artifact)" [scanner]="handleScanOverview(artifact.scan_overview)?.scanner"
|
||||
(submitFinish)="submitFinish($event)" [projectName]="projectName" [repoName]="repoName"
|
||||
[artifactDigest]="artifact.digest" [summary]="handleScanOverview(artifact.scan_overview)">
|
||||
</hbr-vulnerability-bar>
|
||||
|
@ -370,7 +370,12 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
||||
let childParams: NewArtifactService.GetArtifactParams = {
|
||||
repositoryName: this.repoName,
|
||||
projectName: this.projectName,
|
||||
reference: child.child_digest
|
||||
reference: child.child_digest,
|
||||
withImmutableStatus: true,
|
||||
withLabel: true,
|
||||
withScanOverview: true,
|
||||
withSignature: true,
|
||||
withTag: true
|
||||
};
|
||||
observableLists.push(this.newArtifactService.getArtifact(childParams));
|
||||
}
|
||||
@ -864,12 +869,15 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
||||
this.channel.publishScanEvent(this.repoName + "/" + this.selectedRow[0].digest);
|
||||
}
|
||||
}
|
||||
hasVul(): boolean {
|
||||
selectedRowHasVul(): boolean {
|
||||
return !!(this.selectedRow
|
||||
&& this.selectedRow[0]
|
||||
&& this.selectedRow[0].addition_links
|
||||
&& this.selectedRow[0].addition_links[ADDITIONS.VULNERABILITIES]);
|
||||
}
|
||||
hasVul(artifact: Artifact): boolean {
|
||||
return !!(artifact && artifact.addition_links && artifact.addition_links[ADDITIONS.VULNERABILITIES]);
|
||||
}
|
||||
submitFinish(e: boolean) {
|
||||
this.onSendingScanCommand = e;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
</div>
|
||||
<div class="title-block">
|
||||
<h2 sub-header-title class="custom-h2" *ngIf="!artifactDigest">{{showCurrentTitle}}</h2>
|
||||
<h2 sub-header-title class="custom-h2" *ngIf="artifactDigest">{{artifactDigest | slice:1:15}}</h2>
|
||||
<h2 sub-header-title class="custom-h2" *ngIf="artifactDigest">{{artifactDigest | slice:0:15}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -1004,7 +1004,8 @@
|
||||
"TAGGED": "Tagged",
|
||||
"UNTAGGED": "Untagged",
|
||||
"ALL": "All",
|
||||
"PLACEHOLDER": "We couldn't find any artifactds!"
|
||||
"PLACEHOLDER": "We couldn't find any artifactds!",
|
||||
"SCAN_UNSUPPORTED": "Scan Unsupported"
|
||||
},
|
||||
"TAG": {
|
||||
"CREATION_TIME_PREFIX": "Create on",
|
||||
|
@ -1003,7 +1003,8 @@
|
||||
"TAGGED": "Tagged",
|
||||
"UNTAGGED": "Untagged",
|
||||
"ALL": "All",
|
||||
"PLACEHOLDER": "We couldn't find any artifacts!"
|
||||
"PLACEHOLDER": "We couldn't find any artifacts!",
|
||||
"SCAN_UNSUPPORTED": "Scan Unsupported"
|
||||
},
|
||||
"TAG": {
|
||||
"CREATION_TIME_PREFIX": "Create on",
|
||||
|
@ -976,7 +976,8 @@
|
||||
"TAGGED": "Tagged",
|
||||
"UNTAGGED": "Untagged",
|
||||
"ALL": "All",
|
||||
"PLACEHOLDER": "We couldn't find any artifacts!"
|
||||
"PLACEHOLDER": "We couldn't find any artifacts!",
|
||||
"SCAN_UNSUPPORTED": "Scan Unsupported"
|
||||
},
|
||||
"TAG": {
|
||||
"CREATION_TIME_PREFIX": "Créer le",
|
||||
|
@ -999,7 +999,8 @@
|
||||
"TAGGED": "Tagged",
|
||||
"UNTAGGED": "Untagged",
|
||||
"ALL": "All",
|
||||
"PLACEHOLDER": "We couldn't find any artifacts!"
|
||||
"PLACEHOLDER": "We couldn't find any artifacts!",
|
||||
"SCAN_UNSUPPORTED": "Scan Unsupported"
|
||||
},
|
||||
"TAG": {
|
||||
"CREATION_TIME_PREFIX": "Criado em",
|
||||
|
@ -1003,7 +1003,8 @@
|
||||
"TAGGED": "Tagged",
|
||||
"UNTAGGED": "Untagged",
|
||||
"ALL": "All",
|
||||
"PLACEHOLDER": "We couldn't find any artifacts!"
|
||||
"PLACEHOLDER": "We couldn't find any artifacts!",
|
||||
"SCAN_UNSUPPORTED": "Scan Unsupported"
|
||||
},
|
||||
"TAG": {
|
||||
"CREATION_TIME_PREFIX": "Oluştur",
|
||||
|
@ -1003,7 +1003,8 @@
|
||||
"TAGGED": "含有 Tag",
|
||||
"UNTAGGED": "不含有 Tag",
|
||||
"ALL": "所有",
|
||||
"PLACEHOLDER": "未发现任何 artifacts!"
|
||||
"PLACEHOLDER": "未发现任何 artifacts!",
|
||||
"SCAN_UNSUPPORTED": "不支持扫描"
|
||||
},
|
||||
"TAG": {
|
||||
"CREATION_TIME_PREFIX": "创建时间:",
|
||||
|
Loading…
Reference in New Issue
Block a user