mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-16 04:31:22 +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]="
|
[class.clr-error]="
|
||||||
(retentionTimeNgModel.dirty ||
|
(retentionTimeNgModel.dirty ||
|
||||||
retentionTimeNgModel.touched) &&
|
retentionTimeNgModel.touched) &&
|
||||||
retentionTimeNgModel.invalid
|
(retentionTimeNgModel.invalid || !isRetentionTimeValid())
|
||||||
">
|
">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="clr-input-wrapper">
|
<div class="clr-input-wrapper">
|
||||||
@ -95,15 +95,25 @@
|
|||||||
class="clr-validate-icon"
|
class="clr-validate-icon"
|
||||||
shape="exclamation-circle"></clr-icon>
|
shape="exclamation-circle"></clr-icon>
|
||||||
<clr-control-error
|
<clr-control-error
|
||||||
|
class="max-width-2rem"
|
||||||
*ngIf="
|
*ngIf="
|
||||||
(retentionTimeNgModel.dirty ||
|
(retentionTimeNgModel.dirty ||
|
||||||
retentionTimeNgModel.touched) &&
|
retentionTimeNgModel.touched) &&
|
||||||
retentionTimeNgModel.invalid
|
(retentionTimeNgModel.invalid ||
|
||||||
|
!isRetentionTimeValid())
|
||||||
">
|
">
|
||||||
{{ 'CLEARANCES.KEEP_IN_ERROR' | translate }}
|
{{ 'CLEARANCES.KEEP_IN_ERROR' | translate }}
|
||||||
</clr-control-error>
|
</clr-control-error>
|
||||||
</div>
|
</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
|
<select
|
||||||
[(ngModel)]="retentionUnit"
|
[(ngModel)]="retentionUnit"
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
|
@ -38,3 +38,11 @@
|
|||||||
padding-top: 1px;
|
padding-top: 1px;
|
||||||
margin-left: 2rem;
|
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_MINUTE: number = 60000;
|
||||||
const ONE_DAY: number = 24;
|
const ONE_DAY: number = 24;
|
||||||
|
const MAX_RETENTION_DAYS: number = 10000;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-set-job',
|
selector: 'app-set-job',
|
||||||
@ -313,4 +314,16 @@ export class SetJobComponent implements OnInit, OnDestroy {
|
|||||||
this.purgeForm?.invalid || !(this.selectedOperations?.length > 0)
|
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
|
'ROBOT_ACCOUNT.NUMBER_REQUIRED' | translate
|
||||||
}}</clr-control-error>
|
}}</clr-control-error>
|
||||||
</clr-input-container>
|
</clr-input-container>
|
||||||
<label
|
<div *ngIf="canDownloadCert" class="clr-form-control">
|
||||||
*ngIf="canDownloadCert"
|
<label class="clr-control-label"
|
||||||
class="clr-control-label cert-down-label mt-1"
|
|
||||||
>{{ 'CONFIG.ROOT_CERT' | translate }}
|
>{{ 'CONFIG.ROOT_CERT' | translate }}
|
||||||
<clr-tooltip>
|
<clr-tooltip>
|
||||||
<clr-icon
|
<clr-icon
|
||||||
@ -152,15 +151,16 @@
|
|||||||
}}</span>
|
}}</span>
|
||||||
</clr-tooltip-content>
|
</clr-tooltip-content>
|
||||||
</clr-tooltip>
|
</clr-tooltip>
|
||||||
|
</label>
|
||||||
|
<div class="clr-control-container cert-down">
|
||||||
<a
|
<a
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
#certDownloadLink
|
|
||||||
class="cert-down"
|
|
||||||
[href]="downloadLink"
|
[href]="downloadLink"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>{{ 'CONFIG.ROOT_CERT_LINK' | translate }}</a
|
>{{ 'CONFIG.ROOT_CERT_LINK' | translate }}</a
|
||||||
>
|
>
|
||||||
</label>
|
</div>
|
||||||
|
</div>
|
||||||
<clr-checkbox-container>
|
<clr-checkbox-container>
|
||||||
<label id="repo_read_only_lbl" for="repoReadOnly"
|
<label id="repo_read_only_lbl" for="repoReadOnly"
|
||||||
>{{ 'CONFIG.REPO_READ_ONLY' | translate }}
|
>{{ 'CONFIG.REPO_READ_ONLY' | translate }}
|
||||||
|
@ -112,15 +112,8 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cert-down-label {
|
.cert-down {
|
||||||
position: relative;
|
margin-top: 0.15rem;
|
||||||
|
|
||||||
.cert-down {
|
|
||||||
position: absolute;
|
|
||||||
left: 240px;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-tips-icon {
|
.info-tips-icon {
|
||||||
|
@ -1737,7 +1737,7 @@
|
|||||||
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||||
"KEEP_IN": "Keep records in",
|
"KEEP_IN": "Keep records in",
|
||||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
"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",
|
"DAYS": "Days",
|
||||||
"HOURS": "Hours",
|
"HOURS": "Hours",
|
||||||
"INCLUDED_OPERATIONS": "Included operations",
|
"INCLUDED_OPERATIONS": "Included operations",
|
||||||
@ -1747,7 +1747,7 @@
|
|||||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||||
"PURGE_HISTORY": "Purge History",
|
"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",
|
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
"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",
|
"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",
|
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||||
"KEEP_IN": "Keep records in",
|
"KEEP_IN": "Keep records in",
|
||||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
"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",
|
"DAYS": "Days",
|
||||||
"HOURS": "Hours",
|
"HOURS": "Hours",
|
||||||
"INCLUDED_OPERATIONS": "Included operations",
|
"INCLUDED_OPERATIONS": "Included operations",
|
||||||
@ -1747,7 +1747,7 @@
|
|||||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||||
"PURGE_HISTORY": "Purge History",
|
"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",
|
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
"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",
|
"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",
|
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||||
"KEEP_IN": "Keep records in",
|
"KEEP_IN": "Keep records in",
|
||||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
"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",
|
"DAYS": "Days",
|
||||||
"HOURS": "Hours",
|
"HOURS": "Hours",
|
||||||
"INCLUDED_OPERATIONS": "Included operations",
|
"INCLUDED_OPERATIONS": "Included operations",
|
||||||
@ -1746,7 +1746,7 @@
|
|||||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||||
"PURGE_HISTORY": "Purge History",
|
"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",
|
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
"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",
|
"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",
|
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||||
"KEEP_IN": "Keep records in",
|
"KEEP_IN": "Keep records in",
|
||||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
"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",
|
"DAYS": "Days",
|
||||||
"HOURS": "Hours",
|
"HOURS": "Hours",
|
||||||
"INCLUDED_OPERATIONS": "Included operations",
|
"INCLUDED_OPERATIONS": "Included operations",
|
||||||
@ -1716,7 +1716,7 @@
|
|||||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||||
"PURGE_HISTORY": "Purge History",
|
"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",
|
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
"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",
|
"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",
|
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||||
"KEEP_IN": "Keep records in",
|
"KEEP_IN": "Keep records in",
|
||||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
"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",
|
"DAYS": "Days",
|
||||||
"HOURS": "Hours",
|
"HOURS": "Hours",
|
||||||
"INCLUDED_OPERATIONS": "Included operations",
|
"INCLUDED_OPERATIONS": "Included operations",
|
||||||
@ -1743,7 +1743,7 @@
|
|||||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||||
"PURGE_HISTORY": "Purge History",
|
"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",
|
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
"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",
|
"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",
|
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||||
"KEEP_IN": "Keep records in",
|
"KEEP_IN": "Keep records in",
|
||||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
"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",
|
"DAYS": "Days",
|
||||||
"HOURS": "Hours",
|
"HOURS": "Hours",
|
||||||
"INCLUDED_OPERATIONS": "Included operations",
|
"INCLUDED_OPERATIONS": "Included operations",
|
||||||
@ -1747,7 +1747,7 @@
|
|||||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||||
"PURGE_HISTORY": "Purge History",
|
"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",
|
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
"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",
|
"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": "当前定时任务",
|
"SCHEDULE_TO_PURGE": "当前定时任务",
|
||||||
"KEEP_IN": "保留记录",
|
"KEEP_IN": "保留记录",
|
||||||
"KEEP_IN_TOOLTIP": "保留指定时间内的日志记录",
|
"KEEP_IN_TOOLTIP": "保留指定时间内的日志记录",
|
||||||
"KEEP_IN_ERROR": "此项为必填项",
|
"KEEP_IN_ERROR": "该项的数值需为整数,且时间值必须大于0且小于10000天",
|
||||||
"DAYS": "天",
|
"DAYS": "天",
|
||||||
"HOURS": "小时",
|
"HOURS": "小时",
|
||||||
"INCLUDED_OPERATIONS": "包含操作",
|
"INCLUDED_OPERATIONS": "包含操作",
|
||||||
|
@ -1728,7 +1728,7 @@
|
|||||||
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
"SCHEDULE_TO_PURGE": "Schedule to purge",
|
||||||
"KEEP_IN": "Keep records in",
|
"KEEP_IN": "Keep records in",
|
||||||
"KEEP_IN_TOOLTIP": "Keep the records in this interval",
|
"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",
|
"DAYS": "Days",
|
||||||
"HOURS": "Hours",
|
"HOURS": "Hours",
|
||||||
"INCLUDED_OPERATIONS": "Included operations",
|
"INCLUDED_OPERATIONS": "Included operations",
|
||||||
@ -1738,7 +1738,7 @@
|
|||||||
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
"PURGE_NOW_SUCCESS": "Purge triggered successfully",
|
||||||
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
"PURGE_SCHEDULE_RESET": "Purge schedule has been reset",
|
||||||
"PURGE_HISTORY": "Purge History",
|
"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",
|
"FORWARD_ENDPOINT_TOOLTIP": "Forward audit logs to the syslog endpoint, for example: harbor-log:10514",
|
||||||
"SKIP_DATABASE": "Skip Audit Log Database",
|
"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",
|
"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