mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 02:05:41 +01:00
Merge cosign check and notation check (#19079)
1.Merge cosign check and notaion check into one API call, related issue #19077 Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
1132a6654e
commit
cdd3f267b5
@ -343,16 +343,16 @@
|
||||
</clr-dg-cell>
|
||||
<clr-dg-cell>
|
||||
<span
|
||||
*ngIf="artifact.coSigned === 'checking'"
|
||||
*ngIf="artifact.signed === 'checking'"
|
||||
class="spinner spinner-inline ml-2"></span>
|
||||
<clr-icon
|
||||
shape="check-circle"
|
||||
*ngIf="artifact.coSigned === 'true'"
|
||||
*ngIf="artifact.signed === 'true'"
|
||||
size="20"
|
||||
class="signed"></clr-icon>
|
||||
<clr-icon
|
||||
shape="times-circle"
|
||||
*ngIf="artifact.coSigned === 'false'"
|
||||
*ngIf="artifact.signed === 'false'"
|
||||
size="16"
|
||||
class="color-red"></clr-icon>
|
||||
</clr-dg-cell>
|
||||
|
@ -881,8 +881,6 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
||||
projectName: this.projectName,
|
||||
repositoryName: dbEncodeURIComponent(this.repoName),
|
||||
reference: item.digest,
|
||||
withSignature: true,
|
||||
withImmutableStatus: true,
|
||||
page: 1,
|
||||
pageSize: 8,
|
||||
};
|
||||
@ -935,43 +933,30 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
||||
if (artifacts) {
|
||||
if (artifacts.length) {
|
||||
artifacts.forEach(item => {
|
||||
item.coSigned = CHECKING;
|
||||
const listTagParams: NewArtifactService.ListAccessoriesParams =
|
||||
{
|
||||
item.signed = CHECKING;
|
||||
this.newArtifactService
|
||||
.listAccessories({
|
||||
projectName: this.projectName,
|
||||
repositoryName: dbEncodeURIComponent(this.repoName),
|
||||
reference: item.digest,
|
||||
page: 1,
|
||||
pageSize: ACCESSORY_PAGE_SIZE,
|
||||
};
|
||||
forkJoin([
|
||||
this.newArtifactService.listAccessories({
|
||||
...listTagParams,
|
||||
q: encodeURIComponent(
|
||||
`type=${AccessoryType.COSIGN}`
|
||||
`type={${AccessoryType.COSIGN} ${AccessoryType.NOTATION}}`
|
||||
),
|
||||
}),
|
||||
this.newArtifactService.listAccessories({
|
||||
...listTagParams,
|
||||
q: encodeURIComponent(
|
||||
`type=${AccessoryType.NOTATION}`
|
||||
),
|
||||
}),
|
||||
]).subscribe({
|
||||
next: res => {
|
||||
if (
|
||||
res?.length &&
|
||||
(res[0]?.length || res[1]?.length)
|
||||
) {
|
||||
item.coSigned = TRUE;
|
||||
} else {
|
||||
item.coSigned = FALSE;
|
||||
}
|
||||
},
|
||||
error: err => {
|
||||
item.coSigned = FALSE;
|
||||
},
|
||||
});
|
||||
})
|
||||
.subscribe({
|
||||
next: res => {
|
||||
if (res?.length) {
|
||||
item.signed = TRUE;
|
||||
} else {
|
||||
item.signed = FALSE;
|
||||
}
|
||||
},
|
||||
error: err => {
|
||||
item.signed = FALSE;
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ export interface ArtifactFront extends Artifact {
|
||||
pullCommand?: string;
|
||||
annotationsArray?: Array<{ [key: string]: any }>;
|
||||
tagNumber?: number;
|
||||
coSigned?: string;
|
||||
signed?: string;
|
||||
accessoryNumber?: number;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user