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
81279855
Commit
81279855
authored
Jan 14, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
监控项
parent
c0063fd5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
81 additions
and
57 deletions
+81
-57
overAll.service.ts
src/main/webapp/app/overAll/overAll.service.ts
+20
-0
item-list.component.ts
...pp/overAll/template/list/item-list/item-list.component.ts
+2
-1
tri-list.component.html
...pp/overAll/template/list/tri-list/tri-list.component.html
+12
-12
tri-list.component.ts
.../app/overAll/template/list/tri-list/tri-list.component.ts
+24
-35
tri-modal.component.html
.../overAll/template/list/tri-modal/tri-modal.component.html
+9
-2
tri-modal.component.ts
...pp/overAll/template/list/tri-modal/tri-modal.component.ts
+13
-6
trigger-list.component.html
...overAll/template/trigger-list/trigger-list.component.html
+1
-1
No files found.
src/main/webapp/app/overAll/overAll.service.ts
View file @
81279855
...
...
@@ -413,4 +413,24 @@ export class OverAllService {
findItemById
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/itemprototype/find/'
+
params
);
}
//创建触发器
createTri
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/trigger/create'
,
data
);
}
//修改触发器
updateTri
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/trigger/update'
,
data
);
}
//查询触发器
findTri
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/trigger/findTrigger'
,
data
);
}
//删除触发器
deleteTri
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/trigger/delete'
,
data
);
}
}
src/main/webapp/app/overAll/template/list/item-list/item-list.component.ts
View file @
81279855
...
...
@@ -6,6 +6,7 @@ import {CheckPrototypeComponent} from '../../modal/check-prototype/check-prototy
import
{
SystemService
}
from
'../../../../system/system.service'
;
import
{
CommonService
}
from
'../../../../shared/common/common.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
TriModalComponent
}
from
'../tri-modal/tri-modal.component'
;
@
Component
({
selector
:
'smart-item-list'
,
...
...
@@ -37,7 +38,7 @@ import {NzMessageService} from 'ng-zorro-antd';
]
})
export
class
ItemListComponent
implements
OnInit
{
@
ViewChild
(
'smart
CheckProtoType'
)
smartCheckProtoType
:
CheckPrototype
Component
;
@
ViewChild
(
'smart
TriModal'
)
smartTriModal
:
TriModal
Component
;
tempName
;
disName
;
...
...
src/main/webapp/app/overAll/template/list/tri-list/tri-list.component.html
View file @
81279855
...
...
@@ -14,9 +14,6 @@
<nz-breadcrumb-item>
模版:{{tempName}}
</nz-breadcrumb-item>
<nz-breadcrumb-item>
自动发现:{{disName}}
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
<div
nz-col
nzSpan=
"8"
class=
"text-right"
>
...
...
@@ -26,15 +23,19 @@
</div>
<div
nz-row
[
nzGutter
]="
4
"
class=
"search-form"
>
<div
nz-col
nzSpan=
"3"
>
<button
(
click
)="
showAddModal
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus-circle-o"
></i>
添加阈值
原型
</button>
<button
(
click
)="
showAddModal
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus-circle-o"
></i>
添加阈值
</button>
</div>
<div
nz-col
nzSpan=
"18"
></div>
<div
nz-col
nzSpan=
"3"
>
<div
nz-col
nzSpan=
"15"
>
<button
(
click
)="
deleteBatchTrigger
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-close-circle-o"
></i>
批量删除
</button>
</div>
<div
nz-col
nzSpan=
"6"
>
<input
(
keyup
.
enter
)="
getList
()"
style=
"width: 200px;"
type=
"text"
nz-input
[(
ngModel
)]="
queryName
"
placeholder=
"输入阈值名称"
>
<button
(
click
)="
getList
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-search"
style=
"color: #6097b7"
></i>
搜索
</button>
</div>
</div>
<nz-table
#
nzTable
[
nzData
]="
triggerList
"
[
nz
FrontPagination
]="
false
"
[
nzTotal
]="
totalNum
"
[
nzPageIndex
]="
pageNum
"
[
nzPageSize
]="
pageCount
"
(
nzPageIndexChange
)="
change
($
event
)"
[
nz
Loading
]="
loading
"
>
<nz-table
#
nzTable
[
nzData
]="
triggerList
"
[
nzLoading
]="
loading
"
>
<thead>
<tr>
<th
nzShowCheckbox
[
nzIndeterminate
]="
indeterminate
"
[
nzChecked
]="
allChecked
"
...
...
@@ -47,12 +48,12 @@
</thead>
<tbody>
<tr
*
ngFor=
"let data of triggerList"
>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
selectItem
(
data
,$
event
)"
></td>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
refreshStatus
(
)"
></td>
<td
class=
"round-tag tag-form"
>
<nz-tag
*
ngIf=
"data.priority == 4 || data.priority == 5"
[
nzColor
]="
color
.
red
"
></nz-tag>
<nz-tag
*
ngIf=
"data.priority == 2 || data.priority == 3"
[
nzColor
]="
color
.
yellow
"
></nz-tag>
</td>
<td>
{{data.
comments
}}
</td>
<td>
{{data.
description
}}
</td>
<td>
{{data.expression}}
</td>
<td
class=
"cursor main-color"
>
<span
(
click
)="
showEditModal
(
data
)"
>
编辑
</span>
...
...
@@ -61,5 +62,5 @@
</tr>
</tbody>
</nz-table>
<!--触发器原型-->
<smart-trigger-prototype
#
smartTriggerPrototype
(
done
)="
getList
()"
></smart-trigger-prototype>
\ No newline at end of file
<!--阈值-->
<smart-tri-modal
#
smartTriModal
(
done
)="
getList
()"
></smart-tri-modal>
src/main/webapp/app/overAll/template/list/tri-list/tri-list.component.ts
View file @
81279855
...
...
@@ -6,6 +6,7 @@ import {TriggerPrototypeComponent} from '../../modal/trigger-prototype/trigger-p
import
{
SystemService
}
from
'../../../../system/system.service'
;
import
{
CommonService
}
from
'../../../../shared/common/common.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
TriModalComponent
}
from
'../tri-modal/tri-modal.component'
;
@
Component
({
selector
:
'smart-tri-list'
,
...
...
@@ -13,11 +14,11 @@ import {NzMessageService} from 'ng-zorro-antd';
styles
:
[]
})
export
class
TriListComponent
implements
OnInit
{
@
ViewChild
(
'smartTri
ggerPrototype'
)
smartTriggerPrototype
:
TriggerPrototype
Component
;
@
ViewChild
(
'smartTri
Modal'
)
smartTriModal
:
TriModal
Component
;
tempName
;
disName
;
hostI
d
;
discoveryids
;
templatei
d
;
queryName
;
color
=
color
;
loading
=
false
;
...
...
@@ -36,9 +37,8 @@ export class TriListComponent implements OnInit {
private
commonSer
:
CommonService
)
{
this
.
routerInfo
.
queryParams
.
subscribe
(
(
res
)
=>
{
this
.
discoveryids
=
res
.
id
;
this
.
tempName
=
res
.
name
;
this
.
hostId
=
res
.
hostI
d
;
this
.
templateid
=
res
.
templatei
d
;
}
);
}
...
...
@@ -52,19 +52,6 @@ export class TriListComponent implements OnInit {
this
.
triggerList
=
$event
;
}
selectItem
(
item
,
e
)
{
if
(
e
)
{
this
.
selectList
.
push
(
item
);
}
else
{
this
.
selectList
.
forEach
((
value
,
index
)
=>
{
if
(
value
.
id
==
item
.
id
)
{
this
.
selectList
.
splice
(
index
,
1
);
}
});
}
this
.
refreshStatus
();
}
refreshStatus
():
void
{
const
allChecked
=
this
.
triggerList
.
every
(
value
=>
value
.
checked
===
true
);
const
allUnChecked
=
this
.
triggerList
.
every
(
value
=>
!
value
.
checked
);
...
...
@@ -85,35 +72,33 @@ export class TriListComponent implements OnInit {
getList
()
{
this
.
loading
=
true
;
const
data
=
{
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageCount
,
discoveryids
:
[
this
.
discoveryids
]
queryName
:
this
.
queryName
,
templateids
:
[
this
.
templateid
]
};
this
.
overAllSer
.
find
PageTrigger
(
data
).
subscribe
(
this
.
overAllSer
.
find
Tri
(
data
).
subscribe
(
(
res
)
=>
{
this
.
triggerList
=
res
.
data
.
data
;
this
.
totalNum
=
res
.
data
.
totalNum
;
this
.
triggerList
=
res
.
data
;
this
.
loading
=
false
;
}
);
}
showAddModal
()
{
this
.
smartTri
ggerPrototype
.
showAddModal
(
'新增阈值原型
'
,
this
.
tempName
);
this
.
smartTri
Modal
.
showAddModal
(
'新增阈值
'
,
this
.
tempName
);
}
showEditModal
(
data
)
{
this
.
smartTri
ggerPrototype
.
showEditModal
(
'编辑阈值原型
'
,
data
.
triggerid
,
this
.
tempName
);
this
.
smartTri
Modal
.
showEditModal
(
'编辑阈值
'
,
data
.
triggerid
,
this
.
tempName
);
}
//单个删除
deleteTrigger
(
item
)
{
this
.
commonSer
.
confirmThing
(
'删除'
,
'确定删除当前的阈值
原型
'
,
()
=>
{
this
.
commonSer
.
confirmThing
(
'删除'
,
'确定删除当前的阈值'
,
()
=>
{
const
data
=
{
ids
:
[]
};
data
.
ids
.
push
(
item
.
triggerid
);
this
.
overAllSer
.
deleteTri
gger
(
data
).
subscribe
(
this
.
overAllSer
.
deleteTri
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'删除成功'
);
...
...
@@ -128,17 +113,21 @@ export class TriListComponent implements OnInit {
//批量删除
deleteBatchTrigger
()
{
if
(
this
.
selectList
.
length
==
0
)
{
this
.
message
.
warning
(
'请选择需要删除的阈值原型'
);
let
arr
=
[];
this
.
triggerList
.
forEach
(
e
=>
{
if
(
e
.
checked
)
{
arr
.
push
(
e
.
triggerid
);
}
});
if
(
arr
.
length
==
0
)
{
this
.
message
.
warning
(
'请选择需要删除的阈值'
);
return
false
;
}
this
.
commonSer
.
confirmThing
(
'删除'
,
'确定删除选择的阈值
原型
'
,
()
=>
{
this
.
commonSer
.
confirmThing
(
'删除'
,
'确定删除选择的阈值'
,
()
=>
{
const
data
=
{
ids
:
this
.
selectList
.
map
(
e
=>
{
return
e
.
triggerid
;
})
ids
:
arr
};
this
.
overAllSer
.
deleteTri
gger
(
data
).
subscribe
(
this
.
overAllSer
.
deleteTri
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'删除成功'
);
...
...
src/main/webapp/app/overAll/template/list/tri-modal/tri-modal.component.html
View file @
81279855
...
...
@@ -2,6 +2,13 @@
(
nzOnOk
)="
saveTrigger
()"
>
<div
nz-form
class=
"ant-advanced-search-form form-select"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"description"
>
名称
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
name=
"description"
type=
"text"
nz-input
[(
ngModel
)]="
triggerObj
.
description
"
>
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"priority"
>
严重性
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-radio-group
[(
ngModel
)]="
triggerObj
.
priority
"
>
...
...
@@ -19,9 +26,9 @@
</nz-form-control>
</nz-form-item>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nz
Required
nzFor=
"priority
"
>
描述
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nz
For=
"comments
"
>
描述
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<textarea
nz-input
name=
"
description"
[(
ngModel
)]="
triggerObj
.
description
"
placeholder=
"描述"
<textarea
nz-input
name=
"
comments"
[(
ngModel
)]="
triggerObj
.
comments
"
placeholder=
"描述"
[
nzAutosize
]="{
minRows:
2
,
maxRows:
6
}"
></textarea>
</nz-form-control>
</nz-form-item>
...
...
src/main/webapp/app/overAll/template/list/tri-modal/tri-modal.component.ts
View file @
81279855
...
...
@@ -32,7 +32,8 @@ export class TriModalComponent implements OnInit {
this
.
triggerObj
=
{
expression
:
''
,
priority
:
'2'
,
description
:
''
description
:
''
,
comments
:
''
};
}
...
...
@@ -54,6 +55,7 @@ export class TriModalComponent implements OnInit {
const
data
=
res
.
data
[
0
];
this
.
triggerObj
.
expression
=
data
.
expression
;
this
.
triggerObj
.
description
=
data
.
description
;
this
.
triggerObj
.
comments
=
data
.
comments
;
this
.
triggerObj
.
priority
=
data
.
priority
+
''
;
}
);
...
...
@@ -65,10 +67,10 @@ export class TriModalComponent implements OnInit {
this
.
message
.
error
(
'请输入阈值'
);
return
false
;
}
if
(
this
.
title
==
'新增阈值
原型
'
)
{
if
(
this
.
title
==
'新增阈值'
)
{
this
.
createTrigger
();
}
if
(
this
.
title
==
'编辑阈值
原型
'
)
{
if
(
this
.
title
==
'编辑阈值'
)
{
this
.
updateTrigger
();
}
}
...
...
@@ -79,12 +81,16 @@ export class TriModalComponent implements OnInit {
this
.
message
.
error
(
'请输入表达式'
);
return
false
;
}
if
(
!
this
.
triggerObj
.
description
)
{
this
.
message
.
error
(
'请输入名称'
);
return
false
;
}
return
true
;
}
//1.创建阈值
createTrigger
()
{
this
.
overAllSer
.
createTri
ggerPrototype
(
this
.
triggerObj
).
subscribe
(
this
.
overAllSer
.
createTri
(
this
.
triggerObj
).
subscribe
(
(
response
)
=>
{
if
(
response
.
errCode
==
10000
)
{
this
.
message
.
success
(
'创建阈值成功'
);
...
...
@@ -104,9 +110,10 @@ export class TriModalComponent implements OnInit {
triggerid
:
this
.
triggerId
,
expression
:
this
.
triggerObj
.
expression
,
priority
:
this
.
triggerObj
.
priority
,
description
:
this
.
triggerObj
.
description
description
:
this
.
triggerObj
.
description
,
comments
:
this
.
triggerObj
.
comments
};
this
.
overAllSer
.
updateTri
ggerPrototype
(
data
).
subscribe
(
res
=>
{
this
.
overAllSer
.
updateTri
(
data
).
subscribe
(
res
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'修改阈值成功'
);
this
.
initForm
();
...
...
src/main/webapp/app/overAll/template/trigger-list/trigger-list.component.html
View file @
81279855
...
...
@@ -52,7 +52,7 @@
<nz-tag
*
ngIf=
"data.priority == 4 || data.priority == 5"
[
nzColor
]="
color
.
red
"
></nz-tag>
<nz-tag
*
ngIf=
"data.priority == 2 || data.priority == 3"
[
nzColor
]="
color
.
yellow
"
></nz-tag>
</td>
<td>
{{data.
comments
}}
</td>
<td>
{{data.
description
}}
</td>
<td>
{{data.expression}}
</td>
<td
class=
"cursor main-color"
>
<span
(
click
)="
showEditModal
(
data
)"
>
编辑
</span>
...
...
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