From 8a1f3b7c0051ba29a07605283b6e630d75992787 Mon Sep 17 00:00:00 2001 From: FangyuanCheng Date: Wed, 3 Apr 2019 14:37:01 +0800 Subject: [PATCH] Fix cannot search for replication tasks Signed-off-by: FangyuanCheng --- .../lib/src/endpoint/endpoint.component.html | 8 +++--- .../replication-tasks.component.html | 25 +++++++++---------- .../replication-tasks.component.ts | 20 ++++++++++++--- .../replication/replication.component.html | 7 +----- .../src/replication/replication.component.ts | 7 ------ src/portal/src/i18n/lang/en-us-lang.json | 6 ++--- src/portal/src/i18n/lang/es-es-lang.json | 6 ++--- src/portal/src/i18n/lang/fr-fr-lang.json | 6 ++--- src/portal/src/i18n/lang/pt-br-lang.json | 6 ++--- src/portal/src/i18n/lang/zh-cn-lang.json | 6 ++--- 10 files changed, 48 insertions(+), 49 deletions(-) diff --git a/src/portal/lib/src/endpoint/endpoint.component.html b/src/portal/lib/src/endpoint/endpoint.component.html index 112317ba2..43168c25a 100644 --- a/src/portal/lib/src/endpoint/endpoint.component.html +++ b/src/portal/lib/src/endpoint/endpoint.component.html @@ -18,22 +18,22 @@ {{'DESTINATION.NAME' | translate}} - {{'DESTINATION.STATUS' | translate}} + {{'DESTINATION.STATUS' | translate}} {{'DESTINATION.URL' | translate}} - {{'DESTINATION.PROVIDER' | translate}} + {{'DESTINATION.PROVIDER' | translate}} {{'CONFIG.VERIFY_REMOTE_CERT' | translate }} {{'DESTINATION.AUTHENTICATION' | translate }} {{'DESTINATION.CREATION_TIME' | translate}} {{'DESTINATION.PLACEHOLDER' | translate }} {{t.name}} - +
Unhealthy
Healthy
Unknown
{{t.url}} - {{t.type}} + {{t.type}} {{!t.insecure}} diff --git a/src/portal/lib/src/replication/replication-tasks/replication-tasks.component.html b/src/portal/lib/src/replication/replication-tasks/replication-tasks.component.html index be9f5d96f..427e9241f 100644 --- a/src/portal/lib/src/replication/replication-tasks/replication-tasks.component.html +++ b/src/portal/lib/src/replication/replication-tasks/replication-tasks.component.html @@ -24,7 +24,7 @@
- {{'REPLICATION.FAILTURE'| translate}} + {{'REPLICATION.FAILURE'| translate}}
@@ -50,15 +50,15 @@
{{'REPLICATION.SUCCESS'| translate}} -
{{'1'}}
+
{{successNum}}
- {{'REPLICATION.FAILTURE'| translate}} -
{{'2'}}
+ {{'REPLICATION.FAILURE'| translate}} +
{{failedNum}}
{{'REPLICATION.IN_PROGRESS'| translate}} -
{{'3'}}
+
{{progressNum}}
@@ -70,26 +70,25 @@
- + +
+ filterPlaceholder='{{"REPLICATION.FILTER_PLACEHOLDER" | translate}}' (filterEvt)="doSearch($event)"> - - +
{{'REPLICATION.TASK_ID'| translate}} - {{'REPLICATION.RECOURCE_TYPE' + {{'REPLICATION.RESOURCE_TYPE' | translate}} - {{'REPLICATION.RECOURCE' | + {{'REPLICATION.SOURCE' | translate}} {{'REPLICATION.DESTINATION' | translate}} diff --git a/src/portal/lib/src/replication/replication-tasks/replication-tasks.component.ts b/src/portal/lib/src/replication/replication-tasks/replication-tasks.component.ts index e7431ffeb..43daa09ad 100644 --- a/src/portal/lib/src/replication/replication-tasks/replication-tasks.component.ts +++ b/src/portal/lib/src/replication/replication-tasks/replication-tasks.component.ts @@ -16,7 +16,7 @@ export class ReplicationTasksComponent implements OnInit { selectedRow: []; loading = false; searchTask: string; - defaultFilter = "recourceType"; + defaultFilter = "resourceType"; tasks: ReplicationTasks[] = []; tasksCopy: ReplicationTasks[] = []; stopOnGoing: boolean; @@ -66,12 +66,24 @@ export class ReplicationTasksComponent implements OnInit { : null; } + public get successNum(): string { + return this.executions && this.executions['succeed']; + } + + public get failedNum(): string { + return this.executions && this.executions['failed']; + } + + public get progressNum(): string { + return this.executions && this.executions['in_progress']; + } + stopJob() { this.stopOnGoing = true; this.replicationService.stopJobs(this.executionId) .subscribe(response => { this.stopOnGoing = false; - // this.getExecutions(); + this.getExecutionDetail(); this.translate.get("REPLICATION.STOP_SUCCESS", { param: this.executionId }).subscribe((res: string) => { this.errorHandler.info(res); }); @@ -90,11 +102,11 @@ export class ReplicationTasksComponent implements OnInit { this.replicationService.getReplicationTasks(this.executionId) .pipe(finalize(() => (this.loading = false))) .subscribe(tasks => { - if (this.defaultFilter === 'recourceType') { + if (this.defaultFilter === 'resourceType') { this.tasks = tasks.filter(x => x.resource_type.includes(this.searchTask) ); - } else if (this.defaultFilter === 'recource') { + } else if (this.defaultFilter === 'resource') { this.tasks = tasks.filter(x => x.src_resource.includes(this.searchTask) ); diff --git a/src/portal/lib/src/replication/replication.component.html b/src/portal/lib/src/replication/replication.component.html index 4ff26293c..af25d2161 100644 --- a/src/portal/lib/src/replication/replication.component.html +++ b/src/portal/lib/src/replication/replication.component.html @@ -25,12 +25,7 @@
{{'REPLICATION.REPLICATION_EXECUTIONS' | translate}}
- - - - - +
diff --git a/src/portal/lib/src/replication/replication.component.ts b/src/portal/lib/src/replication/replication.component.ts index b5b72915f..731031be8 100644 --- a/src/portal/lib/src/replication/replication.component.ts +++ b/src/portal/lib/src/replication/replication.component.ts @@ -74,11 +74,6 @@ const jobStatus: { [key: string]: any } = [ { key: "canceled", description: "REPLICATION.CANCELED" } ]; -const optionalSearch: {} = { - 0: "REPLICATION.ADVANCED", - 1: "REPLICATION.SIMPLE" -}; - export class SearchOption { ruleId: number | string; ruleName: string = ""; @@ -130,8 +125,6 @@ export class ReplicationComponent implements OnInit, OnDestroy { hiddenJobList = true; jobs: ReplicationJobItem[]; - - toggleJobSearchOption = optionalSearch; currentJobSearchOption: number; @ViewChild(ListReplicationRuleComponent) diff --git a/src/portal/src/i18n/lang/en-us-lang.json b/src/portal/src/i18n/lang/en-us-lang.json index dc5514134..980326463 100644 --- a/src/portal/src/i18n/lang/en-us-lang.json +++ b/src/portal/src/i18n/lang/en-us-lang.json @@ -337,14 +337,14 @@ "STOP_SUCCESS": "Stop Execution {{param}} Successful", "STOP_SUMMARY": "Do you want to stop the executions {{param}}?", "TASK_ID":"Task ID", - "RECOURCE_TYPE": "Recource Type", - "RECOURCE": "Recource", + "RESOURCE_TYPE": "Resource Type", + "SOURCE": "Source", "DESTINATION": "Destination", "POLICY": "Policy", "DURATION": "Duration", "SUCCESS_RATE": "Success Rate", "SUCCESS": "SUCCESS", - "FAILTURE": "FAILTURE", + "FAILURE": "FAILURE", "IN_PROGRESS": "IN PROGRESS", "REPLICATION_RULE": "Replication Rule", "NEW_REPLICATION_RULE": "New Replication Rule", diff --git a/src/portal/src/i18n/lang/es-es-lang.json b/src/portal/src/i18n/lang/es-es-lang.json index d6544c721..8de8498e9 100644 --- a/src/portal/src/i18n/lang/es-es-lang.json +++ b/src/portal/src/i18n/lang/es-es-lang.json @@ -336,14 +336,14 @@ "STOP_SUCCESS": "Stop Execution {{param}} Successful", "STOP_SUMMARY": "De que desea detener las ejecuciones {{param}}?", "TASK_ID":"Task ID", - "RECOURCE_TYPE": "Recource Type", - "RECOURCE": "Recource", + "RESOURCE_TYPE": "Resource Type", + "SOURCE": "Source", "DESTINATION": "Destination", "POLICY": "Policy", "DURATION": "Duration", "SUCCESS_RATE": "Success Rate", "SUCCESS": "SUCCESS", - "FAILTURE": "FAILTURE", + "FAILURE": "FAILURE", "IN_PROGRESS": "IN PROGRESS", "STOP_EXECUTIONS": "Stop Execution", "ID":"ID", diff --git a/src/portal/src/i18n/lang/fr-fr-lang.json b/src/portal/src/i18n/lang/fr-fr-lang.json index 8015c35c1..8db3ab3d2 100644 --- a/src/portal/src/i18n/lang/fr-fr-lang.json +++ b/src/portal/src/i18n/lang/fr-fr-lang.json @@ -321,14 +321,14 @@ "STOP_SUCCESS": "Stop Execution {{param}} Successful", "STOP_SUMMARY": "Voulez-vous arrêter les exécutions {{param}}?", "TASK_ID":"Task ID", - "RECOURCE_TYPE": "Recource Type", - "RECOURCE": "Recource", + "RESOURCE_TYPE": "Resource Type", + "SOURCE": "Source", "DESTINATION": "Destination", "POLICY": "Policy", "DURATION": "Duration", "SUCCESS_RATE": "Success Rate", "SUCCESS": "SUCCESS", - "FAILTURE": "FAILTURE", + "FAILURE": "FAILURE", "IN_PROGRESS": "IN PROGRESS", "STOP_EXECUTIONS": "Stop Execution", "ID":"ID", diff --git a/src/portal/src/i18n/lang/pt-br-lang.json b/src/portal/src/i18n/lang/pt-br-lang.json index 278ec5012..af5fb4996 100644 --- a/src/portal/src/i18n/lang/pt-br-lang.json +++ b/src/portal/src/i18n/lang/pt-br-lang.json @@ -335,14 +335,14 @@ "STOP_SUCCESS": "Stop Execution {{param}} Successful", "STOP_SUMMARY": "Você quer parar as execuções? {{param}}?", "TASK_ID":"Task ID", - "RECOURCE_TYPE": "Recource Type", - "RECOURCE": "Recource", + "RESOURCE_TYPE": "Resource Type", + "SOURCE": "Source", "DESTINATION": "Destination", "POLICY": "Policy", "DURATION": "Duration", "SUCCESS_RATE": "Success Rate", "SUCCESS": "SUCCESS", - "FAILTURE": "FAILTURE", + "FAILURE": "FAILURE", "IN_PROGRESS": "IN PROGRESS", "STOP_EXECUTIONS": "Stop Execution", "ID":"ID", diff --git a/src/portal/src/i18n/lang/zh-cn-lang.json b/src/portal/src/i18n/lang/zh-cn-lang.json index cba971c1c..1b0e2c98e 100644 --- a/src/portal/src/i18n/lang/zh-cn-lang.json +++ b/src/portal/src/i18n/lang/zh-cn-lang.json @@ -336,14 +336,14 @@ "STOP_SUCCESS": "停止任务 {{param}} 成功", "STOP_SUMMARY": "确认停止任务{{param}}?", "TASK_ID":"任务ID", - "RECOURCE_TYPE": "源类型", - "RECOURCE": "源", + "RESOURCE_TYPE": "源类型", + "SOURCE": "源", "DESTINATION": "目标", "POLICY": "政策", "DURATION": "到期时间", "SUCCESS_RATE": "成功百分比", "SUCCESS": "成功", - "FAILTURE": "失败", + "FAILURE": "失败", "IN_PROGRESS": "进行中", "STOP_EXECUTIONS": "停止任务", "ID":"ID",