Fix VNF Performance Query Bugs 80/72180/1
authorzhangab <zhanganbing@chinamobile.com>
Thu, 8 Nov 2018 09:34:00 +0000 (17:34 +0800)
committerzhangab <zhanganbing@chinamobile.com>
Thu, 8 Nov 2018 09:34:13 +0000 (17:34 +0800)
Change-Id: Ibc9c8cbd5425bff5b0158bb7ee2a3a8f25a05e89
Issue-ID: USECASEUI-166
Signed-off-by: zhangab <zhanganbing@chinamobile.com>
usecaseui-portal/src/app/alarm/alarm.component.ts
usecaseui-portal/src/app/components/graphiclist/graphiclist.component.html
usecaseui-portal/src/app/components/graphiclist/graphiclist.component.ts
usecaseui-portal/src/app/components/performance-details/performance-details.component.ts
usecaseui-portal/src/app/myhttp.service.ts
usecaseui-portal/src/app/performance/performance-vnf/performance-vnf.component.html
usecaseui-portal/src/app/performance/performance-vnf/performance-vnf.component.ts

index 9fe870b..9b454b0 100644 (file)
@@ -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
index 3789c59..c5c3a3e 100644 (file)
@@ -34,8 +34,8 @@
                     <th nzWidth="20%">Source Name</th>
                     <th nzWidth="20%">Event Name</th>
                     <th nzWidth="20%">ReportingEntityName</th>
-                    <!-- <th nzWidth="20%">Report Time</th> -->
-                    <th nzWidth="10%">Action</th>
+                    <th nzWidth="15%">Report Time</th>
+                    <th nzWidth="5%">Action</th>
                 </tr>
             </thead>
             <tbody>
@@ -45,7 +45,7 @@
                     <td>{{item.sourceName}}</td>
                     <td>{{item.eventName}}</td>
                     <td>{{item.reportingEntityName}}</td>
-                    <!-- <td>{{item.sequence}}</td> -->
+                    <td>{{item.startEpochMicrosec | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                     <td><a class="action" (click)="detailShow(item)"><i class="details"></i></a></td>
                 </tr>
                 <!-- </ng-template> -->
index c3153c8..01e716d 100644 (file)
@@ -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();
index 2e17447..8346717 100644 (file)
@@ -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;
index 0f5f224..0496eed 100644 (file)
@@ -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<any>('/api/usecaseui-server/v1/alarm/' + '/' + currentPage + '/' + pageSize + '/' + sourceName + '/' + priority + '/' + startTime + '/' + endTime + '/' + vfStatus);
+    return this.http.get<any>('/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<any>(httpurl);
   }
 
-  // performancevnf data
+  // performance data
   getqueryAllSourceNames() {
     let httpurl = this.baseUrl + "/api/usecaseui-server/v1/performance/queryAllSourceNames";
     return this.http.get<any>(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<any>(httpurl);
   }
   getPerformanceFormData(currentPage: number, pageSize: number, sourceName?: string, startTime?: string, endTime?: string) {
-    return this.http.get<any>('/api/usecaseui-server/v1/performance' + '/' + currentPage + '/' + pageSize + '/' + sourceName + '/' + startTime + '/' + endTime);
+    return this.http.get<any>('/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<any>(httpurl);
   }
 }
index d308d80..2899b6a 100644 (file)
 </div>
 <div class="content" [@showHideAnimate]="state">
     <div class="vnfs">
-        <div class="vnf" *ngFor="let item of vnfsData">
+        <div class="vnf" *ngFor="let item of totalRecords">
             <img src="../../../assets/images/VNF3.png" title="VF" (click)="graphicShow2(item)">
-            <h3>{{item.name}}</h3>
+            <h3>{{item}}</h3>
             <div class="intro"> 
-               {{item.text}}
+               {{item}}
             </div>
         </div>
         <div class="empty" *ngFor="let empty of emptys"></div>   
     </div>
     <div class="pages">
-        <nz-pagination [(nzPageIndex)]="namecurrentPage"  [nzTotal]="vnfsdataTotal"  [nzSize]="'small'" [(nzPageSize)]="namepageSize" [nzPageSizeOptions]="[10,15,20,25,30]" nzShowSizeChanger nzShowQuickJumper></nz-pagination>
+        <nz-pagination [(nzPageIndex)]="currentPage"  [nzTotal]="vnfsdataTotal"  [nzSize]="'small'" [(nzPageSize)]="pageSize" [nzPageSizeOptions]="[10,15,20,25,30]" nzShowSizeChanger nzShowQuickJumper></nz-pagination>
     </div>
 </div>
 <div [@showHideAnimate]="state2">
index 3e08c2d..934cfd1 100644 (file)
@@ -26,24 +26,26 @@ import { MyhttpService } from '../../myhttp.service';
 export class PerformanceVnfComponent implements OnInit {
   @HostBinding('@routerAnimate') routerAnimateState;
   public sourceNameList: Array<any> = ['---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;
   }
-
 }