mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-28 11:37:42 +01:00
Fix log rotation UI issues (#17220)
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
acc2872fa8
commit
56e669ebbc
@ -75,7 +75,7 @@
|
||||
[class.clr-error]="
|
||||
(retentionTimeNgModel.dirty ||
|
||||
retentionTimeNgModel.touched) &&
|
||||
retentionTimeNgModel.invalid
|
||||
(retentionTimeNgModel.invalid || !isRetentionTimeValid())
|
||||
">
|
||||
<div class="flex">
|
||||
<div class="clr-input-wrapper">
|
||||
@ -95,15 +95,25 @@
|
||||
class="clr-validate-icon"
|
||||
shape="exclamation-circle"></clr-icon>
|
||||
<clr-control-error
|
||||
class="max-width-2rem"
|
||||
*ngIf="
|
||||
(retentionTimeNgModel.dirty ||
|
||||
retentionTimeNgModel.touched) &&
|
||||
retentionTimeNgModel.invalid
|
||||
(retentionTimeNgModel.invalid ||
|
||||
!isRetentionTimeValid())
|
||||
">
|
||||
{{ 'CLEARANCES.KEEP_IN_ERROR' | translate }}
|
||||
</clr-control-error>
|
||||
</div>
|
||||
<div class="clr-select-wrapper unit-select">
|
||||
<div
|
||||
class="clr-select-wrapper unit-select"
|
||||
[ngClass]="{
|
||||
pt:
|
||||
(retentionTimeNgModel.dirty ||
|
||||
retentionTimeNgModel.touched) &&
|
||||
(retentionTimeNgModel.invalid ||
|
||||
!isRetentionTimeValid())
|
||||
}">
|
||||
<select
|
||||
[(ngModel)]="retentionUnit"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
|
@ -38,3 +38,11 @@
|
||||
padding-top: 1px;
|
||||
margin-left: 2rem;
|
||||
}
|
||||
|
||||
.max-width-2rem {
|
||||
max-width: 2rem;
|
||||
}
|
||||
|
||||
.pt {
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import { NgForm } from '@angular/forms';
|
||||
|
||||
const ONE_MINUTE: number = 60000;
|
||||
const ONE_DAY: number = 24;
|
||||
const MAX_RETENTION_DAYS: number = 10000;
|
||||
|
||||
@Component({
|
||||
selector: 'app-set-job',
|
||||
@ -313,4 +314,16 @@ export class SetJobComponent implements OnInit, OnDestroy {
|
||||
this.purgeForm?.invalid || !(this.selectedOperations?.length > 0)
|
||||
);
|
||||
}
|
||||
isRetentionTimeValid() {
|
||||
if (this.retentionUnit === RetentionTimeUnit.DAYS) {
|
||||
return (
|
||||
this.retentionTime > 0 &&
|
||||
this.retentionTime <= MAX_RETENTION_DAYS
|
||||
);
|
||||
}
|
||||
return (
|
||||
this.retentionTime > 0 &&
|
||||
this.retentionTime <= MAX_RETENTION_DAYS * ONE_DAY
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -134,9 +134,8 @@
|
||||
'ROBOT_ACCOUNT.NUMBER_REQUIRED' | translate
|
||||
}}</clr-control-error>
|
||||
</clr-input-container>
|
||||
<label
|
||||
*ngIf="canDownloadCert"
|
||||
class="clr-control-label cert-down-label mt-1"
|
||||
<div *ngIf="canDownloadCert" class="clr-form-control">
|
||||
<label class="clr-control-label"
|
||||
>{{ 'CONFIG.ROOT_CERT' | translate }}
|
||||
<clr-tooltip>
|
||||
<clr-icon
|
||||
@ -152,15 +151,16 @@
|
||||
}}</span>
|
||||
</clr-tooltip-content>
|
||||
</clr-tooltip>
|
||||
</label>
|
||||
<div class="clr-control-container cert-down">
|
||||
<a
|
||||
rel="noopener noreferrer"
|
||||
#certDownloadLink
|
||||
class="cert-down"
|
||||
[href]="downloadLink"
|
||||
target="_blank"
|
||||
>{{ 'CONFIG.ROOT_CERT_LINK' | translate }}</a
|
||||
>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<clr-checkbox-container>
|
||||
<label id="repo_read_only_lbl" for="repoReadOnly"
|
||||
>{{ 'CONFIG.REPO_READ_ONLY' | translate }}
|
||||
|
@ -112,15 +112,8 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.cert-down-label {
|
||||
position: relative;
|
||||
|
||||
.cert-down {
|
||||
position: absolute;
|
||||
left: 240px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.cert-down {
|
||||
margin-top: 0.15rem;
|
||||
}
|
||||
|
||||
.info-tips-icon {
|
||||
|
@ -1737,7 +1737,7 @@
|
||||
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||
"KEEP_IN": "Keep records in",
|
||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
||||
"KEEP_IN_ERROR": "This filed is required",
|
||||
"KEEP_IN_ERROR": "The value of this item must be an integer, and the time value must be greater than 0 and less than 10000 days",
|
||||
"DAYS": "Days",
|
||||
"HOURS": "Hours",
|
||||
"INCLUDED_OPERATIONS": "Included operations",
|
||||
@ -1747,7 +1747,7 @@
|
||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||
"PURGE_HISTORY": "Purge History",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Endpoint",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Syslog Endpoint",
|
||||
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
||||
"SKIP_DATABASE_TOOLTIP": "Skip to log audit log in the database, only available when audit log forward endpoint is configured",
|
||||
|
@ -1737,7 +1737,7 @@
|
||||
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||
"KEEP_IN": "Keep records in",
|
||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
||||
"KEEP_IN_ERROR": "This filed is required",
|
||||
"KEEP_IN_ERROR": "The value of this item must be an integer, and the time value must be greater than 0 and less than 10000 days",
|
||||
"DAYS": "Days",
|
||||
"HOURS": "Hours",
|
||||
"INCLUDED_OPERATIONS": "Included operations",
|
||||
@ -1747,7 +1747,7 @@
|
||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||
"PURGE_HISTORY": "Purge History",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Endpoint",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Syslog Endpoint",
|
||||
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
||||
"SKIP_DATABASE_TOOLTIP": "Skip to log audit log in the database, only available when audit log forward endpoint is configured",
|
||||
|
@ -1736,7 +1736,7 @@
|
||||
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||
"KEEP_IN": "Keep records in",
|
||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
||||
"KEEP_IN_ERROR": "This filed is required",
|
||||
"KEEP_IN_ERROR": "The value of this item must be an integer, and the time value must be greater than 0 and less than 10000 days",
|
||||
"DAYS": "Days",
|
||||
"HOURS": "Hours",
|
||||
"INCLUDED_OPERATIONS": "Included operations",
|
||||
@ -1746,7 +1746,7 @@
|
||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||
"PURGE_HISTORY": "Purge History",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Endpoint",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Syslog Endpoint",
|
||||
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
||||
"SKIP_DATABASE_TOOLTIP": "Skip to log audit log in the database, only available when audit log forward endpoint is configured",
|
||||
|
@ -1706,7 +1706,7 @@
|
||||
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||
"KEEP_IN": "Keep records in",
|
||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
||||
"KEEP_IN_ERROR": "This filed is required",
|
||||
"KEEP_IN_ERROR": "The value of this item must be an integer, and the time value must be greater than 0 and less than 10000 days",
|
||||
"DAYS": "Days",
|
||||
"HOURS": "Hours",
|
||||
"INCLUDED_OPERATIONS": "Included operations",
|
||||
@ -1716,7 +1716,7 @@
|
||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||
"PURGE_HISTORY": "Purge History",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Endpoint",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Syslog Endpoint",
|
||||
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
||||
"SKIP_DATABASE_TOOLTIP": "Skip to log audit log in the database, only available when audit log forward endpoint is configured",
|
||||
|
@ -1733,7 +1733,7 @@
|
||||
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||
"KEEP_IN": "Keep records in",
|
||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
||||
"KEEP_IN_ERROR": "This filed is required",
|
||||
"KEEP_IN_ERROR": "The value of this item must be an integer, and the time value must be greater than 0 and less than 10000 days",
|
||||
"DAYS": "Days",
|
||||
"HOURS": "Hours",
|
||||
"INCLUDED_OPERATIONS": "Included operations",
|
||||
@ -1743,7 +1743,7 @@
|
||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||
"PURGE_HISTORY": "Purge History",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Endpoint",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Syslog Endpoint",
|
||||
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
||||
"SKIP_DATABASE_TOOLTIP": "Skip to log audit log in the database, only available when audit log forward endpoint is configured",
|
||||
|
@ -1737,7 +1737,7 @@
|
||||
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||
"KEEP_IN": "Keep records in",
|
||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
||||
"KEEP_IN_ERROR": "This filed is required",
|
||||
"KEEP_IN_ERROR": "The value of this item must be an integer, and the time value must be greater than 0 and less than 10000 days",
|
||||
"DAYS": "Days",
|
||||
"HOURS": "Hours",
|
||||
"INCLUDED_OPERATIONS": "Included operations",
|
||||
@ -1747,7 +1747,7 @@
|
||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||
"PURGE_HISTORY": "Purge History",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Endpoint",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Syslog Endpoint",
|
||||
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
||||
"SKIP_DATABASE_TOOLTIP": "Skip to log audit log in the database, only available when audit log forward endpoint is configured",
|
||||
|
@ -1735,7 +1735,7 @@
|
||||
"SCHEDULE_TO_PURGE": "当前定时任务",
|
||||
"KEEP_IN": "保留记录",
|
||||
"KEEP_IN_TOOLTIP": "保留指定时间内的日志记录",
|
||||
"KEEP_IN_ERROR": "此项为必填项",
|
||||
"KEEP_IN_ERROR": "该项的数值需为整数,且时间值必须大于0且小于10000天",
|
||||
"DAYS": "天",
|
||||
"HOURS": "小时",
|
||||
"INCLUDED_OPERATIONS": "包含操作",
|
||||
|
@ -1728,7 +1728,7 @@
|
||||
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||
"KEEP_IN": "Keep records in",
|
||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
||||
"KEEP_IN_ERROR": "This filed is required",
|
||||
"KEEP_IN_ERROR": "The value of this item must be an integer, and the time value must be greater than 0 and less than 10000 days",
|
||||
"DAYS": "Days",
|
||||
"HOURS": "Hours",
|
||||
"INCLUDED_OPERATIONS": "Included operations",
|
||||
@ -1738,7 +1738,7 @@
|
||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||
"PURGE_HISTORY": "Purge History",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Endpoint",
|
||||
"FORWARD_ENDPOINT": "Audit Log Forward Syslog Endpoint",
|
||||
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
||||
"SKIP_DATABASE_TOOLTIP": "Skip to log audit log in the database, only available when audit log forward endpoint is configured",
|
||||
|
Loading…
Reference in New Issue
Block a user