From 5a45365c037a43d2c0a04ffb96b3f91f7e49b6ac Mon Sep 17 00:00:00 2001 From: zhangab Date: Thu, 8 Nov 2018 17:34:00 +0800 Subject: Fix VNF Performance Query Bugs Change-Id: Ibc9c8cbd5425bff5b0158bb7ee2a3a8f25a05e89 Issue-ID: USECASEUI-166 Signed-off-by: zhangab --- usecaseui-portal/src/app/alarm/alarm.component.ts | 6 +-- .../graphiclist/graphiclist.component.html | 6 +-- .../graphiclist/graphiclist.component.ts | 17 +++----- .../performance-details.component.ts | 19 +++++---- usecaseui-portal/src/app/myhttp.service.ts | 18 +++++---- .../performance-vnf/performance-vnf.component.html | 8 ++-- .../performance-vnf/performance-vnf.component.ts | 45 +++++++++++----------- 7 files changed, 60 insertions(+), 59 deletions(-) (limited to 'usecaseui-portal') diff --git a/usecaseui-portal/src/app/alarm/alarm.component.ts b/usecaseui-portal/src/app/alarm/alarm.component.ts index 9fe870bb..9b454b02 100644 --- a/usecaseui-portal/src/app/alarm/alarm.component.ts +++ b/usecaseui-portal/src/app/alarm/alarm.component.ts @@ -45,7 +45,7 @@ export class AlarmComponent implements OnInit { ngOnInit() { this.getAlarmFormData(); this.getSourceNames(); - // this.getstatuscount(); + this.getstatuscount(); } // Filter box @@ -98,9 +98,7 @@ export class AlarmComponent implements OnInit { this.startTime = this.datePipe.transform(result[0], 'yyyy-MM-dd HH:mm:ss'); this.endTime = this.datePipe.transform(result[1], 'yyyy-MM-dd HH:mm:ss'); } - sort(e){ - } // total alarmList = { all: 0, @@ -275,7 +273,9 @@ export class AlarmComponent implements OnInit { ] } }; + sort(e){ + } //Detail page title display detailshow = false; // Show hidden animation diff --git a/usecaseui-portal/src/app/components/graphiclist/graphiclist.component.html b/usecaseui-portal/src/app/components/graphiclist/graphiclist.component.html index 3789c598..c5c3a3ed 100644 --- a/usecaseui-portal/src/app/components/graphiclist/graphiclist.component.html +++ b/usecaseui-portal/src/app/components/graphiclist/graphiclist.component.html @@ -34,8 +34,8 @@ Source Name Event Name ReportingEntityName - - Action + Report Time + Action @@ -45,7 +45,7 @@ {{item.sourceName}} {{item.eventName}} {{item.reportingEntityName}} - + {{item.startEpochMicrosec | date:'yyyy-MM-dd HH:mm:ss'}} diff --git a/usecaseui-portal/src/app/components/graphiclist/graphiclist.component.ts b/usecaseui-portal/src/app/components/graphiclist/graphiclist.component.ts index c3153c8e..01e716db 100644 --- a/usecaseui-portal/src/app/components/graphiclist/graphiclist.component.ts +++ b/usecaseui-portal/src/app/components/graphiclist/graphiclist.component.ts @@ -25,7 +25,7 @@ import { DatePipe } from "@angular/common" providers: [DatePipe] }) export class GraphiclistComponent implements OnInit { - public startTime: string = ''; + public startTime: string =''; public endTime: string = ''; public currentPage: number = 1; public pageSize: number = 10; @@ -46,28 +46,23 @@ export class GraphiclistComponent implements OnInit { } ngOnInit() { - this.getPerformanceFormData(); } - ngOnchanges(changes){ + ngOnChanges(changes){ this.getPerformanceFormData(); - console.log(this.vnfname) - } getPerformanceFormData() { - this.myhttp.getAlarmFormData(this.currentPage, this.pageSize, this.vnfname, this.startTime, this.endTime).subscribe((data) => { - console.log(data) - this.list = data.alarms; + this.myhttp.getPerformanceFormData(this.currentPage, this.pageSize, this.vnfname, this.startTime, this.endTime).subscribe((data) => { + this.list = data.performances; }) } // Date screening dateRange = [ addDays(new Date(), -30), new Date() ]; onChange(result: Date): void { - this.startTime = this.datePipe.transform(result[0], 'yyyy-MM-dd-HH:mm:ss'); - this.endTime = this.datePipe.transform(result[1], 'yyyy-MM-dd-HH:mm:ss'); + this.startTime = this.datePipe.transform(result[0], 'yyyy-MM-dd HH:mm:ss'); + this.endTime = this.datePipe.transform(result[1], 'yyyy-MM-dd HH:mm:ss'); } sort(e){ - } @Input () vnfname; @Output() detailData = new EventEmitter(); diff --git a/usecaseui-portal/src/app/components/performance-details/performance-details.component.ts b/usecaseui-portal/src/app/components/performance-details/performance-details.component.ts index 2e174474..83467172 100644 --- a/usecaseui-portal/src/app/components/performance-details/performance-details.component.ts +++ b/usecaseui-portal/src/app/components/performance-details/performance-details.component.ts @@ -14,20 +14,23 @@ export class PerformanceDetailsComponent implements OnInit { constructor(private myhttp:MyhttpService) { } ngOnInit() { - this.getAlarmDetailData(this.detailId); + } ngOnChanges(changes){ - // console.log(changes); + console.log(this.detailId) + this.getPerformanceHeaderDetail(this.detailId); } datailheaderdata: any = {}; dataillistdata: any = []; - getAlarmDetailData(id){ - this.myhttp.getAlarmDetailData(id).subscribe((data)=>{ - console.log(data) - this.datailheaderdata = data.alarmsHeader; - this.dataillistdata = data.list; - }) + getPerformanceHeaderDetail(id){ + if(id){ + this.myhttp.getPerformanceHeaderDetail(id).subscribe((data)=>{ + console.log(data) + this.datailheaderdata = data.performanceHeader; + this.dataillistdata = data.list; + }) + } } moredetailShow = false; @Input() detailId; diff --git a/usecaseui-portal/src/app/myhttp.service.ts b/usecaseui-portal/src/app/myhttp.service.ts index 0f5f2241..0496eed9 100644 --- a/usecaseui-portal/src/app/myhttp.service.ts +++ b/usecaseui-portal/src/app/myhttp.service.ts @@ -73,7 +73,7 @@ export class MyhttpService { customers: this.baseUrl + "/uui-lcm/customers", serviceType: this.baseUrl + "/uui-lcm/customers/" + "*_*" + "/service-subscriptions", - servicesTableData: this.baseUrl + '/uui-sotn/getServiceInstanceList', + servicesTableData: this.baseUrl + '/uui-lcm/service-instances', serviceTemplates: this.baseUrl + "/uui-lcm/service-templates", templateParameters: this.baseUrl + "/uui-lcm/service-templates/" + "*_*" + "?toscaModelPath=", nstemplateParameters: this.baseUrl + "/uui-lcm/fetchNsTemplateData", @@ -282,9 +282,9 @@ export class MyhttpService { } -// alarm data + // alarm data getAlarmFormData(currentPage: number, pageSize: number, sourceName?: string, priority?: string, startTime?: string, endTime?: string, vfStatus?: string) { - return this.http.get('/api/usecaseui-server/v1/alarm/' + '/' + currentPage + '/' + pageSize + '/' + sourceName + '/' + priority + '/' + startTime + '/' + endTime + '/' + vfStatus); + return this.http.get('/api/usecaseui-server/v1/alarm/' + '/' + currentPage + '/' + pageSize + '?sourceName=' + sourceName + '&priority=' + priority + '&startTime=' + startTime + '&endTime=' + endTime + '&vfStatus=' + vfStatus); } getSourceNames() { @@ -300,16 +300,20 @@ export class MyhttpService { return this.http.get(httpurl); } - // performancevnf data + // performance data getqueryAllSourceNames() { let httpurl = this.baseUrl + "/api/usecaseui-server/v1/performance/queryAllSourceNames"; return this.http.get(httpurl); } - getperformanceSsourceNames(currentPage: number, pageSize: number, sourceName: string) { - let httpurl = this.baseUrl + "/api/usecaseui-server/v1/performanceSsourceNames" + "/" + currentPage + "/" + pageSize + "/" + sourceName; + getperformanceSourceNames(currentPage: number, pageSize: number, sourceName: string) { + let httpurl = this.baseUrl + "/api/usecaseui-server/v1/performanceSsourceNames" + "/" + currentPage + "/" + pageSize + "?sourceName=" + sourceName; return this.http.get(httpurl); } getPerformanceFormData(currentPage: number, pageSize: number, sourceName?: string, startTime?: string, endTime?: string) { - return this.http.get('/api/usecaseui-server/v1/performance' + '/' + currentPage + '/' + pageSize + '/' + sourceName + '/' + startTime + '/' + endTime); + return this.http.get('/api/usecaseui-server/v1/performance' + '/' + currentPage + '/' + pageSize + '?sourceName=' + sourceName + '&startTime=' + startTime + '&endTime=' + endTime); + } + getPerformanceHeaderDetail(id) { + let httpurl = '/api/usecaseui-server/v1/performance/getPerformanceHeaderDetail/' + id; + return this.http.get(httpurl); } } diff --git a/usecaseui-portal/src/app/performance/performance-vnf/performance-vnf.component.html b/usecaseui-portal/src/app/performance/performance-vnf/performance-vnf.component.html index d308d808..2899b6a6 100644 --- a/usecaseui-portal/src/app/performance/performance-vnf/performance-vnf.component.html +++ b/usecaseui-portal/src/app/performance/performance-vnf/performance-vnf.component.html @@ -33,17 +33,17 @@
-
+
-

{{item.name}}

+

{{item}}

- {{item.text}} + {{item}}
- +
diff --git a/usecaseui-portal/src/app/performance/performance-vnf/performance-vnf.component.ts b/usecaseui-portal/src/app/performance/performance-vnf/performance-vnf.component.ts index 3e08c2d4..934cfd16 100644 --- a/usecaseui-portal/src/app/performance/performance-vnf/performance-vnf.component.ts +++ b/usecaseui-portal/src/app/performance/performance-vnf/performance-vnf.component.ts @@ -26,24 +26,26 @@ import { MyhttpService } from '../../myhttp.service'; export class PerformanceVnfComponent implements OnInit { @HostBinding('@routerAnimate') routerAnimateState; public sourceNameList: Array = ['---auto---']; - public namecurrentPage: number = 1; - public namepageSize: number = 10; public sourceName: string = ''; public vnfsdataTotal: number; + public startTime: string = ''; + public endTime: string = ''; + public currentPage: number = 1; + public pageSize: number = 10; + list: any; constructor( private myhttp: MyhttpService) { } ngOnInit() { this.getqueryAllSourceNames(); - this.getperformanceSsourceNames() + this.getperformanceSsourceNames(); } sourceNameSelected = this.sourceNameList[0]; getqueryAllSourceNames() { this.myhttp.getqueryAllSourceNames().subscribe((data) => { - // console.log(data) for (let i = 0; i < data.length; i++) { this.sourceNameList.push(data[i]); } @@ -51,7 +53,6 @@ export class PerformanceVnfComponent implements OnInit { }) } choseSourceName(item) { - console.log(item); this.sourceNameSelected = item; if (item == "---auto---") { this.sourceName = ''; @@ -59,23 +60,22 @@ export class PerformanceVnfComponent implements OnInit { this.sourceName = item; } } + // vnfs data + totalRecords = []; + //Fill the box + emptys = []; getperformanceSsourceNames() { - this.myhttp.getperformanceSsourceNames(this.namecurrentPage, this.namepageSize, this.sourceName).subscribe((data) => { - this.vnfsData = data.vnfdata; - this.vnfsdataTotal = data.total; - if (Number.isInteger(this.vnfsData.length / 5)) { + this.myhttp.getperformanceSourceNames(this.currentPage, this.pageSize, this.sourceName).subscribe((data) => { + this.totalRecords = data.totalRecords; + this.vnfsdataTotal = data.names; + if (Number.isInteger(this.totalRecords.length / 5)) { this.emptys = new Array(0); } else { - this.emptys = new Array(5 - this.vnfsData.length % 5); + this.emptys = new Array(5 - this.totalRecords.length % 5); } - // console.log(this.emptys); }) } - // vnfs data - vnfsData = []; - emptys = []; //Fill the box - //Detail page title display graphicshow = false; detailshow = false; @@ -91,32 +91,31 @@ export class PerformanceVnfComponent implements OnInit { this.detailshow = false; } // Selected name - - graphicShow(item) { + + graphicShow() { this.state = 'hide'; this.state2 = 'show'; this.state3 = 'hide'; this.graphicshow = true; this.detailshow = false; } - vnfname: number; - graphicShow2(item){ + vnfname: string; + graphicShow2(item) { this.state = 'hide'; this.state2 = 'show'; this.state3 = 'hide'; this.graphicshow = true; this.detailshow = false; - this.vnfname = item.name; + this.vnfname = item; } // Selected id - detailId: number; + detailId: string; detailShow(item) { this.state = 'hide'; this.state2 = 'hide'; this.state3 = 'show'; this.graphicshow = true; this.detailshow = true; - this.detailId = item.id; + this.detailId = item.id.id; } - } -- cgit 1.2.3-korg