From 16153f25be74f6def70e2d38a0bae0af9d196646 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Thu, 8 Aug 2019 14:46:49 +0800 Subject: [PATCH] feat: support new deploy format Change-Id: Ie7fa4e3e43e2b9b1ba294e8589ee07c4af712981 Issue-ID: DCAEGEN2-1671 Signed-off-by: cyuamber --- .../template/template-list/template-list.component.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.ts b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.ts index 156e3ed7..de76a9d6 100644 --- a/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.ts +++ b/components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.ts @@ -221,8 +221,16 @@ export class TemplateListComponent { this.dashboardApiService.deployTemplateKibana(id, body).subscribe( res => { this.spinner.hide(); - if (JSON.stringify(res).length <= 2) { - this.notificationService.success("Deploy_SUCCESSFULLY"); + let processArr = [] + Object.keys(res).map(item => + processArr.push({ name: item, status: res[item] }) + ) + + if (processArr.length !== 0) { + processArr.map(item => + item.status ? + setTimeout(() => { this.notificationService.success("Deploy_SUCCESSFULLY") }, 1000) : + setTimeout(() => { this.notificationService.error("Deploy_FAILED") }, 2000)) } else { this.notificationService.error("Deploy_FAILED"); } -- 2.16.6