mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-08 07:51:25 +01:00
Fix UI compile issues.
This commit is contained in:
parent
e8113fa3fa
commit
1d98212d60
@ -42,4 +42,6 @@ export class AuditLog {
|
|||||||
keywords: string;
|
keywords: string;
|
||||||
page: number;
|
page: number;
|
||||||
page_size: number;
|
page_size: number;
|
||||||
|
fromTime: string;
|
||||||
|
toTime: string;
|
||||||
}
|
}
|
@ -41,14 +41,14 @@
|
|||||||
<div class="flex-items-xs-middle">
|
<div class="flex-items-xs-middle">
|
||||||
<clr-icon shape="date"></clr-icon>
|
<clr-icon shape="date"></clr-icon>
|
||||||
<label for="fromDateInput" aria-haspopup="true" role="tooltip" [class.invalid]="fromTime.errors && fromTime.errors.dateValidator && (fromTime.dirty || fromTime.touched)" [class.valid]="fromTime.valid" class="tooltip tooltip-validation invalid tooltip-sm">
|
<label for="fromDateInput" aria-haspopup="true" role="tooltip" [class.invalid]="fromTime.errors && fromTime.errors.dateValidator && (fromTime.dirty || fromTime.touched)" [class.valid]="fromTime.valid" class="tooltip tooltip-validation invalid tooltip-sm">
|
||||||
<input id="fromDateInput" type="date" #fromTime="ngModel" name="from" [(ngModel)]="currentJobSearchOption.fromTime" dateValidator placeholder="dd/mm/yyyy" (change)="doJobSearchByStartTime(!(fromTime.errors && fromTime.errors.dateValidator), fromTime.value)">
|
<input id="fromDateInput" type="date" #fromTime="ngModel" name="from" [(ngModel)]="search.startTime" dateValidator placeholder="dd/mm/yyyy" (change)="doJobSearchByStartTime(!(fromTime.errors && fromTime.errors.dateValidator), fromTime.value)">
|
||||||
<span *ngIf="fromTime.errors && fromTime.errors.dateValidator && (fromTime.dirty || fromTime.touched)" class="tooltip-content">
|
<span *ngIf="fromTime.errors && fromTime.errors.dateValidator && (fromTime.dirty || fromTime.touched)" class="tooltip-content">
|
||||||
{{'AUDIT_LOG.INVALID_DATE' | translate }}
|
{{'AUDIT_LOG.INVALID_DATE' | translate }}
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
<clr-icon shape="date"></clr-icon>
|
<clr-icon shape="date"></clr-icon>
|
||||||
<label for="toDateInput" aria-haspopup="true" role="tooltip" [class.invalid]="toTime.errors && toTime.errors.dateValidator && (toTime.dirty || toTime.touched)" [class.valid]="toTime.valid" class="tooltip tooltip-validation invalid tooltip-sm">
|
<label for="toDateInput" aria-haspopup="true" role="tooltip" [class.invalid]="toTime.errors && toTime.errors.dateValidator && (toTime.dirty || toTime.touched)" [class.valid]="toTime.valid" class="tooltip tooltip-validation invalid tooltip-sm">
|
||||||
<input id="toDateInput" type="date" #toTime="ngModel" name="to" [(ngModel)]="currentJobSearchOption.toTime" dateValidator placeholder="dd/mm/yyyy" (change)="doJobSearchByEndTime(!(toTime.errors && toTime.errors.dateValidator),toTime.value)">
|
<input id="toDateInput" type="date" #toTime="ngModel" name="to" [(ngModel)]="search.endTime" dateValidator placeholder="dd/mm/yyyy" (change)="doJobSearchByEndTime(!(toTime.errors && toTime.errors.dateValidator),toTime.value)">
|
||||||
<span *ngIf="toTime.errors && toTime.errors.dateValidator && (toTime.dirty || toTime.touched)" class="tooltip-content">
|
<span *ngIf="toTime.errors && toTime.errors.dateValidator && (toTime.dirty || toTime.touched)" class="tooltip-content">
|
||||||
{{'AUDIT_LOG.INVALID_DATE' | translate }}
|
{{'AUDIT_LOG.INVALID_DATE' | translate }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -52,7 +52,9 @@ class SearchOption {
|
|||||||
repoName: string = '';
|
repoName: string = '';
|
||||||
status: string = '';
|
status: string = '';
|
||||||
startTime: string = '';
|
startTime: string = '';
|
||||||
|
startTimestamp: string = '';
|
||||||
endTime: string = '';
|
endTime: string = '';
|
||||||
|
endTimestamp: string = '';
|
||||||
page: number = 1;
|
page: number = 1;
|
||||||
pageSize: number = 5;
|
pageSize: number = 5;
|
||||||
}
|
}
|
||||||
@ -66,7 +68,7 @@ export class ReplicationComponent implements OnInit {
|
|||||||
|
|
||||||
projectId: number;
|
projectId: number;
|
||||||
|
|
||||||
search: SearchOption;
|
search: SearchOption = new SearchOption();
|
||||||
|
|
||||||
ruleStatus = ruleStatus;
|
ruleStatus = ruleStatus;
|
||||||
currentRuleStatus: {key: string, description: string};
|
currentRuleStatus: {key: string, description: string};
|
||||||
@ -98,7 +100,6 @@ export class ReplicationComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.projectId = +this.route.snapshot.parent.params['id'];
|
this.projectId = +this.route.snapshot.parent.params['id'];
|
||||||
this.search = new SearchOption();
|
|
||||||
this.currentRuleStatus = this.ruleStatus[0];
|
this.currentRuleStatus = this.ruleStatus[0];
|
||||||
this.currentJobStatus = this.jobStatus[0];
|
this.currentJobStatus = this.jobStatus[0];
|
||||||
this.currentJobSearchOption = 0;
|
this.currentJobSearchOption = 0;
|
||||||
@ -149,7 +150,7 @@ export class ReplicationComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
this.replicationService
|
this.replicationService
|
||||||
.listJobs(this.search.policyId, this.search.status, this.search.repoName,
|
.listJobs(this.search.policyId, this.search.status, this.search.repoName,
|
||||||
this.search.startTime, this.search.endTime, this.search.page, this.search.pageSize)
|
this.search.startTimestamp, this.search.endTimestamp, this.search.page, this.search.pageSize)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
response=>{
|
response=>{
|
||||||
this.jobsTotalRecordCount = response.headers.get('x-total-count');
|
this.jobsTotalRecordCount = response.headers.get('x-total-count');
|
||||||
@ -241,21 +242,20 @@ export class ReplicationComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doJobSearchByStartTime(valid: boolean, strDate: string) {
|
doJobSearchByStartTime(valid: boolean, strDate: string) {
|
||||||
this.search.startTime = '';
|
this.search.startTimestamp = '';
|
||||||
if(valid && strDate) {
|
if(valid && strDate) {
|
||||||
strDate = this.convertDate(strDate);
|
strDate = this.convertDate(strDate);
|
||||||
console.log(strDate);
|
this.search.startTimestamp = new Date(strDate).getTime() / 1000 + '';
|
||||||
this.search.startTime = (new Date(strDate).getTime() / 1000) + '';
|
|
||||||
}
|
}
|
||||||
this.fetchPolicyJobs();
|
this.fetchPolicyJobs();
|
||||||
}
|
}
|
||||||
|
|
||||||
doJobSearchByEndTime(valid: boolean, strDate: string) {
|
doJobSearchByEndTime(valid: boolean, strDate: string) {
|
||||||
this.search.endTime = '';
|
this.search.endTimestamp = '';
|
||||||
if(valid && strDate) {
|
if(valid && strDate) {
|
||||||
strDate = this.convertDate(strDate);
|
strDate = this.convertDate(strDate);
|
||||||
let oneDayOffset = 3600 * 24;
|
let oneDayOffset = 3600 * 24;
|
||||||
this.search.endTime = (new Date(strDate).getTime() / 1000 + oneDayOffset) + '';
|
this.search.endTimestamp = (new Date(strDate).getTime() / 1000 + oneDayOffset) + '';
|
||||||
}
|
}
|
||||||
this.fetchPolicyJobs();
|
this.fetchPolicyJobs();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user