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
71b0c734
Commit
71b0c734
authored
Dec 10, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f1f6d9b7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
18 deletions
+27
-18
basi-check.component.ts
src/main/webapp/app/modal/basi-check/basi-check.component.ts
+20
-11
basic.component.html
src/main/webapp/app/overAll/basic/basic.component.html
+3
-3
basic.component.ts
src/main/webapp/app/overAll/basic/basic.component.ts
+2
-2
overAll.service.ts
src/main/webapp/app/overAll/overAll.service.ts
+2
-2
No files found.
src/main/webapp/app/modal/basi-check/basi-check.component.ts
View file @
71b0c734
...
...
@@ -35,6 +35,7 @@ export class BasiCheckComponent implements OnInit {
title
;
isCheck
=
false
;
hostId
;
//主机ID
hostName
;
//主机name
itemId
;
//监控项id
interfaceList
:
any
[];
validateForm
:
FormGroup
;
...
...
@@ -66,13 +67,13 @@ export class BasiCheckComponent implements OnInit {
}
ngOnInit
()
{
this
.
tabNum
=
0
;
this
.
initForm
();
}
initForm
(){
this
.
tabNum
=
0
;
this
.
validateForm
=
this
.
fb
.
group
({
hostid
:[
null
],
hostid
:[
this
.
hostId
],
name
:[
null
,[
Validators
.
required
]],
interfaceid
:[
null
,[
Validators
.
required
]],
key_
:[
null
,[
Validators
.
required
]],
...
...
@@ -93,10 +94,11 @@ export class BasiCheckComponent implements OnInit {
}
//新增
showAddModal
(
hostId
){
showAddModal
(
hostId
,
hostName
){
this
.
title
=
'添加监测点'
;
this
.
isCheck
=
true
;
this
.
hostId
=
hostId
;
this
.
hostName
=
hostName
;
//主机接口
this
.
overAllSer
.
findDetailed
(
this
.
hostId
).
subscribe
(
(
res
)
=>
{
...
...
@@ -157,6 +159,7 @@ export class BasiCheckComponent implements OnInit {
return
false
;
}
this
.
validateForm
.
value
.
applicationids
=
[
this
.
validateForm
.
value
.
applicationids
];
this
.
validateForm
.
value
.
hostid
=
this
.
hostId
;
if
(
this
.
title
==
"添加监测点"
){
this
.
create
();
}
...
...
@@ -225,10 +228,10 @@ export class BasiCheckComponent implements OnInit {
this
.
overAllSer
.
createItemType
(
obj
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
info
(
'添加成功'
);
this
.
message
.
success
(
'添加成功'
);
this
.
getItemType
();
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
this
.
message
.
error
(
res
.
errMsg
);
}
}
);
...
...
@@ -271,17 +274,17 @@ export class BasiCheckComponent implements OnInit {
}
//阈值--start
save
(){
save
Trigger
(){
const
data
=
{
condition
:
''
,
faultCondition
:
''
};
if
(
this
.
conditionType
==
'commonly'
)
{
//常规
this
.
conditionList
.
forEach
(
res
=>
{
data
.
condition
+=
'{'
+
this
.
validateForm
.
value
.
n
ame
+
':'
+
this
.
validateForm
.
value
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
data
.
condition
+=
'{'
+
this
.
hostN
ame
+
':'
+
this
.
validateForm
.
value
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
});
this
.
faultConditionList
.
forEach
(
res
=>
{
data
.
faultCondition
+=
'{'
+
this
.
validateForm
.
value
.
n
ame
+
':'
+
this
.
validateForm
.
value
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
data
.
faultCondition
+=
'{'
+
this
.
hostN
ame
+
':'
+
this
.
validateForm
.
value
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
});
}
else
{
//高级
data
.
condition
=
this
.
validateForm
.
value
.
condition_high
;
...
...
@@ -301,9 +304,15 @@ export class BasiCheckComponent implements OnInit {
faultCondition
:
data
.
faultCondition
,
condition
:
data
.
condition
};
this
.
overAllSer
.
createTrigger
(
res
).
subscribe
(
res
=>
{
})
this
.
overAllSer
.
createTrigger
(
res
).
subscribe
(
(
response
)
=>
{
if
(
response
.
errCode
==
10000
){
this
.
message
.
success
(
"创建阈值成功"
);
}
else
{
this
.
message
.
error
(
response
.
errMsg
);
}
}
)
}
//2.修改阈值
...
...
src/main/webapp/app/overAll/basic/basic.component.html
View file @
71b0c734
...
...
@@ -164,7 +164,7 @@
<span
(
click
)="
showBasicEditModal
(
item
)"
>
添加资源
</span>
</ng-container>
<ng-container
*
ngIf=
"item.level"
>
<span
(
click
)="
showBasicCheckModal
(
item
.
hostid
)"
>
添加监测点
</span>
<span
(
click
)="
showBasicCheckModal
(
item
.
hostid
,
item
.
host
)"
>
添加监测点
</span>
<span
(
click
)="
editBasicModal
(
item
)"
>
编辑
</span>
<span
(
click
)="
showDeleteConfirm
(
item
)"
>
删除
</span>
<nz-dropdown
[
nzTrigger
]="'
click
'"
class=
"table-dropdown"
>
...
...
@@ -265,7 +265,7 @@
<span
(
click
)="
showDeleteGroupConfirm
(
item
)"
>
删除
</span>
</ng-container>
<ng-container
*
ngIf=
"item.level"
>
<span
(
click
)="
showBasicCheckModal
(
item
.
hostid
)"
>
添加监测点
</span>
<span
(
click
)="
showBasicCheckModal
(
item
.
hostid
,
item
.
host
)"
>
添加监测点
</span>
<span
(
click
)="
editBasicModal
(
item
)"
>
编辑
</span>
<span
(
click
)="
showDeleteConfirm
(
item
)"
>
删除
</span>
<nz-dropdown
[
nzTrigger
]="'
click
'"
class=
"table-dropdown"
>
...
...
@@ -353,7 +353,7 @@
</ng-container>
</td>
<td
class=
"handle"
>
<span
(
click
)="
showBasicCheckModal
(
item
.
hostid
)"
>
添加监测点
</span>
<span
(
click
)="
showBasicCheckModal
(
item
.
hostid
,
item
.
host
)"
>
添加监测点
</span>
<span
(
click
)="
editBasicModal
(
item
)"
>
编辑
</span>
<span
(
click
)="
showDeleteConfirm
(
item
)"
>
删除
</span>
<nz-dropdown
[
nzTrigger
]="'
click
'"
class=
"table-dropdown"
>
...
...
src/main/webapp/app/overAll/basic/basic.component.ts
View file @
71b0c734
...
...
@@ -207,8 +207,8 @@ export class BasicComponent implements OnInit {
}
//添加监测点
showBasicCheckModal
(
hostid
)
{
this
.
smartCheck
.
showAddModal
(
hostid
);
showBasicCheckModal
(
hostid
,
host
)
{
this
.
smartCheck
.
showAddModal
(
hostid
,
host
);
}
//列表
...
...
src/main/webapp/app/overAll/overAll.service.ts
View file @
71b0c734
...
...
@@ -300,12 +300,12 @@ export class OverAllService {
}
//创建触发器
createTrigger
(
data
){
createTrigger
(
data
)
:
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/createItemTrigger'
,
data
);
}
//修改触发器
updateTrigger
(
data
){
updateTrigger
(
data
)
:
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/updateItemTrigger'
,
data
);
}
...
...
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