Commit 4738f890 authored by wangqinghua's avatar wangqinghua

log

parent 52b84d40
...@@ -14,15 +14,15 @@ ...@@ -14,15 +14,15 @@
<nz-form-label [nzSpan]="6" nzRequired nzFor="type">类型</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired nzFor="type">类型</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<nz-select name="type" name="type" nzPlaceHolder="选择类型" [(ngModel)]="validateForm.type"> <nz-select name="type" name="type" nzPlaceHolder="选择类型" [(ngModel)]="validateForm.type">
<nz-option nzValue="0" nzLabel="Zabbix 客户端"></nz-option> <nz-option nzValue="0" nzLabel="Agent客户端"></nz-option>
<nz-option nzValue="7" nzLabel="Zabbix客户端(主动式)"></nz-option> <nz-option nzValue="7" nzLabel="Agent客户端(主动式)"></nz-option>
<nz-option nzValue="3" nzLabel="简单检查"></nz-option> <nz-option nzValue="3" nzLabel="简单检查"></nz-option>
<nz-option nzValue="1" nzLabel="SNMPv1 客户端"></nz-option> <nz-option nzValue="1" nzLabel="SNMPv1 客户端"></nz-option>
<nz-option nzValue="4" nzLabel="SNMPv2 客户端"></nz-option> <nz-option nzValue="4" nzLabel="SNMPv2 客户端"></nz-option>
<nz-option nzValue="6" nzLabel="SNMPv3 客户端"></nz-option> <nz-option nzValue="6" nzLabel="SNMPv3 客户端"></nz-option>
<nz-option nzValue="5" nzLabel="Zabbix内部"></nz-option> <nz-option nzValue="5" nzLabel="Agent内部"></nz-option>
<nz-option nzValue="2" nzLabel="Zabbix采集器"></nz-option> <nz-option nzValue="2" nzLabel="Agent采集器"></nz-option>
<nz-option nzValue="8" nzLabel="Zabbix整合"></nz-option> <nz-option nzValue="8" nzLabel="Agent整合"></nz-option>
<nz-option nzValue="10" nzLabel="外部检查"></nz-option> <nz-option nzValue="10" nzLabel="外部检查"></nz-option>
<nz-option nzValue="11" nzLabel="数据库监控"></nz-option> <nz-option nzValue="11" nzLabel="数据库监控"></nz-option>
<nz-option nzValue="12" nzLabel="IPMI客户端"></nz-option> <nz-option nzValue="12" nzLabel="IPMI客户端"></nz-option>
......
...@@ -59,6 +59,12 @@ export class BasicComponent implements OnInit { ...@@ -59,6 +59,12 @@ export class BasicComponent implements OnInit {
//批量删除list //批量删除list
batchDelList = []; batchDelList = [];
//设备状态
red;
yellow;
green;
gray;
constructor(private fb: FormBuilder, private overAllSer: OverAllService, private router: Router, constructor(private fb: FormBuilder, private overAllSer: OverAllService, private router: Router,
private modalService: NzModalService, private message: NzMessageService, private modalService: NzModalService, private message: NzMessageService,
) { ) {
...@@ -111,8 +117,44 @@ export class BasicComponent implements OnInit { ...@@ -111,8 +117,44 @@ export class BasicComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.selectedValue = 'group'; this.selectedValue = 'group';
this.select(); this.select();
// this.findList();
this.findSize(); this.findSize();
this.findOpStatus();
}
//查询设备状态
findOpStatus(){
this.overAllSer.findHostCountByStatus(0).subscribe(
(res)=>{
if(res.errCode == 10000){
this.green = res.data.size;
}else{
this.message.info(res.Msg);
}
}
)
this.overAllSer.findHostCountByStatus(1).subscribe(
(res)=>{
this.gray = res.data.size;
}
)
this.overAllSer.findWarningByAll(1).subscribe(
(res)=>{
if(res.errCode == 10000){
this.yellow = res.data.size;
}else{
this.message.info(res.Msg);
}
}
)
this.overAllSer.findWarningByAll(0).subscribe(
(res)=>{
if(res.errCode == 10000){
this.red = res.data.size;
}else{
this.message.info(res.Msg);
}
}
)
} }
//添加资源 ,name-分组名称,id-分组id //添加资源 ,name-分组名称,id-分组id
...@@ -193,12 +235,6 @@ export class BasicComponent implements OnInit { ...@@ -193,12 +235,6 @@ export class BasicComponent implements OnInit {
}); });
} }
//全选
checkAll(e) {
}
//删除单个资源 //删除单个资源
showDeleteConfirm(data) { showDeleteConfirm(data) {
this.modalService.confirm({ this.modalService.confirm({
...@@ -236,12 +272,13 @@ export class BasicComponent implements OnInit { ...@@ -236,12 +272,13 @@ export class BasicComponent implements OnInit {
nzOkType: 'danger', nzOkType: 'danger',
nzOnOk: () => { nzOnOk: () => {
const data = { const data = {
params:this.batchDelList hostids:this.batchDelList
} }
this.overAllSer.deleteHostPost(data).subscribe( this.overAllSer.deleteHostPost(data).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.message.info('删除成功'); this.message.info('删除成功');
this.batchDelList = [];
this.select(); this.select();
} else { } else {
this.message.info(res.errMsg); this.message.info(res.errMsg);
...@@ -363,6 +400,7 @@ export class BasicComponent implements OnInit { ...@@ -363,6 +400,7 @@ export class BasicComponent implements OnInit {
this.smartPause.showModal(item.hostid); this.smartPause.showModal(item.hostid);
} }
//选择
selectChecked(event,item){ selectChecked(event,item){
if(event){ if(event){
if(item.hostid){ if(item.hostid){
...@@ -405,33 +443,34 @@ export class BasicComponent implements OnInit { ...@@ -405,33 +443,34 @@ export class BasicComponent implements OnInit {
} }
//批量开启or停止监控 //批量开启or停止监控
openBatchHost(item){ openBatchHost(status,operation){
// this.modalService.confirm({ if(this.batchDelList.length == 0){
// nzTitle: '监控', this.message.info('请选择需要'+ operation +'的设备');
// nzContent: '确定开启监控设备'+item.name + '?', return false;
// nzOkText: '确定', }
// nzCancelText: '取消', this.modalService.confirm({
// nzOnOk: () => { nzTitle: '监控',
// const data = { nzContent: '确定批量'+operation+'监控设备?',
// nzOkText: '确定',
// } nzCancelText: '取消',
// let params1 = 0; nzOnOk: () => {
// if(item.status == 1){ const data = {
// params1 = 0; status:status,
// } hostids:this.batchDelList
// const params2 = item.hostid; }
// this.overAllSer.batchStopOrOpen(params1,params2).subscribe( this.overAllSer.batchStopOrOpen(data).subscribe(
// (res) => { (res) => {
// if (res.errCode == 10000) { if (res.errCode == 10000) {
// this.message.info('修改成功'); this.message.info('修改成功');
// this.select(); this.batchDelList = [];
// } else { this.select();
// this.message.info(res.errMsg); } else {
// } this.message.info(res.errMsg);
// } }
// ); }
// }, );
// nzOnCancel: () => console.log('Cancel') },
// }); nzOnCancel: () => console.log('Cancel')
});
} }
} }
...@@ -198,4 +198,14 @@ export class OverAllService { ...@@ -198,4 +198,14 @@ export class OverAllService {
updateHost(data): Observable<any>{ updateHost(data): Observable<any>{
return this.http.put(SERVER_API_URL + '/host/updataHost',data); return this.http.put(SERVER_API_URL + '/host/updataHost',data);
} }
//根据host的启用状态查询count 记录数
findHostCountByStatus(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/findHostCountByStatus/' + params);
}
//查询所有主机的警告数和高危报警数
findWarningByAll(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/statistics/findWarningByAll/' + params);
}
} }
\ No newline at end of file
...@@ -259,9 +259,10 @@ ui bootstrap tweaks ...@@ -259,9 +259,10 @@ ui bootstrap tweaks
.margin-0-16{ .margin-0-16{
margin: 0 16px; margin: 0 16px;
} }
.ant-tag{ .tag-form .ant-tag{
height: 16px; height: 16px;
vertical-align: sub; vertical-align: sub;
margin-right: 4px;
} }
.background{ .background{
......
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