Commit c1158be1 authored by wangqinghua's avatar wangqinghua

bug update

parent 92dee72e
......@@ -2,7 +2,8 @@ export const VERSION = process.env.VERSION;
export const DEBUG_INFO_ENABLED: boolean = !!process.env.DEBUG_INFO_ENABLED;
export const SERVER_API_URL_COMS = '/coms';
// export const SERVER_API_URL = '/anke';
export const SERVER_API_URL = '/zabbixBox';
export const SERVER_API_URL = '/zhouxi';
// export const SERVER_API_URL = '/zabbixBox';
export const SERVER_API_URL_MONITOR = '/api';
export const BUILD_TIMESTAMP = process.env.BUILD_TIMESTAMP;
export const pageSize = 10;
......
......@@ -121,62 +121,3 @@
</tr>
</tbody>
</nz-table>
<div nz-row class="padding-15-0">
<div nz-col nzSpan="12">
<h2>关注资源</h2>
</div>
<div nz-col nzSpan="12" class="text-right">
<button nz-button nzType="default" (click)="showAddFollow()"><i class="anticon anticon-plus-circle-o"></i>添加资源
</button>
</div>
</div>
<div nz-row>
<ng-container *ngFor="let item of followList;let i = index;">
<div nz-col nzSpan="12" class="follow">
<span (click)="cancel(i,item)" class="cursor calcle-follow"><i
class="anticon anticon-close-circle"></i></span>
<div class="follow-container">
<div class="follow-title">
<div>
<p>{{item.name}} <span>类型:{{item.extendName}}</span> <span style="margin-left: 10px">IP:{{item.host}}</span>
</p>
<p>所在分组:<span style="margin-right: 5px;" *ngFor="let groups of item.groupName">{{groups}}</span></p>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="12" class="height-150 releative">
<div class="container-top">
<p>监测点</p>
<p class="round-tag tag-form">
<nz-tag class="tag-red" [nzColor]="color.red"></nz-tag>
<span style="margin-right: 10px">{{item.item.high}}</span>
<nz-tag class="tag-yellow" [nzColor]="color.yellow"></nz-tag>
<span style="margin-right: 10px"> {{item.item.warning}}</span>
</p>
</div>
<div class="container-bottom">
<p>PING值:{{item.lose}}</p>
</div>
</div>
<div nz-col nzSpan="12" class="height-150" echarts [options]="item.option"></div>
<div class="chart-font">
<p>
<nz-tag nzColor="#f09363"></nz-tag>
CPU使用率 {{item.cpu}}%
</p>
<p>
<nz-tag nzColor="#80ba78"></nz-tag>
内存使用率 {{(item.memory).toFixed(2)}}%
</p>
<!--<p>-->
<!--<nz-tag nzColor="#73b6e4"></nz-tag>-->
<!--带宽使用率 {{item.lose}}%-->
<!--</p>-->
</div>
</div>
</div>
</div>
</ng-container>
</div>
<smart-select-group #smartSelectGroup (done)="getItem($event)"></smart-select-group>
......@@ -18,7 +18,6 @@ import {Router} from '@angular/router';
})
export class HomeComponent implements OnInit,AfterViewInit {
@ViewChild('smartSelectGroup') smartSelectGroup:SelectGroupComponent;
@ViewChild("leftDiv") leftDiv:ElementRef;
@ViewChild("rightDiv") rightDiv:ElementRef;
......@@ -73,9 +72,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
rightTotal = 0;
//我的关注
followList;
//资源设备数量
deviceNo;
......@@ -97,8 +93,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
this.getGroup();
this.getMyFollow();
this.findSize();
}
......@@ -118,156 +112,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
});
}
//我的关注
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(
......@@ -558,8 +402,7 @@ export class HomeComponent implements OnInit,AfterViewInit {
);
}
//获取告警分组
getAlarmList(){
getAlarmList() {
this.loading = true;
const data = {
pageNum: this.pageNum,
......@@ -571,8 +414,8 @@ export class HomeComponent implements OnInit,AfterViewInit {
};
this.alarmSer.eventFind(data).subscribe(
(res) => {
if(res.errCode == 10000){
if(res.data){
if (res.errCode == 10000) {
if (res.data) {
this.warnList = res.data.data;
this.totalNum = res.data.totalNum;
}
......@@ -582,47 +425,10 @@ export class HomeComponent implements OnInit,AfterViewInit {
);
}
showAddFollow(){
this.smartSelectGroup.showAddModal("选择资源")
}
change(e){
if(e > 0){
this.pageNum = e;
this.getAlarmList();
}
}
//设置关注
getItem(e){
const data = {
resourceIds:e.map(res=>{
return res+"";
})
};
this.layoutSer.addFollow(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.message.success("添加关注成功");
this.getMyFollow();
}
}
)
}
//取消关注
cancel(index,item){
this.followList.splice(index,1);
const data = {
resourceIds:[item.hostId+""]
};
this.layoutSer.unFollow(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.getMyFollow();
this.message.success('取消关注成功');
}
}
)
}
}
......@@ -130,7 +130,7 @@ export class BasicEditComponent implements OnInit {
this.modalTitle = '编辑资源';
this.overAllSer.findDetailed(this.hostId).subscribe(
(res) => {
const data = res.data[0];
const data = res.data;
this.validateForm.name = data.name;
this.validateForm.host = data.host;
......@@ -146,6 +146,13 @@ export class BasicEditComponent implements OnInit {
}
}
}
for (let i = 0; i < this.groupList.length; i++) {
for (let j = 0; j < this.validateForm.groups.length; j++) {
if (this.validateForm.groups[j].groupid == this.groupList[i].value) {
this.groupList[i].checked = true;
}
}
}
}
//模版对象
......@@ -162,7 +169,6 @@ export class BasicEditComponent implements OnInit {
if (data.interfaces) {
this.interfaceslist = data.interfaces;
this.interfaceslist.forEach(res => {
res.main = res.main + '';
res.type = res.type + '';
});
}
......@@ -187,7 +193,6 @@ export class BasicEditComponent implements OnInit {
if (data.inventory) {
this.validateForm.inventoryExtend = data.inventory;
this.inventoryParentId = data.inventory.typeparentid;
this.getTypeByParent(this.inventoryParentId);
this.isInVentory = true;
this.isYesInVentory = 'default';
this.isNOInVentory = 'primary';
......
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