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
2c246503
Commit
2c246503
authored
Jan 11, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
template
parent
d43ca8df
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
96 deletions
+82
-96
alarm-modal.component.html
...n/webapp/app/modal/alarm-modal/alarm-modal.component.html
+0
-7
alarm-modal.component.ts
...ain/webapp/app/modal/alarm-modal/alarm-modal.component.ts
+1
-2
check-list.component.ts
...p/app/overAll/template/check-list/check-list.component.ts
+2
-2
check-prototype.component.html
...late/modal/check-prototype/check-prototype.component.html
+25
-18
check-prototype.component.ts
...mplate/modal/check-prototype/check-prototype.component.ts
+54
-67
No files found.
src/main/webapp/app/modal/alarm-modal/alarm-modal.component.html
View file @
2c246503
...
...
@@ -229,13 +229,6 @@
<ng-container
*
ngIf=
"selectModal"
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"serviceid"
>
恢复主题
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"host4"
type=
"text"
nz-input
name=
"host1"
[(
ngModel
)]="
validateForm
.
r_shortdata
"
>
</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
.
r_longdata
"
></textarea>
...
...
src/main/webapp/app/modal/alarm-modal/alarm-modal.component.ts
View file @
2c246503
...
...
@@ -69,8 +69,7 @@ export class AlarmModalComponent implements OnInit {
serious
:
0
,
mediaTypeIds
:[],
def_longdata
:
null
,
r_longdata
:
null
,
r_shortdata
:
''
+
r_longdata
:
''
+
'问题 {TRIGGER.NAME} 恢复于: {EVENT.TIME} {EVENT.DATE}
\
n'
+
'主机: {HOST.NAME}
\
n'
+
'严重程度: {TRIGGER.SEVERITY}
\
n'
+
...
...
src/main/webapp/app/overAll/template/check-list/check-list.component.ts
View file @
2c246503
...
...
@@ -91,12 +91,12 @@ export class CheckListComponent implements OnInit {
//新增监控项原型
showAddModal
(){
this
.
smartCheckProtoType
.
showAddModal
(
this
.
hostId
,
this
.
tempName
,
"添加监控项原型"
)
this
.
smartCheckProtoType
.
showAddModal
(
this
.
hostId
,
this
.
discoveryids
,
"添加监控项原型"
)
}
//编辑监控项原型
showEditModal
(
data
){
this
.
smartCheckProtoType
.
showEditModal
(
this
.
hostId
,
data
.
id
,
this
.
tempName
,
"编辑监控项原型"
)
this
.
smartCheckProtoType
.
showEditModal
(
this
.
hostId
,
this
.
discoveryids
,
data
.
itemid
,
"编辑监控项原型"
)
}
//单个删除
...
...
src/main/webapp/app/overAll/template/modal/check-prototype/check-prototype.component.html
View file @
2c246503
...
...
@@ -38,7 +38,7 @@
validateForm.value.type == '4' || validateForm.value.type == '6' || validateForm.value.type == '10' || validateForm.value.type == '12' ||
validateForm.value.type == '13' || validateForm.value.type == '14' || validateForm.value.type == '16' || validateForm.value.type == '17'"
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nz
Required
nz
For=
"interfaceid"
>
主机接口
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"interfaceid"
>
主机接口
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"interfaceid"
formControlName=
"interfaceid"
nzPlaceHolder=
"选择主机接口"
>
<nz-option
*
ngFor=
"let item of interfaceList"
nzValue=
"{{item.interfaceid}}"
...
...
@@ -49,23 +49,23 @@
</nz-form-item>
</ng-container>
</ng-container>
<
ng-container
*
ngIf=
"validateForm.value.type == 1 || validateForm.value.type == 4 || validateForm.value.type == 6"
>
<
nz-form-item
>
<
nz-form-label
[
nzSpan
]="
6
"
nzFor=
"snmp_oid"
>
SNMP OID
</nz-form-label
>
<
nz-form-control
[
nzSpan
]="
14
"
>
<
input
id=
"snmp_oid"
name=
"snmp_oid"
type=
"text"
nz-input
formControlName=
"snmp_oid"
>
<!--
<nz-form-explain *ngIf="validateForm.get('note').dirty && validateForm.get('note').errors">Please input your username!</nz-form-explain>
-->
<
/nz-form-control
>
<
/nz-form-item
>
<
nz-form-item
>
<
nz-form-label
[
nzSpan
]="
6
"
nzFor=
"snmp_community"
>
SNMP community
</nz-form-label
>
<
nz-form-control
[
nzSpan
]="
14
"
>
<
input
id=
"snmp_community"
name=
"units"
type=
"text"
nz-input
formControlName=
"snmp_community"
>
<!--
<nz-form-explain *ngIf="validateForm.get('note').dirty && validateForm.get('note').errors">Please input your username!</nz-form-explain>
-->
<
/nz-form-control
>
<
/nz-form-item
>
<
/ng-container
>
<
!--<ng-container *ngIf="validateForm.value.type == 1 || validateForm.value.type == 4 || validateForm.value.type == 6">--
>
<
!--<nz-form-item>--
>
<
!--<nz-form-label [nzSpan]="6" nzFor="snmp_oid">SNMP OID</nz-form-label>--
>
<
!--<nz-form-control [nzSpan]="14">--
>
<
!--<input id="snmp_oid" name="snmp_oid" type="text" nz-input formControlName="snmp_oid">--
>
<!--
<!–<nz-form-explain *ngIf="validateForm.get('note').dirty && validateForm.get('note').errors">Please input your username!</nz-form-explain>–>
-->
<
!--</nz-form-control>--
>
<
!--</nz-form-item>--
>
<
!--<nz-form-item>--
>
<
!--<nz-form-label [nzSpan]="6" nzFor="snmp_community">SNMP community</nz-form-label>--
>
<
!--<nz-form-control [nzSpan]="14">--
>
<
!--<input id="snmp_community" name="units" type="text" nz-input-->
<!--formControlName="snmp_community">--
>
<!--
<!–<nz-form-explain *ngIf="validateForm.get('note').dirty && validateForm.get('note').errors">Please input your username!</nz-form-explain>–>
-->
<
!--</nz-form-control>--
>
<
!--</nz-form-item>--
>
<
!--</ng-container>--
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"key_"
>
键值
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
...
...
@@ -126,6 +126,13 @@
</nz-form-control>
</nz-form-item>
</form>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
已启用
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<label
name=
"status"
nz-checkbox
formControlName=
"status"
></label>
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
<!--键值查询-->
...
...
src/main/webapp/app/overAll/template/modal/check-prototype/check-prototype.component.ts
View file @
2c246503
...
...
@@ -6,9 +6,9 @@ import {NewTypeComponent} from '../../../../modal/new-type/new-type.component';
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
@
Component
({
selector
:
'smart-check-prototype'
,
templateUrl
:
'./check-prototype.component.html'
,
styles
:
[]
selector
:
'smart-check-prototype'
,
templateUrl
:
'./check-prototype.component.html'
,
styles
:
[]
})
export
class
CheckPrototypeComponent
implements
OnInit
{
...
...
@@ -21,7 +21,7 @@ export class CheckPrototypeComponent implements OnInit {
isInterface
=
true
;
//添加模版监测点的时候不需要主机接口
nzSize
=
'large'
;
hostId
;
//主机ID
hostName
;
//主机name
discoveryid
;
//自动发现id
itemId
;
//监控项id
interfaceList
:
any
[];
valueMapList
=
[];
...
...
@@ -30,11 +30,6 @@ export class CheckPrototypeComponent implements OnInit {
interval
;
//间隔时长
tabNum
:
number
;
triggerObj
=
{
condition
:
''
,
faultCondition
:
''
,
itemName
:
''
};
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
)
{
...
...
@@ -42,84 +37,72 @@ export class CheckPrototypeComponent implements OnInit {
ngOnInit
()
{
this
.
initForm
();
this
.
getValuemap
();
}
initForm
()
{
this
.
tabNum
=
0
;
this
.
validateForm
=
this
.
fb
.
group
({
hostid
:
[
this
.
hostId
],
name
:
[
null
,
[
Validators
.
required
]],
interfaceid
:
[
null
],
key_
:
[
null
,
[
Validators
.
required
]],
value_type
:
[
null
,
[
Validators
.
required
]],
hostid
:
[
null
],
ruleid
:
[
null
],
type
:
[
null
,
[
Validators
.
required
]],
value_type
:
[
null
,
[
Validators
.
required
]],
interfaceid
:
[
null
],
delay
:
[
null
,
[
Validators
.
required
]],
units
:
[
null
],
history
:
[
'3600'
],
trends
:
[
null
],
delay
:
[
null
,
[
Validators
.
required
]],
snmp_oid
:
[
'interfaces.ifTable.ifEntry.ifInOctets.1'
],
snmp_community
:
[
'public'
],
applications
:
[
null
],
status
:
[
null
],
// snmp_oid: ['interfaces.ifTable.ifEntry.ifInOctets.1'],
// snmp_community: ['public'],
});
this
.
triggerObj
=
{
condition
:
''
,
faultCondition
:
''
,
itemName
:
''
};
}
//新增
showAddModal
(
hostId
,
hostName
,
title
)
{
/**
* 新增监控项原型
* @param hostId 模版id
* @param discoveryid 自动发现id
* @param hostName 模版名称
* @param title 标题
*/
showAddModal
(
hostId
,
discoveryid
,
title
)
{
this
.
title
=
title
;
this
.
isCheck
=
true
;
this
.
hostId
=
hostId
;
this
.
hostName
=
hostName
;
if
(
this
.
title
==
'添加监测点'
){
//主机接口
this
.
overAllSer
.
findInterface
(
this
.
hostId
).
subscribe
(
(
res
)
=>
{
this
.
interfaceList
=
res
.
data
;
}
);
this
.
isInterface
=
true
;
}
if
(
this
.
title
==
'添加模版监测点'
){
this
.
isInterface
=
false
;
this
.
validateForm
.
get
(
'interfaceid'
).
clearValidators
();
}
this
.
overAllSer
.
findInterface
(
this
.
hostId
).
subscribe
(
(
res
)
=>
{
this
.
interfaceList
=
res
.
data
;
}
);
this
.
isInterface
=
true
;
this
.
getItemType
();
}
//映射值
getValuemap
()
{
// this.overAllSer.findValuemap().subscribe(
// (res) => {
// if (res.errCode == 10000) {
// this.valueMapList = res.data;
// } else {
// this.message.error(res.errMsg);
// }
// }
// );
}
//编辑
showEditModal
(
hostId
,
id
,
hostName
,
title
)
{
/**
*
* @param hostId 模版id
* @param discoveryid 自动发现id
* @param itemId 监控项id
* @param hostName 模版名称
* @param title 标题
*/
showEditModal
(
hostId
,
discoveryid
,
itemId
,
title
)
{
this
.
title
=
title
;
this
.
hostId
=
hostId
;
this
.
itemId
=
itemId
;
this
.
isCheck
=
true
;
this
.
itemId
=
id
;
this
.
hostName
=
hostName
;
this
.
overAllSer
.
findItemDetail
(
id
).
subscribe
(
this
.
discoveryid
=
discoveryid
;
this
.
overAllSer
.
findItemDetail
(
discoveryid
).
subscribe
(
(
res
)
=>
{
const
data
=
res
.
data
[
0
];
data
.
type
+=
''
;
data
.
interfaceid
+=
''
;
data
.
value_type
+=
''
;
if
(
data
.
applications
)
{
data
.
applications
=
data
.
applications
.
map
(
e
=>
{
if
(
data
.
applications
)
{
data
.
applications
=
data
.
applications
.
map
(
e
=>
{
return
e
.
applicationid
;
});
}
...
...
@@ -151,8 +134,8 @@ export class CheckPrototypeComponent implements OnInit {
//添加
handleCheckOk
()
{
const
list
=
[
'0'
,
'1'
,
'3'
,
'4'
,
'6'
,
'10'
,
'12'
,
'13'
,
'14'
,
'16'
,
'17'
];
if
(
list
.
indexOf
(
this
.
validateForm
.
value
.
type
)
>
-
1
)
{
const
list
=
[
'0'
,
'1'
,
'3'
,
'4'
,
'6'
,
'10'
,
'12'
,
'13'
,
'14'
,
'16'
,
'17'
];
if
(
list
.
indexOf
(
this
.
validateForm
.
value
.
type
)
>
-
1
)
{
this
.
validateForm
.
get
(
'type'
).
setValidators
(
Validators
.
required
);
}
for
(
let
i
in
this
.
validateForm
.
controls
)
{
...
...
@@ -163,21 +146,25 @@ export class CheckPrototypeComponent implements OnInit {
this
.
message
.
error
(
'请输入必填信息'
);
return
false
;
}
this
.
validateForm
.
value
.
applications
=
[
this
.
validateForm
.
value
.
applications
];
this
.
validateForm
.
value
.
hostid
=
this
.
hostId
;
if
(
this
.
title
==
'添加监测点原型'
)
{
this
.
validateForm
.
patchValue
({
applications
:
this
.
validateForm
.
value
.
applications
,
hostId
:
this
.
hostId
,
ruleid
:
this
.
discoveryid
,
status
:
this
.
validateForm
.
value
.
status
?
0
:
1
});
if
(
this
.
title
==
'添加监控项原型'
)
{
this
.
create
();
}
if
(
this
.
title
==
'编辑监
测点
原型'
)
{
if
(
this
.
title
==
'编辑监
控项
原型'
)
{
this
.
update
();
}
}
create
()
{
this
.
overAllSer
.
create
(
this
.
validateForm
.
value
).
subscribe
(
this
.
overAllSer
.
create
ItemPrototype
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'创建监
测点
成功'
);
this
.
message
.
success
(
'创建监
控项原型
成功'
);
this
.
done
.
emit
();
this
.
tabNum
=
1
;
this
.
isCheck
=
false
;
...
...
@@ -194,10 +181,10 @@ export class CheckPrototypeComponent implements OnInit {
//修改监控项
update
()
{
this
.
validateForm
.
addControl
(
'itemid'
,
new
FormControl
(
this
.
itemId
));
this
.
overAllSer
.
itemUpdata
(
this
.
validateForm
.
value
).
subscribe
(
this
.
overAllSer
.
updateItemPrototype
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'修改监
测点
成功'
);
this
.
message
.
success
(
'修改监
控项原型
成功'
);
this
.
done
.
emit
();
this
.
tabNum
=
1
;
this
.
isCheck
=
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