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
d453dc94
Commit
d453dc94
authored
Jan 13, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4e1094e0
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
653 additions
and
6 deletions
+653
-6
app.main.module.ts
src/main/webapp/app/app.main.module.ts
+6
-0
app.route.ts
src/main/webapp/app/app.route.ts
+5
-1
flow-trend.component.ts
...webapp/app/netTopology/flow-trend/flow-trend.component.ts
+4
-1
check-list.component.html
...app/overAll/template/check-list/check-list.component.html
+1
-0
item-list.component.html
.../overAll/template/list/item-list/item-list.component.html
+67
-0
item-list.component.ts
...pp/overAll/template/list/item-list/item-list.component.ts
+156
-0
tri-list.component.html
...pp/overAll/template/list/tri-list/tri-list.component.html
+66
-0
tri-list.component.ts
.../app/overAll/template/list/tri-list/tri-list.component.ts
+155
-0
tri-modal.component.html
.../overAll/template/list/tri-modal/tri-modal.component.html
+31
-0
tri-modal.component.ts
...pp/overAll/template/list/tri-modal/tri-modal.component.ts
+127
-0
template.component.html
src/main/webapp/app/overAll/template/template.component.html
+12
-4
template.component.ts
src/main/webapp/app/overAll/template/template.component.ts
+22
-0
trigger-list.component.html
...overAll/template/trigger-list/trigger-list.component.html
+1
-0
No files found.
src/main/webapp/app/app.main.module.ts
View file @
d453dc94
...
...
@@ -106,6 +106,9 @@ import {CheckListComponent} from './overAll/template/check-list/check-list.compo
import
{
TriggerListComponent
}
from
'./overAll/template/trigger-list/trigger-list.component'
;
import
{
TriggerPrototypeComponent
}
from
'./overAll/template/modal/trigger-prototype/trigger-prototype.component'
;
import
{
CheckPrototypeComponent
}
from
'./overAll/template/modal/check-prototype/check-prototype.component'
;
import
{
TriListComponent
}
from
'./overAll/template/list/tri-list/tri-list.component'
;
import
{
ItemListComponent
}
from
'./overAll/template/list/item-list/item-list.component'
;
import
{
TriModalComponent
}
from
'./overAll/template/list/tri-modal/tri-modal.component'
;
@
NgModule
({
imports
:
[
...
...
@@ -214,6 +217,9 @@ import {CheckPrototypeComponent} from './overAll/template/modal/check-prototype/
TriggerListComponent
,
TriggerPrototypeComponent
,
CheckPrototypeComponent
,
TriListComponent
,
ItemListComponent
,
TriModalComponent
,
],
providers
:[
OverAllService
,
...
...
src/main/webapp/app/app.route.ts
View file @
d453dc94
...
...
@@ -36,6 +36,8 @@ import {TemplateComponent} from './overAll/template/template.component';
import
{
CheckListComponent
}
from
'./overAll/template/check-list/check-list.component'
;
import
{
TriggerListComponent
}
from
'./overAll/template/trigger-list/trigger-list.component'
;
import
{
DiscoveryListComponent
}
from
'./overAll/template/discovery-list/discovery-list.component'
;
import
{
ItemListComponent
}
from
'./overAll/template/list/item-list/item-list.component'
;
import
{
TriListComponent
}
from
'./overAll/template/list/tri-list/tri-list.component'
;
export
const
route
:
Routes
=
[
{
path
:
''
,
component
:
JhiMainComponent
,
canActivate
:[
LoginGuard
]},
...
...
@@ -78,7 +80,9 @@ export const route: Routes = [
{
path
:
'template'
,
component
:
TemplateComponent
,
data
:
{
breadcrumb
:
'模版配置'
},},
{
path
:
'discoveryList'
,
component
:
DiscoveryListComponent
,
data
:
{
breadcrumb
:
'自动发现列表'
},},
{
path
:
'checkList'
,
component
:
CheckListComponent
,
data
:
{
breadcrumb
:
'监控项原型'
},},
{
path
:
'triggerList'
,
component
:
TriggerListComponent
,
data
:
{
breadcrumb
:
'触发器原型'
},},
{
path
:
'triggerList'
,
component
:
TriggerListComponent
,
data
:
{
breadcrumb
:
'阈值原型'
},},
{
path
:
'itemList'
,
component
:
ItemListComponent
,
data
:
{
breadcrumb
:
'监控项'
},},
{
path
:
'triList'
,
component
:
TriListComponent
,
data
:
{
breadcrumb
:
'阈值'
},},
]
},
]
...
...
src/main/webapp/app/netTopology/flow-trend/flow-trend.component.ts
View file @
d453dc94
...
...
@@ -253,10 +253,13 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
if
(
params
.
data
){
let
res
=
params
.
seriesName
;
res
+=
'<br/>时间:'
+
params
.
name
;
let
Gbps
=
1000
*
1000
*
1000
;
let
Mbps
=
1000
*
1000
;
let
kbps
=
1000
;
let
size
=
Math
.
abs
(
params
.
data
);
if
(
size
/
Mbps
>
1
)
{
if
(
size
/
Gbps
>
1
){
res
+=
'<br/>流量:'
+
(
size
/
Gbps
).
toFixed
(
2
)
+
'Gbps'
;
}
else
if
(
size
/
Mbps
>
1
)
{
res
+=
'<br/>流量:'
+
(
size
/
Mbps
).
toFixed
(
2
)
+
'Mbps'
;
}
else
if
(
size
/
kbps
>
1
)
{
res
+=
'<br/>流量:'
+
(
size
/
kbps
).
toFixed
(
2
)
+
'kbps'
;
...
...
src/main/webapp/app/overAll/template/check-list/check-list.component.html
View file @
d453dc94
<!--监控项原型列表-->
<div
nz-row
class=
"breadcrumbs"
>
<div
nz-col
nzSpan=
"16"
>
<nz-breadcrumb
class=
"padding-8-0"
>
...
...
src/main/webapp/app/overAll/template/list/item-list/item-list.component.html
0 → 100644
View file @
d453dc94
<!--监控项列表-->
<div
nz-row
class=
"breadcrumbs"
>
<div
nz-col
nzSpan=
"16"
>
<nz-breadcrumb
class=
"padding-8-0"
>
<nz-breadcrumb-item>
首页
</nz-breadcrumb-item>
<nz-breadcrumb-item>
<a>
综合监控
</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
模版配置
</nz-breadcrumb-item>
<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"
>
<button
(
click
)="
ngOnInit
()"
nz-button
nzType=
"primary"
><i
class=
"anticon anticon-sync"
></i></button>
<smart-full-screen></smart-full-screen>
</div>
</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>
</div>
<div
nz-col
nzSpan=
"18"
></div>
<div
nz-col
nzSpan=
"3"
>
<button
(
click
)="
deleteBatchCheck
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-close-circle-o"
></i>
批量删除
</button>
</div>
</div>
<nz-table
#
nzTable
[
nzData
]="
checkList
"
[
nzFrontPagination
]="
false
"
[
nzTotal
]="
totalNum
"
[
nzPageIndex
]="
pageNum
"
[
nzPageSize
]="
pageCount
"
(
nzPageIndexChange
)="
change
($
event
)"
[
nzLoading
]="
loading
"
>
<thead>
<tr>
<th
nzShowCheckbox
[
nzIndeterminate
]="
indeterminate
"
[
nzChecked
]="
allChecked
"
(
nzCheckedChange
)="
checkAll
($
event
)"
></th>
<th>
名称
</th>
<th>
键值
</th>
<th>
间隔
</th>
<th>
状态
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of checkList"
>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
selectItem
(
data
,$
event
)"
></td>
<td
class=
"round-tag tag-form"
>
{{data.name}}
</td>
<td>
{{data.key_}}
</td>
<td>
{{data.usedcount}}
</td>
<td>
<span
*
ngIf=
"data.status == 0"
>
启用
</span>
<span
*
ngIf=
"data.status == 1"
>
禁用
</span>
</td>
<td
class=
"main-color cursor"
>
<span
(
click
)="
showEditModal
(
data
)"
>
编辑
</span>
<span
(
click
)="
deleteCheck
(
data
)"
>
删除
</span>
</td>
</tr>
</tbody>
</nz-table>
<!--监控项-->
<smart-check
#
smartCheck
(
done
)="
getList
()"
></smart-check>
src/main/webapp/app/overAll/template/list/item-list/item-list.component.ts
0 → 100644
View file @
d453dc94
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
OverAllService
}
from
'../../../overAll.service'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
pageSize
}
from
'../../../../app.constants'
;
import
{
CheckPrototypeComponent
}
from
'../../modal/check-prototype/check-prototype.component'
;
import
{
SystemService
}
from
'../../../../system/system.service'
;
import
{
CommonService
}
from
'../../../../shared/common/common.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
@
Component
({
selector
:
'smart-item-list'
,
templateUrl
:
'./item-list.component.html'
,
styles
:
[]
})
export
class
ItemListComponent
implements
OnInit
{
@
ViewChild
(
'smartCheckProtoType'
)
smartCheckProtoType
:
CheckPrototypeComponent
;
tempName
;
disName
;
hostId
;
discoveryids
;
loading
=
false
;
pageNum
=
1
;
pageCount
=
pageSize
;
totalNum
;
checkList
;
selectList
=
[];
allChecked
;
indeterminate
;
constructor
(
private
overAllSer
:
OverAllService
,
private
routerInfo
:
ActivatedRoute
,
private
router
:
Router
,
private
message
:
NzMessageService
,
private
systemSer
:
SystemService
,
private
commonSer
:
CommonService
)
{
this
.
routerInfo
.
queryParams
.
subscribe
(
(
res
)
=>
{
this
.
discoveryids
=
res
.
discoveryids
;
this
.
tempName
=
res
.
name
;
this
.
hostId
=
res
.
hostId
;
}
);
}
checkAll
(
value
:
boolean
):
void
{
this
.
checkList
.
forEach
(
data
=>
data
.
checked
=
value
);
this
.
refreshStatus
();
}
currentPageDataChange
(
$event
:
Array
<
{
checked
:
boolean
}
>
):
void
{
this
.
checkList
=
$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
.
checkList
.
every
(
value
=>
value
.
checked
===
true
);
const
allUnChecked
=
this
.
checkList
.
every
(
value
=>
!
value
.
checked
);
this
.
allChecked
=
allChecked
;
this
.
indeterminate
=
(
!
allChecked
)
&&
(
!
allUnChecked
);
}
ngOnInit
()
{
this
.
getList
();
}
//翻页
change
(
e
)
{
this
.
pageNum
=
e
;
this
.
getList
();
}
getList
()
{
this
.
loading
=
true
;
const
data
=
{
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageCount
,
discoveryids
:
[
this
.
discoveryids
]
};
this
.
overAllSer
.
findItemPrototype
(
data
).
subscribe
(
(
res
)
=>
{
this
.
checkList
=
res
.
data
.
data
;
this
.
totalNum
=
res
.
data
.
totalNum
;
this
.
loading
=
false
;
}
);
}
//新增监控项原型
showAddModal
()
{
this
.
smartCheckProtoType
.
showAddModal
(
this
.
hostId
,
this
.
discoveryids
,
'添加监控项原型'
);
}
//编辑监控项原型
showEditModal
(
data
)
{
this
.
smartCheckProtoType
.
showEditModal
(
this
.
hostId
,
this
.
discoveryids
,
data
.
itemid
,
'编辑监控项原型'
);
}
//单个删除
deleteCheck
(
item
)
{
this
.
commonSer
.
confirmThing
(
'删除'
,
'确定删除当前的监控项原型'
,
()
=>
{
const
data
=
{
ids
:
[]
};
data
.
ids
.
push
(
item
.
itemid
);
this
.
overAllSer
.
deleteItemPrototype
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'删除成功'
);
this
.
getList
();
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
);
});
}
//批量删除
deleteBatchCheck
()
{
if
(
this
.
selectList
.
length
==
0
)
{
this
.
message
.
warning
(
'请选择需要删除的监控项原型'
);
return
false
;
}
this
.
commonSer
.
confirmThing
(
'删除'
,
'确定删除选择的监控项原型'
,
()
=>
{
const
data
=
{
ids
:
this
.
selectList
.
map
(
e
=>
{
return
e
.
itemid
;
})
};
this
.
overAllSer
.
deleteItemPrototype
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'删除成功'
);
this
.
getList
();
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
);
});
}
}
src/main/webapp/app/overAll/template/list/tri-list/tri-list.component.html
0 → 100644
View file @
d453dc94
<!--阈值列表-->
<div
nz-row
class=
"breadcrumbs"
>
<div
nz-col
nzSpan=
"16"
>
<nz-breadcrumb
class=
"padding-8-0"
>
<nz-breadcrumb-item>
首页
</nz-breadcrumb-item>
<nz-breadcrumb-item>
<a>
综合监控
</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
模版配置
</nz-breadcrumb-item>
<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"
>
<button
(
click
)="
ngOnInit
()"
nz-button
nzType=
"primary"
><i
class=
"anticon anticon-sync"
></i></button>
<smart-full-screen></smart-full-screen>
</div>
</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>
</div>
<div
nz-col
nzSpan=
"18"
></div>
<div
nz-col
nzSpan=
"3"
>
<button
(
click
)="
deleteBatchTrigger
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-close-circle-o"
></i>
批量删除
</button>
</div>
</div>
<nz-table
#
nzTable
[
nzData
]="
triggerList
"
[
nzFrontPagination
]="
false
"
[
nzTotal
]="
totalNum
"
[
nzPageIndex
]="
pageNum
"
[
nzPageSize
]="
pageCount
"
(
nzPageIndexChange
)="
change
($
event
)"
[
nzLoading
]="
loading
"
>
<thead>
<tr>
<th
nzShowCheckbox
[
nzIndeterminate
]="
indeterminate
"
[
nzChecked
]="
allChecked
"
(
nzCheckedChange
)="
checkAll
($
event
)"
></th>
<th>
严重性
</th>
<th
nzWidth=
"35%"
>
名称
</th>
<th
nzWidth=
"35%"
>
表达式
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of triggerList"
>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
selectItem
(
data
,$
event
)"
></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.expression}}
</td>
<td
class=
"cursor main-color"
>
<span
(
click
)="
showEditModal
(
data
)"
>
编辑
</span>
<span
(
click
)="
deleteTrigger
(
data
)"
>
删除
</span>
</td>
</tr>
</tbody>
</nz-table>
<!--触发器原型-->
<smart-trigger-prototype
#
smartTriggerPrototype
(
done
)="
getList
()"
></smart-trigger-prototype>
\ No newline at end of file
src/main/webapp/app/overAll/template/list/tri-list/tri-list.component.ts
0 → 100644
View file @
d453dc94
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
OverAllService
}
from
'../../../overAll.service'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
color
,
pageSize
}
from
'../../../../app.constants'
;
import
{
TriggerPrototypeComponent
}
from
'../../modal/trigger-prototype/trigger-prototype.component'
;
import
{
SystemService
}
from
'../../../../system/system.service'
;
import
{
CommonService
}
from
'../../../../shared/common/common.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
@
Component
({
selector
:
'smart-tri-list'
,
templateUrl
:
'./tri-list.component.html'
,
styles
:
[]
})
export
class
TriListComponent
implements
OnInit
{
@
ViewChild
(
'smartTriggerPrototype'
)
smartTriggerPrototype
:
TriggerPrototypeComponent
;
tempName
;
disName
;
hostId
;
discoveryids
;
color
=
color
;
loading
=
false
;
pageNum
=
1
;
pageCount
=
pageSize
;
totalNum
;
triggerList
;
selectList
=
[];
allChecked
;
indeterminate
;
constructor
(
private
overAllSer
:
OverAllService
,
private
routerInfo
:
ActivatedRoute
,
private
router
:
Router
,
private
message
:
NzMessageService
,
private
systemSer
:
SystemService
,
private
commonSer
:
CommonService
)
{
this
.
routerInfo
.
queryParams
.
subscribe
(
(
res
)
=>
{
this
.
discoveryids
=
res
.
id
;
this
.
tempName
=
res
.
name
;
this
.
hostId
=
res
.
hostId
;
}
);
}
checkAll
(
value
:
boolean
):
void
{
this
.
triggerList
.
forEach
(
data
=>
data
.
checked
=
value
);
this
.
refreshStatus
();
}
currentPageDataChange
(
$event
:
Array
<
{
checked
:
boolean
}
>
):
void
{
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
);
this
.
allChecked
=
allChecked
;
this
.
indeterminate
=
(
!
allChecked
)
&&
(
!
allUnChecked
);
}
ngOnInit
()
{
this
.
getList
();
}
//翻页
change
(
e
)
{
this
.
pageNum
=
e
;
this
.
getList
();
}
getList
()
{
this
.
loading
=
true
;
const
data
=
{
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageCount
,
discoveryids
:
[
this
.
discoveryids
]
};
this
.
overAllSer
.
findPageTrigger
(
data
).
subscribe
(
(
res
)
=>
{
this
.
triggerList
=
res
.
data
.
data
;
this
.
totalNum
=
res
.
data
.
totalNum
;
this
.
loading
=
false
;
}
);
}
showAddModal
()
{
this
.
smartTriggerPrototype
.
showAddModal
(
'新增阈值原型'
,
this
.
tempName
);
}
showEditModal
(
data
)
{
this
.
smartTriggerPrototype
.
showEditModal
(
'编辑阈值原型'
,
data
.
triggerid
,
this
.
tempName
);
}
//单个删除
deleteTrigger
(
item
)
{
this
.
commonSer
.
confirmThing
(
'删除'
,
'确定删除当前的阈值原型'
,
()
=>
{
const
data
=
{
ids
:
[]
};
data
.
ids
.
push
(
item
.
triggerid
);
this
.
overAllSer
.
deleteTrigger
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'删除成功'
);
this
.
getList
();
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
);
});
}
//批量删除
deleteBatchTrigger
()
{
if
(
this
.
selectList
.
length
==
0
)
{
this
.
message
.
warning
(
'请选择需要删除的阈值原型'
);
return
false
;
}
this
.
commonSer
.
confirmThing
(
'删除'
,
'确定删除选择的阈值原型'
,
()
=>
{
const
data
=
{
ids
:
this
.
selectList
.
map
(
e
=>
{
return
e
.
triggerid
;
})
};
this
.
overAllSer
.
deleteTrigger
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'删除成功'
);
this
.
getList
();
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
);
});
}
}
src/main/webapp/app/overAll/template/list/tri-modal/tri-modal.component.html
0 → 100644
View file @
d453dc94
<nz-modal
[
nzWidth
]="
880
"
[(
nzVisible
)]="
isVisiable
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleCheckCancel
()"
(
nzOnOk
)="
saveTrigger
()"
>
<div
nz-form
class=
"ant-advanced-search-form form-select"
>
<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
"
>
<label
nz-radio-button
nzValue=
"2"
>
危险
</label>
<label
nz-radio-button
nzValue=
"3"
>
故障
</label>
</nz-radio-group>
</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
"
>
<textarea
nz-input
name=
"description"
[(
ngModel
)]="
triggerObj
.
expression
"
placeholder=
"描述"
[
nzAutosize
]="{
minRows:
2
,
maxRows:
6
}"
></textarea>
</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
"
>
<textarea
nz-input
name=
"description"
[(
ngModel
)]="
triggerObj
.
description
"
placeholder=
"描述"
[
nzAutosize
]="{
minRows:
2
,
maxRows:
6
}"
></textarea>
</nz-form-control>
</nz-form-item>
</div>
</nz-modal>
src/main/webapp/app/overAll/template/list/tri-modal/tri-modal.component.ts
0 → 100644
View file @
d453dc94
import
{
Component
,
EventEmitter
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
OverAllService
}
from
'../../../overAll.service'
;
import
{
FormBuilder
}
from
'@angular/forms'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
@
Component
({
selector
:
'smart-tri-modal'
,
templateUrl
:
'./tri-modal.component.html'
,
styles
:
[]
})
export
class
TriModalComponent
implements
OnInit
{
@
Output
()
done
=
new
EventEmitter
<
any
>
();
isVisiable
=
false
;
title
;
triggerId
;
//阈值id
itemId
;
//监控项ID
hostName
;
//主机name
itemObj
;
//监控项对象
triggerObj
;
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
)
{
}
ngOnInit
()
{
this
.
initForm
();
}
initForm
()
{
this
.
triggerObj
=
{
expression
:
''
,
priority
:
'2'
,
description
:
''
};
}
//新增
showAddModal
(
title
,
hostName
)
{
this
.
title
=
title
;
this
.
isVisiable
=
true
;
this
.
hostName
=
hostName
;
}
//编辑
showEditModal
(
title
,
id
,
hostName
)
{
this
.
title
=
title
;
this
.
triggerId
=
id
;
this
.
isVisiable
=
true
;
this
.
hostName
=
hostName
;
this
.
overAllSer
.
findTriggerById
(
id
).
subscribe
(
(
res
)
=>
{
const
data
=
res
.
data
[
0
];
this
.
triggerObj
.
expression
=
data
.
expression
;
this
.
triggerObj
.
description
=
data
.
description
;
this
.
triggerObj
.
priority
=
data
.
priority
+
''
;
}
);
}
//阈值--start
saveTrigger
()
{
if
(
!
this
.
checkFun
())
{
this
.
message
.
error
(
'请输入阈值'
);
return
false
;
}
if
(
this
.
title
==
'新增阈值原型'
)
{
this
.
createTrigger
();
}
if
(
this
.
title
==
'编辑阈值原型'
)
{
this
.
updateTrigger
();
}
}
//校验是否填值
checkFun
()
{
if
(
!
this
.
triggerObj
.
expression
)
{
this
.
message
.
error
(
'请输入表达式'
);
return
false
;
}
return
true
;
}
//1.创建阈值
createTrigger
()
{
this
.
overAllSer
.
createTriggerPrototype
(
this
.
triggerObj
).
subscribe
(
(
response
)
=>
{
if
(
response
.
errCode
==
10000
)
{
this
.
message
.
success
(
'创建阈值成功'
);
this
.
initForm
();
this
.
done
.
emit
();
this
.
isVisiable
=
false
;
}
else
{
this
.
message
.
error
(
response
.
errMsg
);
}
}
);
}
//2.修改阈值
updateTrigger
()
{
const
data
=
{
triggerid
:
this
.
triggerId
,
expression
:
this
.
triggerObj
.
expression
,
priority
:
this
.
triggerObj
.
priority
,
description
:
this
.
triggerObj
.
description
};
this
.
overAllSer
.
updateTriggerPrototype
(
data
).
subscribe
(
res
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'修改阈值成功'
);
this
.
initForm
();
this
.
done
.
emit
();
this
.
isVisiable
=
false
;
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
});
}
//取消
handleCheckCancel
()
{
this
.
isVisiable
=
false
;
this
.
initForm
();
}
}
src/main/webapp/app/overAll/template/template.component.html
View file @
d453dc94
...
...
@@ -77,8 +77,12 @@
<td
class=
"main-color cursor"
>
<span
(
click
)="
goToDiscovery
(
item
)"
>
{{item.discoveriesCount}}
</span>
</td>
<td>
{{item.itemsCount}}
</td>
<td>
{{item.triggersCount}}
</td>
<td
class=
"main-color cursor"
>
<span
(
click
)="
goToItem
(
item
)"
>
{{item.itemsCount}}
</span>
</td>
<td
class=
"main-color cursor"
>
<span
(
click
)="
goToTri
(
item
)"
>
{{item.triggersCount}}
</span>
</td>
</ng-container>
<td
class=
"handle main-color"
>
...
...
@@ -110,11 +114,15 @@
<span
>
{{item.name}}
</span>
</td>
<td>
{{item.description}}
</td>
<td>
{{item.itemsCount}}
</td>
<td>
{{item.triggersCount}}
</td>
<td
class=
"main-color cursor"
>
<span
(
click
)="
goToDiscovery
(
item
)"
>
{{item.discoveriesCount}}
</span>
</td>
<td
class=
"main-color cursor"
>
<span
(
click
)="
goToItem
(
item
)"
>
{{item.itemsCount}}
</span>
</td>
<td
class=
"main-color cursor"
>
<span
(
click
)="
goToTri
(
item
)"
>
{{item.triggersCount}}
</span>
</td>
<td
class=
"handle main-color"
>
<span
(
click
)="
showBasicCheckModal
(
item
.
templateid
,
item
.
host
)"
>
添加监测点
</span>
<span
(
click
)="
showDiscoveryAddModal
(
item
.
templateid
,
item
.
host
)"
>
添加自动发现
</span>
...
...
src/main/webapp/app/overAll/template/template.component.ts
View file @
d453dc94
...
...
@@ -193,6 +193,28 @@ export class TemplateComponent implements OnInit {
});
}
//goto 监控项列表
goToItem
(
item
){
this
.
router
.
navigate
([
'app/main/itemList'
],
{
queryParams
:
{
templateid
:
item
.
templateid
,
name
:
item
.
name
,
hostName
:
item
.
host
}
});
}
//goto阈值列表
goToTri
(
item
){
this
.
router
.
navigate
([
'app/main/triList'
],
{
queryParams
:
{
templateid
:
item
.
templateid
,
name
:
item
.
name
,
hostName
:
item
.
host
}
});
}
toTree
(
index
)
{
this
.
dataSet
.
forEach
(
item
=>
{
this
.
expandDataCache
[
item
.
host
]
=
this
.
convertTreeToList
(
item
,
item
.
id
,
index
);
...
...
src/main/webapp/app/overAll/template/trigger-list/trigger-list.component.html
View file @
d453dc94
<!--阈值原型列表-->
<div
nz-row
class=
"breadcrumbs"
>
<div
nz-col
nzSpan=
"16"
>
<nz-breadcrumb
class=
"padding-8-0"
>
...
...
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