mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-27 19:17:47 +01:00
Add copy digest button for accessories (#18433)
1.Fixes #18406 Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
9b593550ab
commit
9e0e8e066b
@ -180,6 +180,7 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
deleteAccessorySub: Subscription;
|
deleteAccessorySub: Subscription;
|
||||||
|
copyDigestSub: Subscription;
|
||||||
@ViewChild('datagrid')
|
@ViewChild('datagrid')
|
||||||
datagrid;
|
datagrid;
|
||||||
constructor(
|
constructor(
|
||||||
@ -241,6 +242,14 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (!this.copyDigestSub) {
|
||||||
|
this.copyDigestSub = this.eventService.subscribe(
|
||||||
|
HarborEvent.COPY_DIGEST,
|
||||||
|
(a: Accessory) => {
|
||||||
|
this.copyDigestComponent.showDigestId(a.digest);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
@ -252,6 +261,10 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
|||||||
this.deleteAccessorySub.unsubscribe();
|
this.deleteAccessorySub.unsubscribe();
|
||||||
this.deleteAccessorySub = null;
|
this.deleteAccessorySub = null;
|
||||||
}
|
}
|
||||||
|
if (this.copyDigestSub) {
|
||||||
|
this.copyDigestSub.unsubscribe();
|
||||||
|
this.copyDigestSub = null;
|
||||||
|
}
|
||||||
this.datagrid['columnsService']?.columns?.forEach((item, index) => {
|
this.datagrid['columnsService']?.columns?.forEach((item, index) => {
|
||||||
if (this.depth) {
|
if (this.depth) {
|
||||||
this.hiddenArray[index] = !!item?._value?.hidden;
|
this.hiddenArray[index] = !!item?._value?.hidden;
|
||||||
|
@ -11,9 +11,12 @@
|
|||||||
*ngFor="let a of displayedAccessories; let i = index"
|
*ngFor="let a of displayedAccessories; let i = index"
|
||||||
[clrDgItem]="a">
|
[clrDgItem]="a">
|
||||||
<clr-dg-action-overflow>
|
<clr-dg-action-overflow>
|
||||||
<button class="action-item" (click)="delete(a)">
|
<button class="my-action-item" (click)="delete(a)">
|
||||||
{{ 'REPOSITORY.DELETE' | translate }}
|
{{ 'REPOSITORY.DELETE' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
<button class="my-action-item" (click)="copyDigest(a)">
|
||||||
|
{{ 'REPOSITORY.COPY_DIGEST_ID' | translate }}
|
||||||
|
</button>
|
||||||
</clr-dg-action-overflow>
|
</clr-dg-action-overflow>
|
||||||
<clr-dg-cell class="relative">
|
<clr-dg-cell class="relative">
|
||||||
<!--it will cause a ExpressionChangedAfterItHasBeenCheckedError when read datagrid['el']?.nativeElement?.offsetHeight so
|
<!--it will cause a ExpressionChangedAfterItHasBeenCheckedError when read datagrid['el']?.nativeElement?.offsetHeight so
|
||||||
|
@ -38,3 +38,17 @@
|
|||||||
left: -4.2rem;
|
left: -4.2rem;
|
||||||
bottom: 0
|
bottom: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.my-action-item {
|
||||||
|
font-size: .7rem;
|
||||||
|
letter-spacing: normal;
|
||||||
|
background: 0 0;
|
||||||
|
border: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
display: block;
|
||||||
|
line-height: 1.15rem;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0.05rem 1.2rem 0;
|
||||||
|
text-align: left;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
@ -180,4 +180,8 @@ export class SubAccessoriesComponent implements OnInit, AfterViewInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copyDigest(a: Accessory) {
|
||||||
|
this.event.publish(HarborEvent.COPY_DIGEST, a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,4 +80,5 @@ export enum HarborEvent {
|
|||||||
UPDATE_VULNERABILITY_INFO = 'UpdateVulnerabilityInfo',
|
UPDATE_VULNERABILITY_INFO = 'UpdateVulnerabilityInfo',
|
||||||
REFRESH_EXPORT_JOBS = 'refreshExportJobs',
|
REFRESH_EXPORT_JOBS = 'refreshExportJobs',
|
||||||
DELETE_ACCESSORY = 'deleteAccessory',
|
DELETE_ACCESSORY = 'deleteAccessory',
|
||||||
|
COPY_DIGEST = 'copyDigest',
|
||||||
}
|
}
|
||||||
|
@ -357,3 +357,12 @@ job-service-dashboard {
|
|||||||
.datagrid-numeric-filter-input {
|
.datagrid-numeric-filter-input {
|
||||||
background-color: $datagrid-numeric-filter-input-bg-color;
|
background-color: $datagrid-numeric-filter-input-bg-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.my-action-item {
|
||||||
|
color: $normal-border-color
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-action-item:hover {
|
||||||
|
background-color: $label-hover-bg-color !important;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user