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
3bb0c10b
Commit
3bb0c10b
authored
Nov 20, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
网站监测
parent
a75ad9c1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
10 deletions
+127
-10
alarm-target.component.html
.../app/alarm/modal/alarm-target/alarm-target.component.html
+2
-2
alarm-modal.component.html
...n/webapp/app/modal/alarm-modal/alarm-modal.component.html
+12
-2
alarm-modal.component.ts
...ain/webapp/app/modal/alarm-modal/alarm-modal.component.ts
+113
-6
No files found.
src/main/webapp/app/alarm/modal/alarm-target/alarm-target.component.html
View file @
3bb0c10b
...
@@ -7,8 +7,7 @@
...
@@ -7,8 +7,7 @@
[
nzMultiple
]="
true
"
[
nzMultiple
]="
true
"
[
nzAsyncData
]
=
"
true
""
[
nzAsyncData
]
=
"
true
""
(
nzClick
)="
mouseAction
('
expand
',$
event
)"
(
nzClick
)="
mouseAction
('
expand
',$
event
)"
(
nzExpandChange
)="
mouseAction
('
expand
',$
event
)"
(
nzExpandChange
)="
mouseAction
('
expand
',$
event
)"
>
>
</nz-tree>
</nz-tree>
</div>
</div>
</nz-modal>
</nz-modal>
\ No newline at end of file
src/main/webapp/app/modal/alarm-modal/alarm-modal.component.html
View file @
3bb0c10b
...
@@ -14,7 +14,17 @@
...
@@ -14,7 +14,17 @@
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"host1"
>
告警目标
</nz-form-label>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"host1"
>
告警目标
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"host1"
type=
"text"
nz-input
name=
"host1"
>
<div
class=
"tree-div"
>
<nz-tree
#
nzTree
[(
ngModel
)]="
nodes
"
[
nzCheckable
]="
true
"
[
nzAsyncData
]="
true
"
[
nzCheckStrictly
]="
true
"
(
nzCheckBoxChange
)="
selectCheckTree
($
event
)"
(
nzClick
)="
mouseAction
('
expand
',$
event
)"
(
nzExpandChange
)="
mouseAction
('
expand
',$
event
)"
>
</nz-tree>
</div>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
...
@@ -130,7 +140,7 @@
...
@@ -130,7 +140,7 @@
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"serviceid"
>
生成事件
</nz-form-label>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"serviceid"
>
生成事件
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-radio-group
>
<nz-radio-group>
<label
nz-radio
nzValue=
"1"
>
是
</label>
<label
nz-radio
nzValue=
"1"
>
是
</label>
<label
nz-radio
nzValue=
"2"
>
否
</label>
<label
nz-radio
nzValue=
"2"
>
否
</label>
</nz-radio-group>
</nz-radio-group>
...
...
src/main/webapp/app/modal/alarm-modal/alarm-modal.component.ts
View file @
3bb0c10b
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
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
{
OverAllService
}
from
'../../overAll/overAll.service'
;
@
Component
({
@
Component
({
selector
:
'smart-alarm-modal'
,
selector
:
'smart-alarm-modal'
,
templateUrl
:
'./alarm-modal.component.html'
,
templateUrl
:
'./alarm-modal.component.html'
,
styles
:
[]
styles
:
[
`
.tree-div {
border: 1px solid #999;
max-height: 200px;
overflow: auto
}
`
]
})
})
export
class
AlarmModalComponent
implements
OnInit
{
export
class
AlarmModalComponent
implements
OnInit
{
@
ViewChild
(
'smartFindUser'
)
smartFindUser
:
FindUserComponent
;
@
ViewChild
(
'smartFindUser'
)
smartFindUser
:
FindUserComponent
;
@
ViewChild
(
'nzTree'
)
nzTree
:
NzTreeComponent
;
modalTitle
=
'添加告警'
;
modalTitle
=
'添加告警'
;
tabNum
=
0
;
tabNum
=
0
;
isShow
=
false
;
isShow
=
false
;
nodes
;
nodeList
;
sendOption
=
[];
sendOption
=
[];
userObj
;
userObj
=
{
alias
:
''
,
userid
:
''
};
selectTreeList
=
[];
validateForm
;
validateForm
;
constructor
(
private
alarmSer
:
AlarmService
)
{
constructor
(
private
alarmSer
:
AlarmService
,
private
message
:
NzMessageService
,
private
overAllSer
:
OverAllService
)
{
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
initForm
();
this
.
initForm
();
this
.
getSendFun
();
this
.
getSendFun
();
this
.
getGroup
();
}
}
//初始化
//初始化
initForm
()
{
initForm
()
{
this
.
selectTreeList
=
[];
this
.
validateForm
=
{
this
.
validateForm
=
{
name
:
null
,
name
:
null
,
alertGroupId
:
null
,
alertGroupId
:
null
,
};
};
}
}
//获取告警目标
getGroup
()
{
this
.
overAllSer
.
findGroup
().
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
const
dataSet
=
res
.
data
;
dataSet
.
forEach
(
res
=>
{
res
.
title
=
res
.
name
;
res
.
key
=
res
.
groupid
;
});
this
.
nodeList
=
dataSet
;
this
.
toNode
(
dataSet
);
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
}
}
);
}
toNode
(
data
)
{
this
.
nodes
=
data
.
map
(
res
=>
{
return
new
NzTreeNode
(
res
);
});
}
//下级
mouseAction
(
name
:
string
,
event
:
NzFormatEmitEvent
)
{
console
.
log
(
name
);
console
.
log
(
event
);
const
index
=
<
any
>
event
.
node
.
key
-
1
;
const
data
=
{
'groupids'
:
[
event
.
node
.
origin
.
groupid
],
'hostExtend'
:
{
'superiorHostid'
:
null
}
};
this
.
overAllSer
.
findDetail
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
data
)
{
const
dataSet
=
res
.
data
;
dataSet
.
forEach
(
res
=>
{
res
.
title
=
res
.
name
;
res
.
key
=
res
.
groupid
;
res
.
isLeaf
=
true
;
});
event
.
node
.
addChildren
(
dataSet
);
this
.
nodeList
[
index
].
children
=
dataSet
;
this
.
nodeList
[
index
].
expanded
=
true
;
}
else
{
event
.
node
.
addChildren
([]);
this
.
message
.
info
(
'该分组下无资源'
);
}
}
);
setTimeout
(
_
=>
{
},
1000
);
// }
}
//选择树节点
selectCheckTree
(
event
:
NzFormatEmitEvent
)
{
if
(
event
.
node
.
isChecked
)
{
this
.
selectTreeList
.
push
(
event
.
node
.
origin
.
hostid
);
}
else
{
const
index
=
this
.
selectTreeList
.
indexOf
(
event
.
node
.
origin
.
hostid
);
this
.
selectTreeList
.
splice
(
index
,
1
);
}
}
//获取发送方式
//获取发送方式
getSendFun
()
{
getSendFun
()
{
this
.
alarmSer
.
mediaTypeFind
({}).
subscribe
(
this
.
alarmSer
.
mediaTypeFind
({}).
subscribe
(
...
@@ -52,7 +142,7 @@ export class AlarmModalComponent implements OnInit {
...
@@ -52,7 +142,7 @@ export class AlarmModalComponent implements OnInit {
}
}
//选择对象
//选择对象
showUserModa
(){
showUserModa
()
{
this
.
smartFindUser
.
showModal
();
this
.
smartFindUser
.
showModal
();
}
}
...
@@ -75,7 +165,24 @@ export class AlarmModalComponent implements OnInit {
...
@@ -75,7 +165,24 @@ export class AlarmModalComponent implements OnInit {
}
}
handEditleOk
()
{
handEditleOk
()
{
this
.
isShow
=
false
;
const
data
=
{
name
:
this
.
validateForm
.
name
,
operations
:
[
{
opmessage_usr
:
[
{
userid
:
this
.
userObj
.
userid
}
]
}
]
};
this
.
alarmSer
.
actionCreate
(
data
).
subscribe
(
(
res
)
=>
{
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