From 0f94d079d5698b21aad9409ee23b82e84cd0f547 Mon Sep 17 00:00:00 2001 From: liuwh7 Date: Wed, 13 Oct 2021 11:19:07 +0800 Subject: feat: modify intent based service Signed-off-by: liuwh7 Change-Id: I9974fb12163823288292cfc9ded92fefec3767eb Issue-ID: USECASEUI-605 --- .../monitor-facps-service.component.ts | 98 ++++++---------------- 1 file changed, 27 insertions(+), 71 deletions(-) (limited to 'usecaseui-portal/src/app/views/fcaps') diff --git a/usecaseui-portal/src/app/views/fcaps/monitor-management-service/monitor-facps-service/monitor-facps-service.component.ts b/usecaseui-portal/src/app/views/fcaps/monitor-management-service/monitor-facps-service/monitor-facps-service.component.ts index 8da138bf..1c5017c4 100644 --- a/usecaseui-portal/src/app/views/fcaps/monitor-management-service/monitor-facps-service/monitor-facps-service.component.ts +++ b/usecaseui-portal/src/app/views/fcaps/monitor-management-service/monitor-facps-service/monitor-facps-service.component.ts @@ -19,62 +19,7 @@ export class MonitorFacpsServiceComponent implements OnInit { selectedSubscriptionType: string = ""; selectedServiceInstance: string = ""; selectedTopology: string = ""; - instanceId: string = ""; - chartData: any = { - xAxis: { - data: [ - "2018-09-10 ", - "2018-09-11", - "2018-09-12", - "2018-09-13", - "2018-09-14", - "2018-09-15", - "2018-09-16", - "2018-09-17", - "2018-09-18", - "2018-09-19", - "2018-09-20", - "2018-09-21", - "2018-09-22" - ] - }, - series: [ - { - data: [ - 30, - 45, - 34, - 35, - 43, - 56, - 36, - 53, - 42, - 45, - 44, - 35, - 32 - ] - }, - { - data: [ - 60, - 60, - 60, - 60, - 60, - 60, - 60, - 60, - 60, - 60, - 60, - 60, - 60 - ] - } - ] - }; + instanceId: string = ""; initData: any = { height: 320, option: { @@ -106,6 +51,7 @@ export class MonitorFacpsServiceComponent implements OnInit { updateOption: any; instanceLists: any[] = []; + progressSetTimeOut: any; ngOnInit() { this.getFinishedInstanceInfo(); @@ -179,21 +125,31 @@ export class MonitorFacpsServiceComponent implements OnInit { } queryInstancePerformance(instanceId) { - this.myHttp.queryInstancePerformanceData({ instanceId}).subscribe( - (response) => { - const { code, message, data } = response; - if (code !== 200) { - this.nzMessage.error(message); - return; - } - if(this.chartIntance){ - this.updateOption = data; + const requery = () => { + this.myHttp.queryInstancePerformanceData({ instanceId}).subscribe( + (response) => { + const { code, message, data } = response; + if (code !== 200) { + this.nzMessage.error(message); + } else { + if(this.chartIntance) { + this.updateOption = data; + } + } + + if (this.progressSetTimeOut) { + clearInterval(this.progressSetTimeOut); + } + + this.progressSetTimeOut = setTimeout(() => { + requery(); + }, 5000); + }, + (err) => { + console.log(err); } - }, - (err) => { - console.log(err); - } - ) + ) + } + requery(); } - } -- cgit 1.2.3-korg