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
d81c8f47
Commit
d81c8f47
authored
Nov 22, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
网站监测
parent
6031f40d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
27 deletions
+73
-27
alarm-set.component.html
src/main/webapp/app/alarm/alarm-set/alarm-set.component.html
+2
-2
alarm.service.ts
src/main/webapp/app/alarm/alarm.service.ts
+6
-0
alarm-modal.component.html
...n/webapp/app/modal/alarm-modal/alarm-modal.component.html
+0
-0
alarm-modal.component.ts
...ain/webapp/app/modal/alarm-modal/alarm-modal.component.ts
+65
-25
No files found.
src/main/webapp/app/alarm/alarm-set/alarm-set.component.html
View file @
d81c8f47
...
@@ -75,4 +75,4 @@
...
@@ -75,4 +75,4 @@
<smart-alarm-group
#
smartAlarmGroup
(
add
)="
getGroupAlarm
()"
></smart-alarm-group>
<smart-alarm-group
#
smartAlarmGroup
(
add
)="
getGroupAlarm
()"
></smart-alarm-group>
<!--新增告警推送-->
<!--新增告警推送-->
<smart-alarm-modal
#
smartAlarmModal
></smart-alarm-modal>
<smart-alarm-modal
#
smartAlarmModal
(
done
)="
getList
()"
></smart-alarm-modal>
\ No newline at end of file
\ No newline at end of file
src/main/webapp/app/alarm/alarm.service.ts
View file @
d81c8f47
...
@@ -113,4 +113,9 @@ export class AlarmService {
...
@@ -113,4 +113,9 @@ export class AlarmService {
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
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/action/findAlertTarget'
);
}
}
}
\ No newline at end of file
src/main/webapp/app/modal/alarm-modal/alarm-modal.component.html
View file @
d81c8f47
This diff is collapsed.
Click to expand it.
src/main/webapp/app/modal/alarm-modal/alarm-modal.component.ts
View file @
d81c8f47
import
{
Component
,
OnIni
t
,
ViewChild
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'@angular/core'
;
import
{
AlarmService
}
from
'../../alarm/alarm.service'
;
import
{
AlarmService
}
from
'../../alarm/alarm.service'
;
import
{
FindUserComponent
}
from
'../../alarm/modal/find-user/find-user.component'
;
import
{
FindUserComponent
}
from
'../../alarm/modal/find-user/find-user.component'
;
import
{
NzFormatEmitEvent
,
NzMessageService
,
NzTreeComponent
,
NzTreeNode
}
from
'ng-zorro-antd'
;
import
{
NzFormatEmitEvent
,
NzMessageService
,
NzTreeComponent
,
NzTreeNode
}
from
'ng-zorro-antd'
;
...
@@ -20,6 +20,7 @@ import {OverAllService} from '../../overAll/overAll.service';
...
@@ -20,6 +20,7 @@ import {OverAllService} from '../../overAll/overAll.service';
export
class
AlarmModalComponent
implements
OnInit
{
export
class
AlarmModalComponent
implements
OnInit
{
@
ViewChild
(
'smartFindUser'
)
smartFindUser
:
FindUserComponent
;
@
ViewChild
(
'smartFindUser'
)
smartFindUser
:
FindUserComponent
;
@
ViewChild
(
'nzTree'
)
nzTree
:
NzTreeComponent
;
@
ViewChild
(
'nzTree'
)
nzTree
:
NzTreeComponent
;
@
Output
()
done
=
new
EventEmitter
<
any
>
();
modalTitle
=
'添加告警'
;
modalTitle
=
'添加告警'
;
tabNum
=
0
;
tabNum
=
0
;
...
@@ -27,11 +28,9 @@ export class AlarmModalComponent implements OnInit {
...
@@ -27,11 +28,9 @@ export class AlarmModalComponent implements OnInit {
nodes
;
nodes
;
nodeList
;
nodeList
;
groupList
;
sendOption
=
[];
sendOption
=
[];
userObj
=
{
objList
;
alias
:
''
,
userid
:
''
};
selectTreeList
=
[];
selectTreeList
=
[];
validateForm
;
validateForm
;
...
@@ -43,7 +42,9 @@ export class AlarmModalComponent implements OnInit {
...
@@ -43,7 +42,9 @@ export class AlarmModalComponent implements OnInit {
ngOnInit
()
{
ngOnInit
()
{
this
.
initForm
();
this
.
initForm
();
this
.
getSendFun
();
this
.
getSendFun
();
this
.
getACtion
();
this
.
getGroup
();
this
.
getGroup
();
this
.
getZabbixObj
();
}
}
//初始化
//初始化
...
@@ -52,11 +53,18 @@ export class AlarmModalComponent implements OnInit {
...
@@ -52,11 +53,18 @@ export class AlarmModalComponent implements OnInit {
this
.
validateForm
=
{
this
.
validateForm
=
{
name
:
null
,
name
:
null
,
alertGroupId
:
null
,
alertGroupId
:
null
,
warn
:
0
,
serious
:
0
,
mediaTypeIds
:[],
def_longdata
:
null
,
r_longdata
:
null
,
r_shortdata
:
null
,
userIds
:
null
,
};
};
}
}
//获取告警目标
//获取告警目标
get
Group
()
{
get
ACtion
()
{
this
.
overAllSer
.
findGroup
().
subscribe
(
this
.
overAllSer
.
findGroup
().
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
errCode
==
10000
)
{
...
@@ -74,6 +82,17 @@ export class AlarmModalComponent implements OnInit {
...
@@ -74,6 +82,17 @@ export class AlarmModalComponent implements OnInit {
);
);
}
}
//获取告警分组
getGroup
(){
this
.
alarmSer
.
alertGroupFind
().
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
groupList
=
res
.
data
;
}
}
);
}
toNode
(
data
)
{
toNode
(
data
)
{
this
.
nodes
=
data
.
map
(
res
=>
{
this
.
nodes
=
data
.
map
(
res
=>
{
return
new
NzTreeNode
(
res
);
return
new
NzTreeNode
(
res
);
...
@@ -141,15 +160,15 @@ export class AlarmModalComponent implements OnInit {
...
@@ -141,15 +160,15 @@ export class AlarmModalComponent implements OnInit {
);
);
}
}
//
选择对象
//
获取发送对象 zabbix
showUserModa
()
{
getZabbixObj
()
{
this
.
smartFindUser
.
showModal
();
this
.
alarmSer
.
zUserFind
({}).
subscribe
(
}
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
//获取对象
this
.
objList
=
res
.
data
;
getUser
(
data
)
{
}
this
.
userObj
=
data
;
}
console
.
log
(
data
);
);
}
}
showModal
(
data
)
{
showModal
(
data
)
{
...
@@ -165,24 +184,45 @@ export class AlarmModalComponent implements OnInit {
...
@@ -165,24 +184,45 @@ export class AlarmModalComponent implements OnInit {
}
}
handEditleOk
()
{
handEditleOk
()
{
const
optionArr
=
[];
this
.
sendOption
.
forEach
(
res
=>
{
if
(
res
.
checked
){
optionArr
.
push
(
res
.
value
);
}
});
if
(
this
.
validateForm
.
warn
){
this
.
validateForm
.
warn
=
1
;
}
else
{
this
.
validateForm
.
warn
=
0
}
if
(
this
.
validateForm
.
serious
){
this
.
validateForm
.
serious
=
1
;
}
else
{
this
.
validateForm
.
serious
=
0
}
const
data
=
{
const
data
=
{
name
:
this
.
validateForm
.
name
,
name
:
this
.
validateForm
.
name
,
operations
:
[
alertGroupId
:
this
.
validateForm
.
alertGroupId
,
{
warn
:
this
.
validateForm
.
warn
,
opmessage_usr
:
[
serious
:
this
.
validateForm
.
serious
,
{
mediaTypeIds
:
optionArr
,
userid
:
this
.
userObj
.
userid
userIds
:
this
.
validateForm
.
userIds
,
}
def_longdata
:
this
.
validateForm
.
def_longdata
,
]
r_longdata
:
this
.
validateForm
.
r_longdata
,
}
r_shortdata
:
this
.
validateForm
.
r_shortdata
,
]
};
};
this
.
alarmSer
.
actionCreate
(
data
).
subscribe
(
this
.
alarmSer
.
actionCreate
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
isShow
=
false
;
this
.
initForm
();
this
.
done
.
emit
();
}
this
.
message
.
info
(
res
.
errMsg
);
this
.
message
.
info
(
res
.
errMsg
);
}
}
);
);
// this.isShow = false;
}
}
}
}
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