Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqinghua
smart
Commits
4738f890
Commit
4738f890
authored
Nov 18, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
52b84d40
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
179 additions
and
68 deletions
+179
-68
basi-check.component.html
...ain/webapp/app/modal/basi-check/basi-check.component.html
+5
-5
basic.component.html
src/main/webapp/app/overAll/basic/basic.component.html
+86
-26
basic.component.ts
src/main/webapp/app/overAll/basic/basic.component.ts
+75
-36
overAll.service.ts
src/main/webapp/app/overAll/overAll.service.ts
+11
-0
global.css
src/main/webapp/content/css/global.css
+2
-1
No files found.
src/main/webapp/app/modal/basi-check/basi-check.component.html
View file @
4738f890
...
...
@@ -14,15 +14,15 @@
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"type"
>
类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"type"
name=
"type"
nzPlaceHolder=
"选择类型"
[(
ngModel
)]="
validateForm
.
type
"
>
<nz-option
nzValue=
"0"
nzLabel=
"
Zabbix
客户端"
></nz-option>
<nz-option
nzValue=
"7"
nzLabel=
"
Zabbix
客户端(主动式)"
></nz-option>
<nz-option
nzValue=
"0"
nzLabel=
"
Agent
客户端"
></nz-option>
<nz-option
nzValue=
"7"
nzLabel=
"
Agent
客户端(主动式)"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"简单检查"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"SNMPv1 客户端"
></nz-option>
<nz-option
nzValue=
"4"
nzLabel=
"SNMPv2 客户端"
></nz-option>
<nz-option
nzValue=
"6"
nzLabel=
"SNMPv3 客户端"
></nz-option>
<nz-option
nzValue=
"5"
nzLabel=
"
Zabbix
内部"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"
Zabbix
采集器"
></nz-option>
<nz-option
nzValue=
"8"
nzLabel=
"
Zabbix
整合"
></nz-option>
<nz-option
nzValue=
"5"
nzLabel=
"
Agent
内部"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"
Agent
采集器"
></nz-option>
<nz-option
nzValue=
"8"
nzLabel=
"
Agent
整合"
></nz-option>
<nz-option
nzValue=
"10"
nzLabel=
"外部检查"
></nz-option>
<nz-option
nzValue=
"11"
nzLabel=
"数据库监控"
></nz-option>
<nz-option
nzValue=
"12"
nzLabel=
"IPMI客户端"
></nz-option>
...
...
src/main/webapp/app/overAll/basic/basic.component.html
View file @
4738f890
This diff is collapsed.
Click to expand it.
src/main/webapp/app/overAll/basic/basic.component.ts
View file @
4738f890
...
...
@@ -59,6 +59,12 @@ export class BasicComponent implements OnInit {
//批量删除list
batchDelList
=
[];
//设备状态
red
;
yellow
;
green
;
gray
;
constructor
(
private
fb
:
FormBuilder
,
private
overAllSer
:
OverAllService
,
private
router
:
Router
,
private
modalService
:
NzModalService
,
private
message
:
NzMessageService
,
)
{
...
...
@@ -111,8 +117,44 @@ export class BasicComponent implements OnInit {
ngOnInit
():
void
{
this
.
selectedValue
=
'group'
;
this
.
select
();
// this.findList();
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
...
...
@@ -193,12 +235,6 @@ export class BasicComponent implements OnInit {
});
}
//全选
checkAll
(
e
)
{
}
//删除单个资源
showDeleteConfirm
(
data
)
{
this
.
modalService
.
confirm
({
...
...
@@ -236,12 +272,13 @@ export class BasicComponent implements OnInit {
nzOkType
:
'danger'
,
nzOnOk
:
()
=>
{
const
data
=
{
param
s
:
this
.
batchDelList
hostid
s
:
this
.
batchDelList
}
this
.
overAllSer
.
deleteHostPost
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
info
(
'删除成功'
);
this
.
batchDelList
=
[];
this
.
select
();
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
...
...
@@ -363,6 +400,7 @@ export class BasicComponent implements OnInit {
this
.
smartPause
.
showModal
(
item
.
hostid
);
}
//选择
selectChecked
(
event
,
item
){
if
(
event
){
if
(
item
.
hostid
){
...
...
@@ -405,33 +443,34 @@ export class BasicComponent implements OnInit {
}
//批量开启or停止监控
openBatchHost
(
item
){
// this.modalService.confirm({
// nzTitle: '监控',
// nzContent: '确定开启监控设备'+item.name + '?',
// nzOkText: '确定',
// nzCancelText: '取消',
// nzOnOk: () => {
// const data = {
//
// }
// let params1 = 0;
// if(item.status == 1){
// params1 = 0;
// }
// const params2 = item.hostid;
// this.overAllSer.batchStopOrOpen(params1,params2).subscribe(
// (res) => {
// if (res.errCode == 10000) {
// this.message.info('修改成功');
// this.select();
// } else {
// this.message.info(res.errMsg);
// }
// }
// );
// },
// nzOnCancel: () => console.log('Cancel')
// });
openBatchHost
(
status
,
operation
){
if
(
this
.
batchDelList
.
length
==
0
){
this
.
message
.
info
(
'请选择需要'
+
operation
+
'的设备'
);
return
false
;
}
this
.
modalService
.
confirm
({
nzTitle
:
'监控'
,
nzContent
:
'确定批量'
+
operation
+
'监控设备?'
,
nzOkText
:
'确定'
,
nzCancelText
:
'取消'
,
nzOnOk
:
()
=>
{
const
data
=
{
status
:
status
,
hostids
:
this
.
batchDelList
}
this
.
overAllSer
.
batchStopOrOpen
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
info
(
'修改成功'
);
this
.
batchDelList
=
[];
this
.
select
();
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
}
}
);
},
nzOnCancel
:
()
=>
console
.
log
(
'Cancel'
)
});
}
}
src/main/webapp/app/overAll/overAll.service.ts
View file @
4738f890
...
...
@@ -198,4 +198,14 @@ export class OverAllService {
updateHost
(
data
):
Observable
<
any
>
{
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
src/main/webapp/content/css/global.css
View file @
4738f890
...
...
@@ -259,9 +259,10 @@ ui bootstrap tweaks
.margin-0-16
{
margin
:
0
16px
;
}
.ant-tag
{
.
tag-form
.
ant-tag
{
height
:
16px
;
vertical-align
:
sub
;
margin-right
:
4px
;
}
.background
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment