mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-26 10:38:00 +01:00
Add next scheduled time for tag retention (#18223)
1. Add next scheduled time UI 2. Update font style Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
c5640acd7b
commit
a79c0ad496
@ -1,6 +1,6 @@
|
||||
<div class="clr-row pt-1 fw8">
|
||||
<div class="clr-col">
|
||||
<label class="label-left font-size-54">{{
|
||||
<label class="label-left font-style">{{
|
||||
'IMMUTABLE_TAG.IMMUTABLE_RULES' | translate
|
||||
}}</label
|
||||
><span class="badge badge-3 ml-5"
|
||||
|
@ -30,6 +30,7 @@ export class Retention extends BaseRetention {
|
||||
references: object;
|
||||
settings: {
|
||||
cron: string;
|
||||
next_scheduled_time?: string;
|
||||
};
|
||||
};
|
||||
constructor() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<div class="clr-row pt-1 fw8">
|
||||
<div class="clr-col">
|
||||
<label class="label-left font-size-54">{{
|
||||
<label class="label-left font-style">{{
|
||||
'TAG_RETENTION.RETENTION_RULES' | translate
|
||||
}}</label
|
||||
><span class="badge badge-3 ml-5"
|
||||
@ -168,7 +168,6 @@
|
||||
</div>
|
||||
<div class="cron-selection">
|
||||
<cron-selection
|
||||
class="w-100"
|
||||
[labelWidth]="'150px'"
|
||||
[disabled]="!(retention?.rules?.length > 0)"
|
||||
#cronScheduleComponent
|
||||
@ -176,10 +175,18 @@
|
||||
[labelEdit]="label"
|
||||
[originCron]="originCron()"
|
||||
(inputvalue)="openConfirm($event)"></cron-selection>
|
||||
<ng-container *ngIf="retention?.trigger?.settings?.next_scheduled_time">
|
||||
<span class="ml-1 mr-1 font-style">{{
|
||||
'CLEARANCES.NEXT_SCHEDULED_TIME' | translate
|
||||
}}</span>
|
||||
<span>{{
|
||||
retention?.trigger?.settings?.next_scheduled_time | harborDatetime
|
||||
}}</span>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="clr-row pt-1">
|
||||
<div class="clr-col-2 pt-2 flex-150">
|
||||
<label class="label-left font-size-54">{{
|
||||
<label class="label-left font-style">{{
|
||||
'TAG_RETENTION.RETENTION_RUNS' | translate
|
||||
}}</label>
|
||||
</div>
|
||||
|
@ -143,6 +143,10 @@ export class TagRetentionComponent implements OnInit, OnDestroy {
|
||||
updateCron(cron: string) {
|
||||
let retention: RetentionPolicy = clone(this.retention);
|
||||
retention.trigger.settings['cron'] = cron;
|
||||
if (retention?.trigger?.settings['next_scheduled_time']) {
|
||||
// should not have next_scheduled_time for updating
|
||||
delete retention?.trigger?.settings['next_scheduled_time'];
|
||||
}
|
||||
if (!this.retentionId) {
|
||||
this.retentionService
|
||||
.createRetention({
|
||||
|
Loading…
Reference in New Issue
Block a user