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
fa91c547
Commit
fa91c547
authored
Jan 09, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构 jtopo
parent
f24db4a4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
33 deletions
+96
-33
alarm-modal.component.html
...n/webapp/app/modal/alarm-modal/alarm-modal.component.html
+37
-25
alarm-modal.component.ts
...ain/webapp/app/modal/alarm-modal/alarm-modal.component.ts
+48
-1
basi-check.component.html
...ain/webapp/app/modal/basi-check/basi-check.component.html
+5
-5
ne-topology.component.ts
...bapp/app/netTopology/ne-topology/ne-topology.component.ts
+6
-2
No files found.
src/main/webapp/app/modal/alarm-modal/alarm-modal.component.html
View file @
fa91c547
...
...
@@ -139,33 +139,43 @@
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<
!--<nz-form-item>--
>
<
!--<nz-form-label [nzSpan]="4" nzFor="serviceid">生成事件</nz-form-label>--
>
<
!--<nz-form-control [nzSpan]="14">--
>
<
!--<nz-radio-group>--
>
<
!--<label nz-radio nzValue="1">是</label>--
>
<
!--<label nz-radio nzValue="2">否</label>--
>
<
!--</nz-radio-group>--
>
<
!--</nz-form-control>--
>
<
!--</nz-form-item>--
>
<
nz-form-item
>
<
nz-form-label
[
nzSpan
]="
4
"
nzFor=
"serviceid"
>
生成事件
</nz-form-label
>
<
nz-form-control
[
nzSpan
]="
14
"
>
<
nz-radio-group
>
<
label
nz-radio
nzValue=
"1"
>
是
</label
>
<
label
nz-radio
nzValue=
"2"
>
否
</label
>
<
/nz-radio-group
>
<
/nz-form-control
>
<
/nz-form-item
>
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="4" nzFor="serviceid">事件分类</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-select name="serviceid" nzPlaceHolder="事件分类">-->
<!--<nz-option nzValue="" nzLabel="无"></nz-option>-->
<!--</nz-select>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"serviceid"
>
事件分类
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"serviceid"
nzPlaceHolder=
"事件分类"
[(
ngModel
)]="
validateForm
.
event
.
eventTypeId
"
>
<ng-container
*
ngFor=
"let item of eventTypeList"
>
<nz-option
[
nzLabel
]="
item
.
name
"
[
nzValue
]="
item
.
id
"
></nz-option>
</ng-container>
</nz-select>
</nz-form-control>
</nz-form-item>
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="4" nzFor="serviceid">事件负责人</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<nz-select name="serviceid" nzPlaceHolder="事件负责人">-->
<!--<nz-option nzValue="" nzLabel="无"></nz-option>-->
<!--</nz-select>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzFor=
"serviceid"
>
事件负责人
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<button
(
click
)="
selectPerson
()"
nz-button
><span>
选择
</span></button>
<ng-container
*
ngFor=
"let item of operatorList;let i = index;"
>
<span>
{{item.username}}
</span><span
(
click
)="
delete
(
i
)"
>
X
</span>
</ng-container>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"serviceid"
>
详细描述
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<textarea
nz-input
nzPlaceholder=
"事件描述"
[
nzAutosize
]="{
minRows:
4
,
maxRows:
4
}"
[(
ngModel
)]="
validateForm
.
event
.
description
"
></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div
class=
"modal-footer-btn"
>
<button
nz-button
(
click
)="
handleEditCancel
()"
nzType=
"primary"
>
取消
</button>
...
...
@@ -241,3 +251,5 @@
</nz-tab>
</nz-tabset>
</nz-modal>
<!--选择负责人-->
<smart-select-person
#
smartSelectPerson
(
done
)="
getUser
($
event
)"
></smart-select-person>
src/main/webapp/app/modal/alarm-modal/alarm-modal.component.ts
View file @
fa91c547
...
...
@@ -3,6 +3,8 @@ import {AlarmService} from '../../alarm/alarm.service';
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'
;
import
{
SelectPersonComponent
}
from
'../select-person/select-person.component'
;
import
{
WorkService
}
from
'../../work/work.service'
;
@
Component
({
selector
:
'smart-alarm-modal'
,
...
...
@@ -20,6 +22,7 @@ import {OverAllService} from '../../overAll/overAll.service';
})
export
class
AlarmModalComponent
implements
OnInit
{
@
ViewChild
(
'smartFindUser'
)
smartFindUser
:
FindUserComponent
;
@
ViewChild
(
'smartSelectPerson'
)
smartSelectPerson
:
SelectPersonComponent
;
@
ViewChild
(
'nzTree'
)
nzTree
:
NzTreeComponent
;
@
Output
()
done
=
new
EventEmitter
<
any
>
();
...
...
@@ -39,8 +42,11 @@ export class AlarmModalComponent implements OnInit {
selectModal
=
false
;
sendInfoList
=
[];
//发送方式
eventTypeList
;
//事件分类列表
operatorList
=
[];
//负责人列表
constructor
(
private
alarmSer
:
AlarmService
,
private
message
:
NzMessageService
,
private
overAllSer
:
OverAllService
)
{
private
overAllSer
:
OverAllService
,
private
workSer
:
WorkService
,
)
{
}
ngOnInit
()
{
...
...
@@ -49,6 +55,7 @@ export class AlarmModalComponent implements OnInit {
this
.
getACtion
();
this
.
getGroup
();
this
.
getZabbixObj
();
this
.
getEventType
();
}
//初始化
...
...
@@ -65,9 +72,26 @@ export class AlarmModalComponent implements OnInit {
r_longdata
:
null
,
r_shortdata
:
null
,
sendInfos
:
null
,
event
:{
eventTypeId
:
null
,
//事件分类id
operators
:
null
,
//事件负责人
description
:
null
,
//事件描述
}
};
}
//获取事件分类
getEventType
()
{
const
data
=
{
type
:
0
};
this
.
workSer
.
findParamsByType
(
data
).
subscribe
(
(
res
)
=>
{
this
.
eventTypeList
=
res
.
data
;
}
);
}
//获取告警目标
getACtion
()
{
this
.
overAllSer
.
findGroup
().
subscribe
(
...
...
@@ -213,6 +237,24 @@ export class AlarmModalComponent implements OnInit {
this
.
tabNum
=
index
;
}
//选择处理人弹窗
selectPerson
(){
this
.
smartSelectPerson
.
showModal
(
"选择事件负责人"
,
null
);
}
//选择事件负责人done
getUser
(
e
){
const
arr
=
[];
e
.
forEach
(
res
=>
{
const
data
=
{
username
:
res
.
name
,
userId
:
res
.
id
};
arr
.
push
(
data
);
});
this
.
operatorList
=
arr
;
}
//保存
handEditleOk
()
{
...
...
@@ -239,6 +281,11 @@ export class AlarmModalComponent implements OnInit {
def_longdata
:
this
.
validateForm
.
def_longdata
,
r_longdata
:
this
.
validateForm
.
r_longdata
,
r_shortdata
:
this
.
validateForm
.
r_shortdata
,
event
:{
eventTypeId
:
this
.
validateForm
.
event
.
eventTypeId
,
//事件分类id
operators
:
this
.
operatorList
,
//事件负责人
description
:
this
.
validateForm
.
event
.
description
,
//事件描述
}
};
if
(
this
.
title
==
'添加告警'
){
...
...
src/main/webapp/app/modal/basi-check/basi-check.component.html
View file @
fa91c547
...
...
@@ -73,11 +73,11 @@
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"value_type"
>
信息类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"value_type"
formControlName=
"value_type"
nzPlaceHolder=
"请选择信息类型"
>
<nz-option
nzValue=
"
1"
nzLabel=
"数字
"
></nz-option>
<nz-option
nzValue=
"
2"
nzLabel=
"浮点数
"
></nz-option>
<nz-option
nzValue=
"
3"
nzLabel=
"字符
"
></nz-option>
<nz-option
nzValue=
"
4"
nzLabel=
"日志
"
></nz-option>
<nz-option
nzValue=
"
5
"
nzLabel=
"文本"
></nz-option>
<nz-option
nzValue=
"
0"
nzLabel=
"浮点数
"
></nz-option>
<nz-option
nzValue=
"
1"
nzLabel=
"字符
"
></nz-option>
<nz-option
nzValue=
"
2"
nzLabel=
"日志
"
></nz-option>
<nz-option
nzValue=
"
3"
nzLabel=
"整数
"
></nz-option>
<nz-option
nzValue=
"
4
"
nzLabel=
"文本"
></nz-option>
</nz-select>
<nz-form-explain
*
ngIf=
"validateForm.get('value_type').dirty && validateForm.get('value_type').errors"
>
请选择信息类型!
</nz-form-explain>
</nz-form-control>
...
...
src/main/webapp/app/netTopology/ne-topology/ne-topology.component.ts
View file @
fa91c547
...
...
@@ -278,7 +278,7 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
const
arr
=
topologyJson
.
childs
[
0
].
childs
;
const
list
=
[];
arr
.
forEach
(
e
=>
{
if
(
e
.
elementType
==
'link'
){
if
(
e
.
elementType
==
'link'
&&
e
.
itemId
&&
e
.
itemId
.
length
>
0
){
const
data
=
{
itemIdIn
:
e
.
itemId
.
split
(
','
)[
0
],
itemIdOut
:
e
.
itemId
.
split
(
','
)[
1
],
...
...
@@ -287,9 +287,10 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
list
.
push
(
data
);
}
});
if
(
list
.
length
>
0
){
//有流量监控-->查询流量监控
const
data
=
{
"list"
:
list
}
};
this
.
topologySer
.
findFlow
(
data
).
subscribe
(
(
res
)
=>
{
const
response
=
res
.
data
;
...
...
@@ -303,6 +304,9 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
editor
.
loadTopologyByJson
(
topologyJson
,
'img/backimg.png'
);
}
)
}
else
{
//无流量监控
editor
.
loadTopologyByJson
(
topologyJson
,
'img/backimg.png'
);
}
}
//查询监控点状态
...
...
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