Commit df387ba8 authored by wangqinghua's avatar wangqinghua

update

parent 4da4012d
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
<nz-select style="width: 100%;" nzShowSearch nzAllowClear nzPlaceHolder="选择设备类型" [(ngModel)]="obj.equipmentType" > <nz-select style="width: 100%;" nzShowSearch nzAllowClear nzPlaceHolder="选择设备类型" [(ngModel)]="obj.equipmentType" >
<ng-container *ngFor="let item of warnCountList;"> <ng-container *ngFor="let item of warnCountList;">
<nz-option nzLabel="{{item.equipmentType}}" nzValue="{{item.equipmentTypeId}}"></nz-option> <nz-option [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
</ng-container> </ng-container>
</nz-select> </nz-select>
</div> </div>
......
...@@ -72,7 +72,7 @@ export class AlarmListComponent implements OnInit { ...@@ -72,7 +72,7 @@ export class AlarmListComponent implements OnInit {
this.overAllSer.findGroup().subscribe( this.overAllSer.findGroup().subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.groupList = res.data; this.groupList = res.data.data;
} }
} }
); );
......
import { HttpClient } from "@angular/common/http"; import {HttpClient} from '@angular/common/http';
import {Observable} from "rxjs/Rx"; import {Observable} from 'rxjs/Rx';
import { Injectable } from '@angular/core'; import {Injectable} from '@angular/core';
import {SERVER_API_URL} from "../app.constants"; import {SERVER_API_URL} from '../app.constants';
@Injectable() @Injectable()
export class AlarmService { export class AlarmService {
...@@ -10,127 +10,127 @@ export class AlarmService { ...@@ -10,127 +10,127 @@ export class AlarmService {
} }
//告警list //告警list
eventFind(data): Observable<any>{ eventFind(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/event/find',data); return this.http.post(SERVER_API_URL + '/alertLog/page', data);
} }
//告警推送日志 //告警推送日志
alertFind(data): Observable<any>{ alertFind(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/alert/find',data); return this.http.post(SERVER_API_URL + '/alert/find', data);
} }
//删除告警推送日志 //删除告警推送日志
alertDelete(data): Observable<any>{ alertDelete(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/alert/delete',data); return this.http.post(SERVER_API_URL + '/alert/delete', data);
} }
//查询告警推送设置 //查询告警推送设置
actionFind(data): Observable<any>{ actionFind(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/action/find',data); return this.http.post(SERVER_API_URL + '/action/find', data);
} }
//查询单个告警推送设置 //查询单个告警推送设置
getAction(params): Observable<any>{ getAction(params): Observable<any> {
return this.http.get(SERVER_API_URL + '/action/find/'+params); return this.http.get(SERVER_API_URL + '/action/find/' + params);
} }
//查找所有zabbix用户 //查找所有zabbix用户
zUserFind(data): Observable<any>{ zUserFind(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/zuser/find',data); return this.http.post(SERVER_API_URL + '/zuser/find', data);
} }
//修改告警推送设置 //修改告警推送设置
actionUpdate(data): Observable<any>{ actionUpdate(data): Observable<any> {
return this.http.put(SERVER_API_URL + '/action/update',data); return this.http.put(SERVER_API_URL + '/action/update', data);
} }
//创建告警推送设置 //创建告警推送设置
actionCreate(data): Observable<any>{ actionCreate(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/action/create',data); return this.http.post(SERVER_API_URL + '/action/create', data);
} }
//单个启用或禁用告警推送设置 //单个启用或禁用告警推送设置
actionStatus(params1,params2): Observable<any>{ actionStatus(params1, params2): Observable<any> {
return this.http.post(SERVER_API_URL + '/action/status/' + params1 + '/' +params2,null); return this.http.post(SERVER_API_URL + '/action/status/' + params1 + '/' + params2, null);
} }
//批量启用或禁用告警设置 //批量启用或禁用告警设置
actionStatusBatch(data): Observable<any>{ actionStatusBatch(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/action/status-batch',data); return this.http.post(SERVER_API_URL + '/action/status-batch', data);
} }
//批量删除告警推送设置 //批量删除告警推送设置
actionDelete(data): Observable<any>{ actionDelete(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/action/delete',data); return this.http.post(SERVER_API_URL + '/action/delete', data);
} }
//查询所有告警组 //查询所有告警组
alertGroupFind(): Observable<any>{ alertGroupFind(): Observable<any> {
return this.http.get(SERVER_API_URL + '/alertGroup/findAll'); return this.http.get(SERVER_API_URL + '/alertGroup/findAll');
} }
//创建告警组 //创建告警组
alertGroupCreate(data): Observable<any>{ alertGroupCreate(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/alertGroup/create',data); return this.http.post(SERVER_API_URL + '/alertGroup/create', data);
} }
//修改告警组 //修改告警组
alertGroupUpdate(data): Observable<any>{ alertGroupUpdate(data): Observable<any> {
return this.http.put(SERVER_API_URL + '/alertGroup/update',data); return this.http.put(SERVER_API_URL + '/alertGroup/update', data);
} }
//删除告警组 //删除告警组
alertGroupDelete(data): Observable<any>{ alertGroupDelete(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/alertGroup/delete',data); return this.http.post(SERVER_API_URL + '/alertGroup/delete', data);
} }
//发送方式列表 //发送方式列表
mediaTypeFind(data): Observable<any>{ mediaTypeFind(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/mediaType/find',data); return this.http.post(SERVER_API_URL + '/mediaType/find', data);
} }
//添加发送方式 //添加发送方式
mediaTypeCreate(data): Observable<any>{ mediaTypeCreate(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/mediaType/create',data); return this.http.post(SERVER_API_URL + '/mediaType/create', data);
} }
//删除发送方式 //删除发送方式
mediaTypeDelete(data): Observable<any>{ mediaTypeDelete(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/mediaType/delete',data); return this.http.post(SERVER_API_URL + '/mediaType/delete', data);
} }
//修改发送方式 //修改发送方式
mediaTypeUpdate(data): Observable<any>{ mediaTypeUpdate(data): Observable<any> {
return this.http.put(SERVER_API_URL + '/mediaType/update',data); return this.http.put(SERVER_API_URL + '/mediaType/update', data);
} }
//单个启用或禁用发送方式 //单个启用或禁用发送方式
mediaTypeStatus(params1,params2): Observable<any>{ mediaTypeStatus(params1, params2): Observable<any> {
return this.http.post(SERVER_API_URL + '/mediaType/status/'+ params1 + '/' +params2,null); return this.http.post(SERVER_API_URL + '/mediaType/status/' + params1 + '/' + params2, null);
} }
//批量启用或禁用发送方式 //批量启用或禁用发送方式
mediaTypeStatusBatch(data): Observable<any>{ mediaTypeStatusBatch(data): Observable<any> {
return this.http.put(SERVER_API_URL + '/mediaType/status-batch',data); return this.http.put(SERVER_API_URL + '/mediaType/status-batch', data);
} }
//查询发送方式详情 //查询发送方式详情
getMediaType(params): Observable<any>{ getMediaType(params): Observable<any> {
return this.http.get(SERVER_API_URL + '/mediaType/find/' + params); return this.http.get(SERVER_API_URL + '/mediaType/find/' + params);
} }
//查找告警目标 //查找告警目标
findAlertTarget(): Observable<any>{ findAlertTarget(): Observable<any> {
return this.http.get(SERVER_API_URL + '/action/findAlertTarget'); return this.http.get(SERVER_API_URL + '/action/findAlertTarget');
} }
//导出当前告警列表 //导出当前告警列表
getExportUrlEvent(data): Observable<any>{ getExportUrlEvent(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/event/getExportUrl',data); return this.http.post(SERVER_API_URL + '/event/getExportUrl', data);
} }
//告警推送日志导出 //告警推送日志导出
getExportUrlAlert(data): Observable<any>{ getExportUrlAlert(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/alert/getExportUrl',data); return this.http.post(SERVER_API_URL + '/alert/getExportUrl', data);
} }
} }
...@@ -62,7 +62,7 @@ export class NowAlarmComponent implements OnInit, OnDestroy { ...@@ -62,7 +62,7 @@ export class NowAlarmComponent implements OnInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
this.getType(); // this.getType();
this.search(); this.search();
this.time_ = setInterval(() => { this.time_ = setInterval(() => {
this.search(); this.search();
......
...@@ -58,7 +58,6 @@ export class AlarmModalComponent implements OnInit { ...@@ -58,7 +58,6 @@ export class AlarmModalComponent implements OnInit {
this.getSendFun(); this.getSendFun();
this.getACtion(); this.getACtion();
this.getGroup(); this.getGroup();
this.getZabbixObj();
this.getEventType(); this.getEventType();
} }
...@@ -195,17 +194,6 @@ export class AlarmModalComponent implements OnInit { ...@@ -195,17 +194,6 @@ export class AlarmModalComponent implements OnInit {
); );
} }
//获取发送对象 zabbix
getZabbixObj() {
this.alarmSer.zUserFind({}).subscribe(
(res) => {
if (res.errCode == 10000) {
this.objList = res.data;
}
}
);
}
//添加发送方式 //添加发送方式
addOption() { addOption() {
const data = { const data = {
......
...@@ -5,7 +5,6 @@ import { ...@@ -5,7 +5,6 @@ import {
FormGroup, FormGroup,
Validators Validators
} from '@angular/forms'; } from '@angular/forms';
import {BasicKeyComponent} from '../basic-key/basic-key.component';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {NewTypeComponent} from '../new-type/new-type.component'; import {NewTypeComponent} from '../new-type/new-type.component';
...@@ -29,19 +28,16 @@ import {NewTypeComponent} from '../new-type/new-type.component'; ...@@ -29,19 +28,16 @@ import {NewTypeComponent} from '../new-type/new-type.component';
] ]
}) })
export class BasiCheckComponent implements OnInit { export class BasiCheckComponent implements OnInit {
@ViewChild('basicKey') basicKey: BasicKeyComponent;
@ViewChild('newType') newType: NewTypeComponent; @ViewChild('newType') newType: NewTypeComponent;
@Output() done = new EventEmitter<any>(); @Output() done = new EventEmitter<any>();
title; title;
isCheck = false; isCheck = false;
isOkLoading = false; isOkLoading = false;
isInterface = true; //添加模版监测点的时候不需要主机接口
nzSize = 'large'; nzSize = 'large';
hostId; //主机ID hostId; //主机ID
hostName; //主机name hostName; //主机name
itemId; //监控项id itemId; //监控项id
interfaceList: any[];
valueMapList = []; valueMapList = [];
validateForm: FormGroup; validateForm: FormGroup;
checkList; //监测点分类 checkList; //监测点分类
...@@ -61,7 +57,6 @@ export class BasiCheckComponent implements OnInit { ...@@ -61,7 +57,6 @@ export class BasiCheckComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.initForm(); this.initForm();
this.getValuemap();
} }
initForm() { initForm() {
...@@ -69,18 +64,16 @@ export class BasiCheckComponent implements OnInit { ...@@ -69,18 +64,16 @@ export class BasiCheckComponent implements OnInit {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
hostid: [this.hostId], hostid: [this.hostId],
name: [null, [Validators.required]], name: [null, [Validators.required]],
interfaceid: [null], key: [null, [Validators.required]],
key_: [null, [Validators.required]], valueType: [null, [Validators.required]],
value_type: [null, [Validators.required]],
type: [null, [Validators.required]], type: [null, [Validators.required]],
units: [null], units: [null, [Validators.required]],
history: ['3600'], history: ['3600'],
trends: [null], snmpCommunity: ['public'],
delay: [null, [Validators.required]], delay: [null, [Validators.required]],
snmp_oid: ['interfaces.ifTable.ifEntry.ifInOctets.1'], interfaceid: [null],
snmp_community: ['public'],
applications: [null],
templateid:[null], templateid:[null],
description:[null],
}); });
this.triggerObj = { this.triggerObj = {
condition: '', condition: '',
...@@ -95,34 +88,7 @@ export class BasiCheckComponent implements OnInit { ...@@ -95,34 +88,7 @@ export class BasiCheckComponent implements OnInit {
this.isCheck = true; this.isCheck = true;
this.hostId = hostId; this.hostId = hostId;
this.hostName = hostName; this.hostName = hostName;
if(this.title == '添加监测点'){ // this.getItemType();
//主机接口
this.overAllSer.findInterface(this.hostId).subscribe(
(res) => {
this.interfaceList = res.data;
}
);
this.isInterface = true;
}
if(this.title == '添加模版监测点'){
this.isInterface = false;
this.validateForm.get('interfaceid').clearValidators();
}
this.getItemType();
}
//映射值
getValuemap() {
// this.overAllSer.findValuemap().subscribe(
// (res) => {
// if (res.errCode == 10000) {
// this.valueMapList = res.data;
// } else {
// this.message.error(res.errMsg);
// }
// }
// );
} }
//编辑 //编辑
...@@ -133,32 +99,21 @@ export class BasiCheckComponent implements OnInit { ...@@ -133,32 +99,21 @@ export class BasiCheckComponent implements OnInit {
this.isCheck = true; this.isCheck = true;
this.itemId = id; this.itemId = id;
this.hostName = hostName; this.hostName = hostName;
if(this.title == '编辑模版监测点'){
this.isInterface = false;
this.validateForm.get('interfaceid').clearValidators();
}
this.overAllSer.findItemDetail(id).subscribe( this.overAllSer.findItemDetail(id).subscribe(
(res) => { (res) => {
const data = res.data[0]; const data = res.data[0];
data.type += ''; data.type += '';
data.interfaceid += ''; data.valueType += '';
data.value_type += ''; // if(data.applications){
if(data.applications){ // data.applications = data.applications.map(e=>{
data.applications = data.applications.map(e=>{ // return e.applicationid;
return e.applicationid; // });
}); // }
}
this.validateForm.patchValue(data); this.validateForm.patchValue(data);
} }
); );
//主机接口 // this.getItemType();
this.overAllSer.findInterface(this.hostId).subscribe(
(res) => {
this.interfaceList = res.data;
}
);
this.getItemType();
} }
//获取监测点分类 //获取监测点分类
...@@ -244,11 +199,6 @@ export class BasiCheckComponent implements OnInit { ...@@ -244,11 +199,6 @@ export class BasiCheckComponent implements OnInit {
this.initForm(); this.initForm();
} }
//键值查询
showKeymodal() {
this.basicKey.showKeyModal();
}
//新增分类 //新增分类
showTypeModal() { showTypeModal() {
this.newType.showModal('新建分类'); this.newType.showModal('新建分类');
...@@ -264,7 +214,7 @@ export class BasiCheckComponent implements OnInit { ...@@ -264,7 +214,7 @@ export class BasiCheckComponent implements OnInit {
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.message.success('添加成功'); this.message.success('添加成功');
this.getItemType(); // this.getItemType();
} }
} }
); );
...@@ -272,7 +222,7 @@ export class BasiCheckComponent implements OnInit { ...@@ -272,7 +222,7 @@ export class BasiCheckComponent implements OnInit {
getKey(keyValue): void { getKey(keyValue): void {
const d = { const d = {
key_: keyValue key: keyValue
}; };
this.validateForm.patchValue(d); this.validateForm.patchValue(d);
} }
......
...@@ -56,6 +56,7 @@ export class BasicEditComponent implements OnInit { ...@@ -56,6 +56,7 @@ export class BasicEditComponent implements OnInit {
isYesInVentory = 'primary'; isYesInVentory = 'primary';
isNOInVentory = 'default'; isNOInVentory = 'default';
inventoryParentId; inventoryParentId;
equipmentTypeid;
constructor(private fb: FormBuilder, private overAllSer: OverAllService, constructor(private fb: FormBuilder, private overAllSer: OverAllService,
private emitService: EmitService, private emitService: EmitService,
...@@ -80,13 +81,15 @@ export class BasicEditComponent implements OnInit { ...@@ -80,13 +81,15 @@ export class BasicEditComponent implements OnInit {
//获取分组 //获取分组
getGroup() { getGroup() {
this.groupList = []; this.groupList = [];
this.overAllSer.getEditGroups(0).subscribe( this.overAllSer.findGroup().subscribe(
(res) => { (res) => {
for (let i = 0; i < res.data.length; i++) { if (res.errCode == 10000) {
const gObj = { res.data.data.forEach(e => {
label: res.data[i].name, value: res.data[i].groupid, checked: false e.label = e.name;
}; e.value = e.id;
this.groupList.push(gObj); e.checked = false;
});
this.groupList = res.data.data;
} }
} }
); );
...@@ -130,14 +133,6 @@ export class BasicEditComponent implements OnInit { ...@@ -130,14 +133,6 @@ export class BasicEditComponent implements OnInit {
const data = res.data[0]; const data = res.data[0];
this.validateForm.name = data.name; this.validateForm.name = data.name;
this.validateForm.host = data.host; this.validateForm.host = data.host;
this.validateForm.ipmi_authtype = data.ipmi_authtype + '';
this.validateForm.ipmi_username = data.ipmi_username + '';
this.validateForm.ipmi_privilege = data.ipmi_privilege + '';
this.validateForm.ipmi_password = data.ipmi_password + '';
this.validateForm.tls_psk_identity = data.tls_psk_identity + '';
this.validateForm.tls_issuer = data.tls_issuer + '';
this.validateForm.tls_subject = data.tls_subject + '';
this.validateForm.tls_psk = data.tls_psk + '';
//分组对象 //分组对象
if (data.groups) { if (data.groups) {
...@@ -249,12 +244,9 @@ export class BasicEditComponent implements OnInit { ...@@ -249,12 +244,9 @@ export class BasicEditComponent implements OnInit {
const interfaceArr = []; const interfaceArr = [];
this.interfaceslist.forEach(res => { this.interfaceslist.forEach(res => {
const a = { const a = {
main: res.main,
ip: res.ip, ip: res.ip,
dns: res.dns,
type: res.type, type: res.type,
port: res.port, port: res.port,
useip: res.useip,
bulk: '' bulk: ''
}; };
if (res.type == '2') { if (res.type == '2') {
...@@ -275,7 +267,14 @@ export class BasicEditComponent implements OnInit { ...@@ -275,7 +267,14 @@ export class BasicEditComponent implements OnInit {
if (!this.isInVentory) { if (!this.isInVentory) {
this.validateForm.inventoryExtend = null; this.validateForm.inventoryExtend = null;
} }
console.log(this.validateForm); let clearArr = [];
this.validateForm.templates.forEach(e=>{
const d = {
id:e
};
clearArr.push(d);
});
this.validateForm.templates = clearArr;
this.overAllSer.createHost(this.validateForm).subscribe( this.overAllSer.createHost(this.validateForm).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
...@@ -297,12 +296,9 @@ export class BasicEditComponent implements OnInit { ...@@ -297,12 +296,9 @@ export class BasicEditComponent implements OnInit {
const interfaceArr = []; const interfaceArr = [];
this.interfaceslist.forEach(res => { this.interfaceslist.forEach(res => {
const a = { const a = {
main: res.main,
ip: res.ip, ip: res.ip,
dns: res.dns,
type: res.type, type: res.type,
port: res.port, port: res.port,
useip: res.useip,
bulk: '', bulk: '',
hostid: this.hostId, hostid: this.hostId,
interfaceid: res.interfaceid interfaceid: res.interfaceid
...@@ -326,9 +322,13 @@ export class BasicEditComponent implements OnInit { ...@@ -326,9 +322,13 @@ export class BasicEditComponent implements OnInit {
} }
this.templatesResoure.forEach(res => { this.templatesResoure.forEach(res => {
if (this.validateForm.templates.indexOf(res) == -1) { if (this.validateForm.templates.indexOf(res) == -1) {
clearArr.push(res); const d = {
id:res
};
clearArr.push(d);
} }
}); });
this.validateForm.clearTemplateids = clearArr; this.validateForm.clearTemplateids = clearArr;
if (this.macroTYpe == 'macroExpand') { if (this.macroTYpe == 'macroExpand') {
...@@ -397,12 +397,9 @@ export class BasicEditComponent implements OnInit { ...@@ -397,12 +397,9 @@ export class BasicEditComponent implements OnInit {
//接口add //接口add
addInterfaces() { addInterfaces() {
const demo = { const demo = {
main: '0',
ip: '', ip: '',
dns: '', type: '2',
type: '1',
port: '10050', port: '10050',
useip: 1,
bulk: true, bulk: true,
}; };
this.interfaceslist.push(demo); this.interfaceslist.push(demo);
...@@ -519,12 +516,9 @@ export class BasicEditComponent implements OnInit { ...@@ -519,12 +516,9 @@ export class BasicEditComponent implements OnInit {
]; ];
this.interfaceslist = [ //接口list this.interfaceslist = [ //接口list
{ {
main: '1',
ip: '', ip: '',
dns: '',
type: '1', type: '1',
port: '10050', port: '10050',
useip: 1,
bulk: true, bulk: true,
} }
]; ];
...@@ -534,7 +528,6 @@ export class BasicEditComponent implements OnInit { ...@@ -534,7 +528,6 @@ export class BasicEditComponent implements OnInit {
hostExtend: { hostExtend: {
equipmentTypeid: null, equipmentTypeid: null,
secondLevelTypeid: null, secondLevelTypeid: null,
// serviceid: ''
}, },
macros: this.macroList1, macros: this.macroList1,
interfaces: null, //接口 interfaces: null, //接口
...@@ -556,14 +549,6 @@ export class BasicEditComponent implements OnInit { ...@@ -556,14 +549,6 @@ export class BasicEditComponent implements OnInit {
templates: null, templates: null,
name: null, name: null,
host: null, host: null,
ipmi_authtype: null,
ipmi_username: null,
ipmi_privilege: null,
ipmi_password: null,
tls_psk_identity: null,
tls_issuer: null,
tls_subject: null,
tls_psk: null,
}; };
} }
} }
...@@ -45,7 +45,7 @@ export class WarnListComponent implements OnInit { ...@@ -45,7 +45,7 @@ export class WarnListComponent implements OnInit {
const data = { const data = {
pageNum: this.pageNum, pageNum: this.pageNum,
pageCount: this.pageCount, pageCount: this.pageCount,
obj: obj // obj: obj
}; };
this.alarmSer.eventFind(data).subscribe( this.alarmSer.eventFind(data).subscribe(
(res) => { (res) => {
......
...@@ -129,7 +129,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -129,7 +129,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
this.hostId = queryParams.hostId; this.hostId = queryParams.hostId;
this.overAllSer.findDetailed(this.hostId).subscribe( this.overAllSer.findDetailed(this.hostId).subscribe(
(res)=>{ (res)=>{
let data = res.data[0] let data = res.data;
this.hostName = data.name; //显示名 this.hostName = data.name; //显示名
this.realName = data.host; //主机名 this.realName = data.host; //主机名
} }
...@@ -138,11 +138,11 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -138,11 +138,11 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
} }
ngOnInit() { ngOnInit() {
this.isSpinning = true; this.isSpinning = false;
this.responseTime(); // this.responseTime();
this.losed(); // this.losed();
this.cpused(); // this.cpused();
this.used(); // this.used();
// this.inOutInfo(); // this.inOutInfo();
//监测点 //监测点
...@@ -153,7 +153,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -153,7 +153,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
hostid:this.hostId hostid:this.hostId
}; };
this.warnList.getList(obj); this.warnList.getList(obj);
this.disks(); // this.disks();
} }
ngAfterViewInit() { ngAfterViewInit() {
...@@ -614,7 +614,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -614,7 +614,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//进出口流量-SNMP //进出口流量-SNMP
inOutInfo() { inOutInfo() {
this.inOutLoading = true; this.inOutLoading = false;
const data = { const data = {
obj:{ obj:{
hostid:Number(this.hostId) hostid:Number(this.hostId)
...@@ -662,7 +662,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -662,7 +662,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//添加or编辑监测点 之后 //添加or编辑监测点 之后
getList(){ getList(){
this.getCheckList(); this.getCheckList();
this.findItemType(); // this.findItemType();
} }
handleKeyCancel() { handleKeyCancel() {
...@@ -676,7 +676,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -676,7 +676,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//监测点列表 //监测点列表
getCheckList() { getCheckList() {
this.getCheckStatus(); this.getCheckStatus();
this.loading = true; this.loading = false;
const data = { const data = {
pageNum: this.pageIndex, pageNum: this.pageIndex,
pageCount: pageSize, pageCount: pageSize,
......
...@@ -139,18 +139,6 @@ ...@@ -139,18 +139,6 @@
<span (click)="goEquip(item)">{{item?.equipmentType}}</span> <span (click)="goEquip(item)">{{item?.equipmentType}}</span>
</td> </td>
<td class="default"> <td class="default">
<ng-container *ngIf="!item.available || item.available == 0">
<nz-tag>AGENT</nz-tag>
</ng-container>
<ng-container *ngIf="item.available == 1">
<nz-tag [nzColor]="'#3bae6a'">AGENT</nz-tag>
</ng-container>
<ng-container *ngIf="item.available == 2">
<nz-tooltip [nzTitle]="item.error">
<nz-tag nz-tooltip [nzColor]="'#d44f51'">AGENT</nz-tag>
</nz-tooltip>
</ng-container>
<ng-container *ngIf=" !item.snmp_available || item.snmp_available == 0"> <ng-container *ngIf=" !item.snmp_available || item.snmp_available == 0">
<nz-tooltip [nzTitle]="item?.snmp_error"> <nz-tooltip [nzTitle]="item?.snmp_error">
<nz-tag>SNMP</nz-tag> <nz-tag>SNMP</nz-tag>
...@@ -176,18 +164,6 @@ ...@@ -176,18 +164,6 @@
<nz-tag nz-tooltip [nzColor]="'#d44f51'">JMX</nz-tag> <nz-tag nz-tooltip [nzColor]="'#d44f51'">JMX</nz-tag>
</nz-tooltip> </nz-tooltip>
</ng-container> </ng-container>
<ng-container *ngIf="!item.ipmi_available || item.ipmi_available == 0">
<nz-tag>IPMI</nz-tag>
</ng-container>
<ng-container *ngIf="item.ipmi_available == 1">
<nz-tag [nzColor]="'#3bae6a'">IPMI</nz-tag>
</ng-container>
<ng-container *ngIf="item.ipmi_available == 2">
<nz-tooltip [nzTitle]="item.ipmi_error">
<nz-tag nz-tooltip [nzColor]="'#d44f51'">IPMI</nz-tag>
</nz-tooltip>
</ng-container>
</td> </td>
<td class="handle main-color"> <td class="handle main-color">
<span (click)="showBasicCheckModal(item.hostid,item.host)">添加监测点</span> <span (click)="showBasicCheckModal(item.hostid,item.host)">添加监测点</span>
...@@ -203,8 +179,7 @@ ...@@ -203,8 +179,7 @@
<ng-container *ngIf="item.status == 0">停止</ng-container> <ng-container *ngIf="item.status == 0">停止</ng-container>
监控 监控
</a></li> </a></li>
<li nz-menu-item (click)="goDetail(item)"><a>查看监测点</a></li> <!-- <li nz-menu-item (click)="goDetail(item)"><a>查看监测点</a></li>-->
<li (click)="showAlarm()" nz-menu-item><a>添加告警</a></li>
</ul> </ul>
</nz-dropdown> </nz-dropdown>
</td> </td>
...@@ -223,4 +198,4 @@ ...@@ -223,4 +198,4 @@
<!--临时暂停--> <!--临时暂停-->
<smart-pause #smartPause (done)="handleOk($event)"></smart-pause> <smart-pause #smartPause (done)="handleOk($event)"></smart-pause>
<!--添加告警--> <!--添加告警-->
<smart-alarm-modal #smartAlarmModal></smart-alarm-modal> <!--<smart-alarm-modal #smartAlarmModal></smart-alarm-modal>-->
...@@ -48,7 +48,7 @@ export class BasicComponent implements OnInit { ...@@ -48,7 +48,7 @@ export class BasicComponent implements OnInit {
@ViewChild('smartCheck') smartCheck: BasiCheckComponent; @ViewChild('smartCheck') smartCheck: BasiCheckComponent;
@ViewChild('smartCreateGroup') smartCreateGroup: CreateGroupComponent; @ViewChild('smartCreateGroup') smartCreateGroup: CreateGroupComponent;
@ViewChild('smartPause') smartPause: PauseComponent; @ViewChild('smartPause') smartPause: PauseComponent;
@ViewChild('smartAlarmModal') smartAlarmModal: AlarmModalComponent; // @ViewChild('smartAlarmModal') smartAlarmModal: AlarmModalComponent;
color = color; color = color;
...@@ -171,7 +171,7 @@ export class BasicComponent implements OnInit { ...@@ -171,7 +171,7 @@ export class BasicComponent implements OnInit {
this.overAllSer.findGroup().subscribe( this.overAllSer.findGroup().subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.groupList = res.data; this.groupList = res.data.data;
this.search(); this.search();
} }
} }
...@@ -404,7 +404,7 @@ export class BasicComponent implements OnInit { ...@@ -404,7 +404,7 @@ export class BasicComponent implements OnInit {
//添加告警 //添加告警
showAlarm() { showAlarm() {
this.smartAlarmModal.showAddModal('添加告警', null); // this.smartAlarmModal.showAddModal('添加告警', null);
} }
handleOk(e) { handleOk(e) {
......
...@@ -111,7 +111,7 @@ export class OverAllService { ...@@ -111,7 +111,7 @@ export class OverAllService {
//创建监控点 //创建监控点
create(data): Observable<any> { create(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/item/create', data); return this.http.post(SERVER_API_URL + '/item/save', data);
} }
//删除资源--get //删除资源--get
...@@ -131,7 +131,7 @@ export class OverAllService { ...@@ -131,7 +131,7 @@ export class OverAllService {
//模版信息 //模版信息
templates(): Observable<any> { templates(): Observable<any> {
return this.http.get(SERVER_API_URL + '/templates'); return this.http.get(SERVER_API_URL + '/template/list');
} }
//添加分组 //添加分组
...@@ -151,7 +151,7 @@ export class OverAllService { ...@@ -151,7 +151,7 @@ export class OverAllService {
//删除监控项 //删除监控项
deleteItem(data): Observable<any> { deleteItem(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/item/deleteItem', data); return this.http.post(SERVER_API_URL + '/item/delete', data);
} }
//监控设备数 //监控设备数
...@@ -161,7 +161,7 @@ export class OverAllService { ...@@ -161,7 +161,7 @@ export class OverAllService {
//监测点列表--type //监测点列表--type
findCheckByType(data): Observable<any> { findCheckByType(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/item/find/', data); return this.http.post(SERVER_API_URL + '/item/page', data);
} }
//查询监控项 //查询监控项
...@@ -181,7 +181,7 @@ export class OverAllService { ...@@ -181,7 +181,7 @@ export class OverAllService {
//监测点状态统计 //监测点状态统计
findItemCount(params): Observable<any> { findItemCount(params): Observable<any> {
return this.http.get(SERVER_API_URL + '/item/findItemStatistics/' + params); return this.http.get(SERVER_API_URL + '/item/finditemstatus/' + params);
} }
//监测点图形数据 //监测点图形数据
...@@ -538,6 +538,6 @@ export class OverAllService { ...@@ -538,6 +538,6 @@ export class OverAllService {
//查询系统信息 //查询系统信息
getSystem(): Observable<any> { getSystem(): Observable<any> {
return this.http.get( './json/system.json'); return this.http.get('./json/system.json');
} }
} }
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