feat: support new deploy format 05/93005/4
authorcyuamber <xuranyjy@chinamobile.com>
Thu, 8 Aug 2019 06:46:49 +0000 (14:46 +0800)
committerYan Yang <yangyanyj@chinamobile.com>
Mon, 12 Aug 2019 01:25:16 +0000 (01:25 +0000)
Change-Id: Ie7fa4e3e43e2b9b1ba294e8589ee07c4af712981
Issue-ID: DCAEGEN2-1671
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
components/datalake-handler/admin/src/src/app/views/dashboard-setting/template/template-list/template-list.component.ts

index 156e3ed..de76a9d 100644 (file)
@@ -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");
         }