Commit d9eadc90 authored by wangqinghua's avatar wangqinghua

兼容性测试

parent bd08a093
......@@ -4,7 +4,7 @@ import {BehaviorSubject, Subscription} from 'rxjs';
@Injectable()
export class AppService {
private themeSource:BehaviorSubject<string> = new BehaviorSubject('dark');
private themeSource:BehaviorSubject<string> = new BehaviorSubject('white');
public theme = this.themeSource.asObservable();
public setTheme(value: string){
......
......@@ -17,104 +17,262 @@ import {Router} from '@angular/router';
]
})
export class HomeComponent implements OnInit {
@ViewChild('smartTopologyView') smartTopologyView: TopologyViewComponent;
export class HomeComponent implements OnInit,AfterViewInit {
@ViewChild('smartSelectGroup') smartSelectGroup:SelectGroupComponent;
@ViewChild("leftDiv") leftDiv:ElementRef;
@ViewChild("rightDiv") rightDiv:ElementRef;
color = color;
obj = {
leftGroupId: '',
};
noData = false;
groupList; //分组数组
timeList = [
{'label': '最近一小时', value: '1'},
{'label': '最近一天', value: '2'},
{'label': '最近三天', value: '3'},
{'label': '最近一周', value: '4'},
];
timeTypeTrend = "0";
leftOneChart;
leftTwoChart;
rightOneChart;
rightTwoChart;
charTrendOption; //告警综述趋势
warnList= [];
totalNum;
groupList;
pageNum = 1;
pageCount = 10;
loading = false;
obj = {
leftGroupId:null,
alarmGroupId:null
};
leftOneData = {
high: 0,
warning: 0,
normal: 0,
disabled: 0,
high:0,
warning:0,
normal:0,
disabled:0,
};
leftOneDataPre = {
highPer: 0,
warningPer: 0,
normalPer: 0,
disabledPer: 0,
highPer:0,
warningPer:0,
normalPer:0,
disabledPer:0,
};
leftOneTotal = 0;
leftTwoData = {
high: 0,
warning: 0,
normal: 0,
disabled: 0,
leftTwoData ={
high:0,
warning:0,
normal:0,
disabled:0,
};
leftTwoDataPre = {
highPer: 0,
warningPer: 0,
normalPer: 0,
disabledPer: 0,
highPer:0,
warningPer:0,
normalPer:0,
disabledPer:0,
};
leftTwoTotal = 0;
rightTotal = 0;
flowListNum; //接口流量排行 数值
flowListPre; //发送利用率排名 百分比
countOrderList; //cpu内存使用率排名列表
isTrendLoading = false;
trendObj = {
startTime: '',
endTime: ''
};
//我的关注
followList;
dataSet; //拓扑图
topoId;
//资源设备数量
deviceNo;
constructor(
private overAllSer: OverAllService, private message: NzMessageService,
private alarmSer: AlarmService, private renderer: Renderer2,
private layoutSer: LayoutService,private datePipe:DatePipe,
private principal: Principal, private topologySer: TopologyService,
private eventManager: JhiEventManager, private analysisSer: AnalysisService,
private router: Router, private commonSer: CommonService,
private overAllSer:OverAllService,private message:NzMessageService,
private alarmSer:AlarmService,private renderer:Renderer2,
private layoutSer:LayoutService,
private principal: Principal,
private eventManager: JhiEventManager,
private router:Router
) {
}
ngOnInit() {
this.getAlarmList();
this.findGroupCount();
this.findHostCount();
this.getGroup();
this.flowRankNum();
this.flowRankPre();
this.countOrde();
this.getMyFollow();
this.findSize();
}
this.getList();
ngAfterViewInit(){
let rightHeight = this.rightDiv.nativeElement.clientHeight;
this.renderer.setStyle(this.leftDiv.nativeElement,"height",rightHeight +"px");
}
//查看详情
goToDetail(item) {
this.router.navigate(['app/main/basic-detail'], {
queryParams: {
hostId: item.hostid,
name: item.hostname,
hostName: item.hostname
}
});
}
//我的关注
getMyFollow(){
this.layoutSer.myFollow().subscribe(
(res)=>{
this.followList = res.data;
if(this.followList.length > 0 ){
let dataStyle = {
normal: {
label: {
show: false
},
labelLine: {
show: false
},
shadowBlur: 40,
borderWidth: 10,
shadowColor: 'rgba(0, 0, 0, 0)' //边框阴影
}
};
let placeHolderStyle = {
normal: {
color: '#eee',
label: {
show: false
},
labelLine: {
show: false
}
},
emphasis: {
color: '#393d50'
}
};
this.followList.forEach(e=>{
e.option = {
backgroundColor: '#fff',
title: {
text: '',
x: 'center',
y: 'center',
textStyle: {
fontWeight: 'normal',
fontSize: 24,
color: "red",
}
},
tooltip: {
trigger: 'item',
show: true,
formatter: "{b} : <br/>{d}%",
backgroundColor: 'rgba(0,0,0,0.7)', // 背景
padding: [8, 10], //内边距
extraCssText: 'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);', //添加阴影
},
series: [{
name: 'CPU使用率',
type: 'pie',
clockWise: false,
radius: [50, 58],
center:['30%','50%'],
itemStyle: dataStyle,
hoverAnimation: false,
startAngle: 90,
label:{
borderRadius:'10',
},
data: [{
value: e.cpu,
name: 'CPU使用率',
itemStyle: {
normal: {
color: "#f09363"
}
}
},
{
value: 100 - e.cpu,
name: '',
tooltip: {
show: false
},
itemStyle: placeHolderStyle
},
]
},
{
name: '内存使用率',
type: 'pie',
clockWise: false,
radius: [35, 43],
center:['30%','50%'],
itemStyle: dataStyle,
hoverAnimation: false,
startAngle: 90,
data: [{
value: e.memory,
name: '内存使用率',
itemStyle: {
normal: {
color: "#80ba78"
}
}
},
{
value: 100 - e.memory,
name: '',
tooltip: {
show: false
},
itemStyle: placeHolderStyle
},
]
},
// {
// name: '带宽使用率',
// type: 'pie',
// clockWise: false,
// radius: [20, 28],
// center:['30%','50%'],
// itemStyle: dataStyle,
// hoverAnimation: false,
// startAngle: 90,
// data: [{
// value: e.lose,
// name: '带宽使用率',
// itemStyle: {
// normal: {
// color: "#73b6e4"
// }
// }
// },
// {
// value: 100 - e.lose,
// name: '',
// tooltip: {
// show: false
// },
// itemStyle: placeHolderStyle
// },
// ]
// }
]
};
})
}
}
)
}
//获取分组
getGroup() {
this.overAllSer.findGroup().subscribe(
(res) => {
if (res.errCode == 10000 && res.data) {
if(res.data){
this.groupList = res.data;
this.obj.leftGroupId = this.groupList[0].groupid;
this.countGroupItem();
......
......@@ -311,6 +311,9 @@ export class BasicEditComponent implements OnInit {
if (this.macroTYpe == 'macroExpand') {
this.validateForm.macros = this.macroList2;
}
this.validateForm.interfaces.forEach(e=>{
e.hostid = this.hostId
});
this.validateForm.hostid = this.hostId;
this.validateForm.macros = this.macroList1;
this.overAllSer.updateHost(this.validateForm).subscribe(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment