Display - if the end_time does not exist

Signed-off-by: FangyuanCheng <fangyuanc@vmware.com>
This commit is contained in:
FangyuanCheng 2019-04-29 18:38:21 +08:00
parent cceb624fc2
commit 1b930ad149
3 changed files with 3 additions and 13 deletions

View File

@ -110,7 +110,7 @@
<clr-dg-cell>{{t.operation}}</clr-dg-cell> <clr-dg-cell>{{t.operation}}</clr-dg-cell>
<clr-dg-cell>{{t.status}}</clr-dg-cell> <clr-dg-cell>{{t.status}}</clr-dg-cell>
<clr-dg-cell>{{t.start_time | date: 'short'}}</clr-dg-cell> <clr-dg-cell>{{t.start_time | date: 'short'}}</clr-dg-cell>
<clr-dg-cell>{{t.end_time | date: 'short'}}</clr-dg-cell> <clr-dg-cell>{{t.end_time ? (t.end_time | date: 'short') : "-"}}</clr-dg-cell>
<clr-dg-cell> <clr-dg-cell>
<a target="_blank" [href]="viewLog(t.id)"> <a target="_blank" [href]="viewLog(t.id)">
<clr-icon shape="list"></clr-icon> <clr-icon shape="list"></clr-icon>

View File

@ -8,11 +8,7 @@ import { ErrorHandler } from "../../error-handler/error-handler";
import { ReplicationJob, ReplicationTasks, Comparator, ReplicationJobItem, State } from "../../service/interface"; import { ReplicationJob, ReplicationTasks, Comparator, ReplicationJobItem, State } from "../../service/interface";
import { CustomComparator, DEFAULT_PAGE_SIZE, calculatePage, doFiltering, doSorting } from "../../utils"; import { CustomComparator, DEFAULT_PAGE_SIZE, calculatePage, doFiltering, doSorting } from "../../utils";
import { RequestQueryParams } from "../../service/RequestQueryParams"; import { RequestQueryParams } from "../../service/RequestQueryParams";
const taskStatus: any = { const executionStatus = 'InProgress';
PENDING: "pending",
RUNNING: "running",
SCHEDULED: "scheduled"
};
@Component({ @Component({
selector: 'replication-tasks', selector: 'replication-tasks',
templateUrl: './replication-tasks.component.html', templateUrl: './replication-tasks.component.html',
@ -73,7 +69,7 @@ export class ReplicationTasksComponent implements OnInit, OnDestroy {
if (!this.timerDelay) { if (!this.timerDelay) {
this.timerDelay = timer(10000, 10000).subscribe(() => { this.timerDelay = timer(10000, 10000).subscribe(() => {
let count: number = 0; let count: number = 0;
if (this.executions['in_progress'] > 0) { if (this.executions['status'] === executionStatus) {
count++; count++;
} }
if (count > 0) { if (count > 0) {
@ -180,9 +176,6 @@ export class ReplicationTasksComponent implements OnInit, OnDestroy {
} }
public doSearch(value: string): void { public doSearch(value: string): void {
if (!value) {
return;
}
this.searchTask = value.trim(); this.searchTask = value.trim();
this.loading = true; this.loading = true;
this.clrLoadTasks(); this.clrLoadTasks();

View File

@ -246,9 +246,6 @@ export class ReplicationComponent implements OnInit, OnDestroy {
); );
} }
public doSearchExecutions(terms: string): void { public doSearchExecutions(terms: string): void {
if (!terms) {
return;
}
this.currentTerm = terms.trim(); this.currentTerm = terms.trim();
// Trigger data loading and start from first page // Trigger data loading and start from first page
this.jobsLoading = true; this.jobsLoading = true;