summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/home/home.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal/src/app/home/home.component.ts')
-rw-r--r--usecaseui-portal/src/app/home/home.component.ts107
1 files changed, 88 insertions, 19 deletions
diff --git a/usecaseui-portal/src/app/home/home.component.ts b/usecaseui-portal/src/app/home/home.component.ts
index bd4c5176..9bd02941 100644
--- a/usecaseui-portal/src/app/home/home.component.ts
+++ b/usecaseui-portal/src/app/home/home.component.ts
@@ -16,6 +16,7 @@
import { Component, OnInit, Input, Output, EventEmitter, HostBinding } from '@angular/core';
import { HomesService } from '../homes.service';
import { slideToRight } from '../animates';
+import {TranslateService} from "@ngx-translate/core";
@Component({
selector: 'app-home',
@@ -32,7 +33,7 @@ export class HomeComponent implements OnInit {
this.getListSortMasters();
this.getSourceNames();
this.getHomeServiceData();
- this.getHomePerformanceData();
+ // this.getHomePerformanceData();
this.getHomeAlarmData();
this.getHomeAlarmChartData();
this.getHomeServiceBarData();
@@ -109,15 +110,64 @@ export class HomeComponent implements OnInit {
)
}
- // performance
- performanceVnfNum = 0;
- performanceVmNum = 0;
- getHomePerformanceData(){
- this.myhttp.getHomePerformanceData()
- .subscribe((data)=>{
- this.performanceVnfNum = data.length;
- })
- }
+ // performance
+ // performanceVnfNum = 0;
+ // performanceVmNum = 0;
+ // getHomePerformanceData() {
+ // this.myhttp.getHomePerformanceData()
+ // .subscribe((data) => {
+ // this.performanceVnfNum = data.length;
+ // })
+ // }
+
+ // VM alarm
+ VMAlarmChartData: Object;
+ VMAlarmChartInit: Object = {
+ height: 180,
+ option: {
+ color: [
+ {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 0,
+ y2: 1,
+ colorStops: [{
+ offset: 0, color: '#FB93C2'
+ }, {
+ offset: 1, color: '#FB7788'
+ }],
+ globalCoord: false //
+ }, {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 0,
+ y2: 1,
+ colorStops: [{
+ offset: 0, color: '#A6BFE4'
+ }, {
+ offset: 1, color: '#7A8BAE'
+ }],
+ globalCoord: false
+ }],
+ series: [{
+ name: "",
+ radius: ['50%', '70%'],
+ center: ['50%', '45%'],
+ label: {
+ normal: {
+ show: false,
+ },
+ emphasis: {
+ show: true,
+ formatter: '{b}\n{c},{d}%',
+ color: "#3C4F8C"
+ }
+ }
+ }]
+ }
+ };
// alarm bar
alarmChartData:Object;
@@ -186,10 +236,15 @@ export class HomeComponent implements OnInit {
data: [{ name: "Active", value: data[0] }, { name: "Fixed", value: data[1] }]
}]
};
- })
- }
+ this.VMAlarmChartData = {
+ series: [{
+ data: [{name: "Active", value: data[0]}, {name: "Fixed", value: data[1]}]
+ }]
+ };
+ })
+ }
- // alarm lin
+ // alarm line
alarmLineChartData:Object;
alarmLineChartInit:Object = {
height:320,
@@ -199,9 +254,7 @@ export class HomeComponent implements OnInit {
data: ['CPU', 'Memory', 'Disk']
},
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"]
+ data:[]
},
series : [
{
@@ -210,7 +263,7 @@ export class HomeComponent implements OnInit {
itemStyle: {
color: "#70ACEC"
},
- data: [30, 45, 34, 35, 43, 56, 36, 53, 42, 45, 44, 35, 32]
+ data: []
},
{
name: 'Memory',
@@ -218,7 +271,7 @@ export class HomeComponent implements OnInit {
itemStyle: {
color: "#3BCD79"
},
- data: [10, 23, 24, 22, 14, 15, 32, 12, 12, 32, 14, 23, 23]
+ data: []
},
{
name: 'Disk',
@@ -226,7 +279,7 @@ export class HomeComponent implements OnInit {
itemStyle: {
color: "#FDC288"
},
- data: [20, 23, 14, 12, 34, 25, 22, 42, 52, 35, 34, 13, 13]
+ data: []
}
]
}
@@ -235,7 +288,15 @@ export class HomeComponent implements OnInit {
// services
servicesBarChartData: Object;
serviceBarChartInit: Object = {
+ height: 40,
+ width: 160,
option: {
+ tooltip:{
+
+ },
+ grid: {
+
+ },
xAxis: {
// data: [],
type: 'value',
@@ -246,6 +307,13 @@ export class HomeComponent implements OnInit {
show: false
},
},
+ yAxis: {
+ type: 'category',
+ show: false,
+ axisTick: {
+ show: false
+ }
+ },
series: [{
type: 'bar',
name: 'a',
@@ -314,6 +382,7 @@ export class HomeComponent implements OnInit {
{ data: [Val1 - Val2] },
]
}
+ console.log(this.servicesBarChartData)
}, (err) => {
console.log(err);
})