diff --git a/src/ui_ng/src/app/log/recent-log.component.html b/src/ui_ng/src/app/log/recent-log.component.html index 492d900df..34777cfde 100644 --- a/src/ui_ng/src/app/log/recent-log.component.html +++ b/src/ui_ng/src/app/log/recent-log.component.html @@ -11,7 +11,7 @@
- + diff --git a/src/ui_ng/src/app/log/recent-log.component.ts b/src/ui_ng/src/app/log/recent-log.component.ts index 2546d4a26..82a8e1dc7 100644 --- a/src/ui_ng/src/app/log/recent-log.component.ts +++ b/src/ui_ng/src/app/log/recent-log.component.ts @@ -22,6 +22,7 @@ export class RecentLogComponent implements OnInit { private logsCache: AuditLog[]; private onGoing: boolean = false; private lines: number = 10; //Support 10, 25 and 50 + currentTerm: string; constructor( private session: SessionService, @@ -35,6 +36,7 @@ export class RecentLogComponent implements OnInit { } private handleOnchange($event: any) { + this.currentTerm = ''; if ($event && $event.target && $event.target["value"]) { this.lines = $event.target["value"]; if (this.lines < 10) { @@ -57,7 +59,7 @@ export class RecentLogComponent implements OnInit { this.recentLogs = this.logsCache.filter(log => log.username != ""); return; } - + this.currentTerm = terms; this.recentLogs = this.logsCache.filter(log => this.isMatched(terms, log)); } diff --git a/src/ui_ng/src/app/project/member/member.component.html b/src/ui_ng/src/app/project/member/member.component.html index 7a5a8a069..19e87e1d6 100644 --- a/src/ui_ng/src/app/project/member/member.component.html +++ b/src/ui_ng/src/app/project/member/member.component.html @@ -6,7 +6,7 @@
- + diff --git a/src/ui_ng/src/app/project/member/member.component.ts b/src/ui_ng/src/app/project/member/member.component.ts index a35e4ea1a..d894ed7ca 100644 --- a/src/ui_ng/src/app/project/member/member.component.ts +++ b/src/ui_ng/src/app/project/member/member.component.ts @@ -43,6 +43,8 @@ export class MemberComponent implements OnInit, OnDestroy { currentUser: SessionUser; hasProjectAdminRole: boolean; + searchMember: string; + constructor( private route: ActivatedRoute, private router: Router, @@ -108,6 +110,7 @@ export class MemberComponent implements OnInit, OnDestroy { } addedMember() { + this.searchMember = ''; this.retrieve(this.projectId, ''); } @@ -138,7 +141,8 @@ export class MemberComponent implements OnInit, OnDestroy { } doSearch(searchMember) { - this.retrieve(this.projectId, searchMember); + this.searchMember = searchMember; + this.retrieve(this.projectId, this.searchMember); } refresh() { diff --git a/src/ui_ng/src/app/project/project.component.html b/src/ui_ng/src/app/project/project.component.html index e53389826..6dc92b80b 100644 --- a/src/ui_ng/src/app/project/project.component.html +++ b/src/ui_ng/src/app/project/project.component.html @@ -20,7 +20,7 @@ {{projectTypes[1] | translate}}
- + diff --git a/src/ui_ng/src/app/replication/destination/destination.component.html b/src/ui_ng/src/app/replication/destination/destination.component.html index 83117a541..2115ff6c2 100644 --- a/src/ui_ng/src/app/replication/destination/destination.component.html +++ b/src/ui_ng/src/app/replication/destination/destination.component.html @@ -6,7 +6,7 @@
- + diff --git a/src/ui_ng/src/app/replication/destination/destination.component.ts b/src/ui_ng/src/app/replication/destination/destination.component.ts index e1e76fd3b..6fa72e37e 100644 --- a/src/ui_ng/src/app/replication/destination/destination.component.ts +++ b/src/ui_ng/src/app/replication/destination/destination.component.ts @@ -87,6 +87,7 @@ export class DestinationComponent implements OnInit { } reload() { + this.targetName = ''; this.retrieve(''); } diff --git a/src/ui_ng/src/app/replication/replication.component.html b/src/ui_ng/src/app/replication/replication.component.html index f485a1b3d..ac6a8e8f8 100644 --- a/src/ui_ng/src/app/replication/replication.component.html +++ b/src/ui_ng/src/app/replication/replication.component.html @@ -15,7 +15,7 @@ {{r.description | translate}}
- + @@ -23,14 +23,14 @@
- +
{{'REPLICATION.REPLICATION_JOBS' | translate}}
- + @@ -47,8 +47,8 @@
- - + +
diff --git a/src/ui_ng/src/app/replication/replication.component.ts b/src/ui_ng/src/app/replication/replication.component.ts index 9efe04e54..e1151e9d2 100644 --- a/src/ui_ng/src/app/replication/replication.component.ts +++ b/src/ui_ng/src/app/replication/replication.component.ts @@ -68,7 +68,7 @@ export class ReplicationComponent implements OnInit { changedJobs: Job[]; initSelectedId: number; - policies: Policy[]; + policies: Policy[];retrieve jobs: Job[]; jobsTotalRecordCount: number; @@ -144,7 +144,6 @@ export class ReplicationComponent implements OnInit { if(state) { this.search.page = state.page.to + 1; } - console.log('Received policy ID ' + this.search.policyId + ' by clicked row.'); this.replicationService .listJobs(this.search.policyId, this.search.status, this.search.repoName, this.search.startTime, this.search.endTime, this.search.page, this.search.pageSize) @@ -157,7 +156,6 @@ export class ReplicationComponent implements OnInit { for(let i = 0; i < this.jobs.length; i++) { let j = this.jobs[i]; if(j.status == 'retrying' || j.status == 'error') { - console.log('Error in jobs were found.') this.messageHandlerService.showError('REPLICATION.FOUND_ERROR_IN_JOBS', ''); break; } @@ -167,9 +165,13 @@ export class ReplicationComponent implements OnInit { ); } - selectOne(policy: Policy) { + selectOnePolicy(policy: Policy) { if(policy) { this.search.policyId = policy.id; + this.search.repoName = ''; + this.search.status = '' + this.currentJobSearchOption = 0; + this.currentJobStatus = { 'key': '', 'description': 'REPLICATION.ALL'}; this.fetchPolicyJobs(); } } @@ -180,7 +182,6 @@ export class ReplicationComponent implements OnInit { } doFilterPolicyStatus(status: string) { - console.log('Do filter policies with status:' + status); this.currentRuleStatus = this.ruleStatus.find(r=>r.key === status); if(status.trim() === '') { this.changedPolicies = this.policies; @@ -190,13 +191,9 @@ export class ReplicationComponent implements OnInit { } doFilterJobStatus(status: string) { - console.log('Do filter jobs with status:' + status); this.currentJobStatus = this.jobStatus.find(r=>r.key === status); - if(status.trim() === '') { - this.changedJobs = this.jobs; - } else { - this.changedJobs = this.jobs.filter(job=>job.status === status); - } + this.search.status = status; + this.doSearchJobs(this.search.repoName); } doSearchJobs(repoName: string) { @@ -223,21 +220,20 @@ export class ReplicationComponent implements OnInit { (option === 1) ? this.currentJobSearchOption = 0 : this.currentJobSearchOption = 1; } - doJobSearchByTimeRange(strDate: string, target: string) { + doJobSearchByStartTime(strDate: string) { + if(!strDate || strDate.trim() === '') { + strDate = 0 + ''; + } + (strDate === '0') ? this.search.startTime = '' : this.search.startTime = (new Date(strDate).getTime() / 1000) + ''; + this.fetchPolicyJobs(); + } + + doJobSearchByEndTime(strDate: string) { if(!strDate || strDate.trim() === '') { strDate = 0 + ''; } let oneDayOffset = 3600 * 24; - switch(target) { - case 'begin': - this.search.startTime = (new Date(strDate).getTime() / 1000) + ''; - break; - case 'end': - this.search.endTime = (new Date(strDate).getTime() / 1000 + oneDayOffset) + ''; - break; - } - console.log('Search jobs filtered by time range, begin: ' + this.search.startTime + ', end:' + this.search.endTime); + (strDate === '0') ? this.search.endTime = '' : this.search.endTime = (new Date(strDate).getTime() / 1000 + oneDayOffset) + ''; this.fetchPolicyJobs(); } - } \ No newline at end of file diff --git a/src/ui_ng/src/app/replication/total-replication/total-replication.component.html b/src/ui_ng/src/app/replication/total-replication/total-replication.component.html index b7adf1d07..1236b7ecc 100644 --- a/src/ui_ng/src/app/replication/total-replication/total-replication.component.html +++ b/src/ui_ng/src/app/replication/total-replication/total-replication.component.html @@ -2,7 +2,7 @@
- +
diff --git a/src/ui_ng/src/app/replication/total-replication/total-replication.component.ts b/src/ui_ng/src/app/replication/total-replication/total-replication.component.ts index 75d8e8bff..07a26ce46 100644 --- a/src/ui_ng/src/app/replication/total-replication/total-replication.component.ts +++ b/src/ui_ng/src/app/replication/total-replication/total-replication.component.ts @@ -71,6 +71,7 @@ export class TotalReplicationComponent implements OnInit { reloadPolicies(isReady: boolean) { if(isReady) { + this.policyName = ''; this.retrievePolicies(); } } diff --git a/src/ui_ng/src/app/shared/filter/filter.component.ts b/src/ui_ng/src/app/shared/filter/filter.component.ts index ee8326071..62786b343 100644 --- a/src/ui_ng/src/app/shared/filter/filter.component.ts +++ b/src/ui_ng/src/app/shared/filter/filter.component.ts @@ -12,16 +12,14 @@ import 'rxjs/add/operator/distinctUntilChanged'; styleUrls: ['filter.component.css'] }) -export class FilterComponent implements OnInit{ +export class FilterComponent implements OnInit { + private placeHolder: string = ""; - private currentValue: string = ""; - private leadingSpacesAdded: boolean = false; - private filerAction: Function; - private filterTerms = new Subject(); @Output("filter") private filterEvt = new EventEmitter(); + @Input() currentValue; @Input("filterPlaceholder") public set flPlaceholder(placeHolder: string) { this.placeHolder = placeHolder; @@ -34,6 +32,7 @@ export class FilterComponent implements OnInit{ .subscribe(terms => { this.filterEvt.emit(terms); }); + } valueChange(): void { diff --git a/src/ui_ng/src/app/user/user.component.html b/src/ui_ng/src/app/user/user.component.html index 6410d3cf5..e8ed38f66 100644 --- a/src/ui_ng/src/app/user/user.component.html +++ b/src/ui_ng/src/app/user/user.component.html @@ -5,7 +5,7 @@ - + diff --git a/src/ui_ng/src/app/user/user.component.ts b/src/ui_ng/src/app/user/user.component.ts index c6206aa69..9a489babd 100644 --- a/src/ui_ng/src/app/user/user.component.ts +++ b/src/ui_ng/src/app/user/user.component.ts @@ -30,6 +30,8 @@ export class UserComponent implements OnInit, OnDestroy { private adminColumn: string = ""; private deletionSubscription: Subscription; + currentTerm: string; + @ViewChild(NewUserModalComponent) private newUserDialog: NewUserModalComponent; @@ -107,6 +109,7 @@ export class UserComponent implements OnInit, OnDestroy { //Filter items by keywords doFilter(terms: string): void { + this.currentTerm = terms; this.originalUsers.then(users => { if (terms.trim() === "") { this.users = users; @@ -175,6 +178,7 @@ export class UserComponent implements OnInit, OnDestroy { .then(() => { //Remove it from current user list //and then view refreshed + this.currentTerm = ''; this.originalUsers.then(users => { this.users = users.filter(u => u.user_id != user.user_id); this.msgHandler.showSuccess("USER.DELETE_SUCCESS"); @@ -188,6 +192,7 @@ export class UserComponent implements OnInit, OnDestroy { //Refresh the user list refreshUser(): void { //Start to get + this.currentTerm = ''; this.onGoing = true; this.originalUsers = this.userService.getUsers()