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
a75ad9c1
Commit
a75ad9c1
authored
Nov 20, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
网站监测
parent
4f6f6ce6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
139 additions
and
28 deletions
+139
-28
alarm.service.ts
src/main/webapp/app/alarm/alarm.service.ts
+5
-0
find-user.component.html
...webapp/app/alarm/modal/find-user/find-user.component.html
+23
-0
find-user.component.ts
...n/webapp/app/alarm/modal/find-user/find-user.component.ts
+42
-0
app.main.module.ts
src/main/webapp/app/app.main.module.ts
+2
-0
alarm-modal.component.html
...n/webapp/app/modal/alarm-modal/alarm-modal.component.html
+8
-3
alarm-modal.component.ts
...ain/webapp/app/modal/alarm-modal/alarm-modal.component.ts
+59
-25
No files found.
src/main/webapp/app/alarm/alarm.service.ts
View file @
a75ad9c1
...
@@ -29,6 +29,11 @@ export class AlarmService {
...
@@ -29,6 +29,11 @@ export class AlarmService {
return
this
.
http
.
post
(
SERVER_API_URL
+
'/action/find'
,
data
);
return
this
.
http
.
post
(
SERVER_API_URL
+
'/action/find'
,
data
);
}
}
//查找所有zabbix用户
zUserFind
(
data
):
Observable
<
any
>
{
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
);
...
...
src/main/webapp/app/alarm/modal/find-user/find-user.component.html
0 → 100644
View file @
a75ad9c1
<nz-modal
[
nzWidth
]="
700
"
[(
nzVisible
)]="
isVisible
"
nzTitle=
"选择键值"
(
nzOnCancel
)="
handleKeyCancel
()"
(
nzOnOk
)="
handleKeyOk
()"
>
<div
nz-row
>
<div
nz-col
[
nzSpan
]="
16
"
>
Agent用户
</div>
</div>
<div>
<nz-table
#
nzKeyTable
[
nzData
]="
objList
"
>
<thead>
<tr>
<th
width=
"30%"
>
用户名
</th>
<th>
内容
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of nzKeyTable.data"
>
<td
(
click
)="
setUser
(
data
)"
>
{{data.alias}}
</td>
<td>
{{data.surname}}
</td>
</tr>
</tbody>
</nz-table>
</div>
</nz-modal>
src/main/webapp/app/alarm/modal/find-user/find-user.component.ts
0 → 100644
View file @
a75ad9c1
import
{
Component
,
EventEmitter
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
AlarmService
}
from
'../../alarm.service'
;
@
Component
({
selector
:
'smart-find-user'
,
templateUrl
:
'./find-user.component.html'
,
styles
:
[]
})
export
class
FindUserComponent
implements
OnInit
{
@
Output
()
set
=
new
EventEmitter
<
any
>
();
isVisible
=
false
;
objList
;
constructor
(
private
alarmSer
:
AlarmService
)
{
}
ngOnInit
()
{
this
.
getZabbixObj
();
}
//获取发送对象 zabbix
getZabbixObj
()
{
this
.
alarmSer
.
zUserFind
({}).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
objList
=
res
.
data
;
}
}
);
}
showModal
()
{
this
.
isVisible
=
true
;
}
setUser
(
item
)
{
this
.
isVisible
=
false
;
this
.
set
.
emit
(
item
);
}
}
src/main/webapp/app/app.main.module.ts
View file @
a75ad9c1
...
@@ -62,6 +62,7 @@ import {PersonelManageComponent} from './work/personel-manage/personel-manage.co
...
@@ -62,6 +62,7 @@ import {PersonelManageComponent} from './work/personel-manage/personel-manage.co
import
{
WorkHandleComponent
}
from
'./work/work-handle/work-handle.component'
;
import
{
WorkHandleComponent
}
from
'./work/work-handle/work-handle.component'
;
import
{
WebsiteComponent
}
from
'./modal/website/website.component'
;
import
{
WebsiteComponent
}
from
'./modal/website/website.component'
;
import
{
NetworkDetailComponent
}
from
'./overAll/network-check/network-detail/network-detail.component'
;
import
{
NetworkDetailComponent
}
from
'./overAll/network-check/network-detail/network-detail.component'
;
import
{
FindUserComponent
}
from
'./alarm/modal/find-user/find-user.component'
;
@
NgModule
({
@
NgModule
({
imports
:
[
imports
:
[
...
@@ -125,6 +126,7 @@ import {NetworkDetailComponent} from './overAll/network-check/network-detail/net
...
@@ -125,6 +126,7 @@ import {NetworkDetailComponent} from './overAll/network-check/network-detail/net
WorkHandleComponent
,
WorkHandleComponent
,
WebsiteComponent
,
WebsiteComponent
,
NetworkDetailComponent
,
NetworkDetailComponent
,
FindUserComponent
],
],
providers
:[
providers
:[
OverAllService
,
OverAllService
,
...
...
src/main/webapp/app/modal/alarm-modal/alarm-modal.component.html
View file @
a75ad9c1
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"host"
>
告警名称
</nz-form-label>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"host"
>
告警名称
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"host"
type=
"text"
nz-input
name=
"host"
>
<input
id=
"host"
type=
"text"
nz-input
name=
"host"
[(
ngModel
)]="
validateForm
.
name
"
>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,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-select
name=
"serviceid"
nzPlaceHolder=
"告警分组"
>
<nz-select
name=
"serviceid"
nzPlaceHolder=
"告警分组"
[(
ngModel
)]="
validateForm
.
alertGroupId
"
>
<nz-option
nzValue=
""
nzLabel=
"无"
></nz-option>
<nz-option
nzValue=
""
nzLabel=
"无"
></nz-option>
</nz-select>
</nz-select>
</nz-form-control>
</nz-form-control>
...
@@ -174,7 +174,8 @@
...
@@ -174,7 +174,8 @@
<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
"
>
<button
nz-button
nzType=
"primary"
>
选择
</button>
<button
(
click
)="
showUserModa
()"
nz-button
nzType=
"primary"
>
选择
</button>
<span>
{{userObj.alias}}
</span>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
...
@@ -215,3 +216,6 @@
...
@@ -215,3 +216,6 @@
</nz-tab>
</nz-tab>
</nz-tabset>
</nz-tabset>
</nz-modal>
</nz-modal>
<!--选择对象-->
<smart-find-user
#
smartFindUser
(
set
)="
getUser
($
event
)"
></smart-find-user>
\ No newline at end of file
src/main/webapp/app/modal/alarm-modal/alarm-modal.component.ts
View file @
a75ad9c1
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
AlarmService
}
from
'../../alarm/alarm.service'
;
import
{
FindUserComponent
}
from
'../../alarm/modal/find-user/find-user.component'
;
@
Component
({
@
Component
({
selector
:
'smart-alarm-modal'
,
selector
:
'smart-alarm-modal'
,
templateUrl
:
'./alarm-modal.component.html'
,
templateUrl
:
'./alarm-modal.component.html'
,
styles
:
[]
styles
:
[]
})
})
export
class
AlarmModalComponent
implements
OnInit
{
export
class
AlarmModalComponent
implements
OnInit
{
@
ViewChild
(
'smartFindUser'
)
smartFindUser
:
FindUserComponent
;
modalTitle
=
'添加告警'
;
modalTitle
=
'添加告警'
;
tabNum
=
0
;
tabNum
=
0
;
isShow
=
false
;
isShow
=
false
;
sendOption
=
[
sendOption
=
[];
{
label
:
'邮件'
,
value
:
'Apple'
,
checked
:
false
},
userObj
;
{
label
:
'短信'
,
value
:
'Pear'
,
checked
:
false
},
{
label
:
'微信'
,
value
:
'Orange'
,
checked
:
false
}
];
validateForm
;
validateForm
;
constructor
()
{
}
ngOnInit
()
{
constructor
(
private
alarmSer
:
AlarmService
)
{
this
.
validateForm
=
{
}
name
:
null
,
alertGroupId
:
null
,
ngOnInit
()
{
this
.
initForm
();
this
.
getSendFun
();
}
};
//初始化
}
initForm
()
{
this
.
validateForm
=
{
name
:
null
,
alertGroupId
:
null
,
};
}
//获取发送方式
getSendFun
()
{
this
.
alarmSer
.
mediaTypeFind
({}).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
sendOption
=
res
.
data
;
this
.
sendOption
.
forEach
(
res
=>
{
res
.
label
=
res
.
description
;
res
.
value
=
res
.
mediatypeid
;
res
.
checked
=
false
;
});
}
}
);
}
showModal
(
data
){
//选择对象
this
.
isShow
=
true
;
showUserModa
(){
}
this
.
smartFindUser
.
showModal
();
}
//获取对象
getUser
(
data
)
{
this
.
userObj
=
data
;
console
.
log
(
data
);
}
showModal
(
data
)
{
this
.
isShow
=
true
;
}
handleEditCancel
(){
handleEditCancel
()
{
this
.
isShow
=
false
;
this
.
isShow
=
false
;
}
}
tabsChange
(
index
){
tabsChange
(
index
)
{
this
.
tabNum
=
index
;
this
.
tabNum
=
index
;
}
}
handEditleOk
(){
handEditleOk
()
{
this
.
isShow
=
false
;
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