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
0ea9cfa4
Commit
0ea9cfa4
authored
Jan 10, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
template
parent
db2204d9
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
698 additions
and
25 deletions
+698
-25
app.main.module.ts
src/main/webapp/app/app.main.module.ts
+6
-0
app.route.ts
src/main/webapp/app/app.route.ts
+6
-1
discovery.component.html
src/main/webapp/app/modal/discovery/discovery.component.html
+112
-0
discovery.component.ts
src/main/webapp/app/modal/discovery/discovery.component.ts
+150
-2
overAll.service.ts
src/main/webapp/app/overAll/overAll.service.ts
+27
-2
check-list.component.html
...app/overAll/template/check-list/check-list.component.html
+62
-0
check-list.component.ts
...p/app/overAll/template/check-list/check-list.component.ts
+15
-0
discovery-list.component.html
...All/template/discovery-list/discovery-list.component.html
+57
-0
discovery-list.component.ts
...erAll/template/discovery-list/discovery-list.component.ts
+154
-0
template.component.html
src/main/webapp/app/overAll/template/template.component.html
+15
-19
template.component.ts
src/main/webapp/app/overAll/template/template.component.ts
+17
-1
trigger-list.component.html
...overAll/template/trigger-list/trigger-list.component.html
+62
-0
trigger-list.component.ts
...p/overAll/template/trigger-list/trigger-list.component.ts
+15
-0
No files found.
src/main/webapp/app/app.main.module.ts
View file @
0ea9cfa4
...
@@ -101,6 +101,9 @@ import {NodeComponent} from './netTopology/model/node/node.component';
...
@@ -101,6 +101,9 @@ import {NodeComponent} from './netTopology/model/node/node.component';
import
{
TemplateComponent
}
from
'./overAll/template/template.component'
;
import
{
TemplateComponent
}
from
'./overAll/template/template.component'
;
import
{
DiscoveryComponent
}
from
'./modal/discovery/discovery.component'
;
import
{
DiscoveryComponent
}
from
'./modal/discovery/discovery.component'
;
import
{
StrategyComponent
}
from
'./modal/strategy/strategy.component'
;
import
{
StrategyComponent
}
from
'./modal/strategy/strategy.component'
;
import
{
DiscoveryListComponent
}
from
'./overAll/template/discovery-list/discovery-list.component'
;
import
{
CheckListComponent
}
from
'./overAll/template/check-list/check-list.component'
;
import
{
TriggerListComponent
}
from
'./overAll/template/trigger-list/trigger-list.component'
;
@
NgModule
({
@
NgModule
({
imports
:
[
imports
:
[
...
@@ -204,6 +207,9 @@ import {StrategyComponent} from './modal/strategy/strategy.component';
...
@@ -204,6 +207,9 @@ import {StrategyComponent} from './modal/strategy/strategy.component';
TemplateComponent
,
TemplateComponent
,
DiscoveryComponent
,
DiscoveryComponent
,
StrategyComponent
,
StrategyComponent
,
DiscoveryListComponent
,
CheckListComponent
,
TriggerListComponent
,
],
],
providers
:[
providers
:[
OverAllService
,
OverAllService
,
...
...
src/main/webapp/app/app.route.ts
View file @
0ea9cfa4
...
@@ -33,6 +33,9 @@ import {ResourceAlarmComponent} from './analysis/resource-alarm/resource-alarm.c
...
@@ -33,6 +33,9 @@ import {ResourceAlarmComponent} from './analysis/resource-alarm/resource-alarm.c
import
{
PararmsComponent
}
from
'./work/pararms/pararms.component'
;
import
{
PararmsComponent
}
from
'./work/pararms/pararms.component'
;
import
{
HomeComponent
}
from
'./home/home.component'
;
import
{
HomeComponent
}
from
'./home/home.component'
;
import
{
TemplateComponent
}
from
'./overAll/template/template.component'
;
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'
;
export
const
route
:
Routes
=
[
export
const
route
:
Routes
=
[
{
path
:
''
,
component
:
JhiMainComponent
,
canActivate
:[
LoginGuard
]},
{
path
:
''
,
component
:
JhiMainComponent
,
canActivate
:[
LoginGuard
]},
...
@@ -72,7 +75,9 @@ export const route: Routes = [
...
@@ -72,7 +75,9 @@ export const route: Routes = [
{
path
:
'operationWork'
,
component
:
OperationWorkComponent
,
data
:
{
breadcrumb
:
'运维工作'
},},
{
path
:
'operationWork'
,
component
:
OperationWorkComponent
,
data
:
{
breadcrumb
:
'运维工作'
},},
{
path
:
'resourceAlarm'
,
component
:
ResourceAlarmComponent
,
data
:
{
breadcrumb
:
'资源告警统计'
},},
{
path
:
'resourceAlarm'
,
component
:
ResourceAlarmComponent
,
data
:
{
breadcrumb
:
'资源告警统计'
},},
{
path
:
'params'
,
component
:
PararmsComponent
,
data
:
{
breadcrumb
:
'参数配置'
},},
{
path
:
'params'
,
component
:
PararmsComponent
,
data
:
{
breadcrumb
:
'参数配置'
},},
{
path
:
'template'
,
component
:
TemplateComponent
,
data
:
{
breadcrumb
:
'模版配置'
},},
{
path
:
'discoveryList'
,
component
:
DiscoveryListComponent
,
data
:
{
breadcrumb
:
'自动发现列表'
},},
{
path
:
'checkList'
,
component
:
CheckListComponent
,
data
:
{
breadcrumb
:
'监控项原型'
},},
{
path
:
'triggerList'
,
component
:
TriggerListComponent
,
data
:
{
breadcrumb
:
'触发器原型'
},},
]
]
},
},
]
]
...
...
src/main/webapp/app/modal/discovery/discovery.component.html
View file @
0ea9cfa4
<nz-modal
[
nzWidth
]="
880
"
[(
nzVisible
)]="
isVisiable
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleCheckCancel
()"
(
nzOnOk
)="
handleCheckOk
()"
>
<form
[
formGroup
]="
validateForm
"
nz-form
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"checkName"
>
名称
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
name=
"checkName"
type=
"text"
nz-input
formControlName=
"name"
>
<nz-form-explain
*
ngIf=
"validateForm.get('name').dirty && validateForm.get('name').errors"
>
请输入名称!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"type"
>
类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"type"
name=
"type"
nzPlaceHolder=
"选择类型"
formControlName=
"type"
>
<nz-option
nzValue=
"0"
nzLabel=
"Agent客户端"
></nz-option>
<nz-option
nzValue=
"7"
nzLabel=
"Agent客户端(主动式)"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"简单检查"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"SNMPv1 客户端"
></nz-option>
<nz-option
nzValue=
"4"
nzLabel=
"SNMPv2 客户端"
></nz-option>
<nz-option
nzValue=
"6"
nzLabel=
"SNMPv3 客户端"
></nz-option>
<nz-option
nzValue=
"5"
nzLabel=
"Agent内部"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"Agent采集器"
></nz-option>
<nz-option
nzValue=
"8"
nzLabel=
"Agent整合"
></nz-option>
<nz-option
nzValue=
"10"
nzLabel=
"外部检查"
></nz-option>
<nz-option
nzValue=
"11"
nzLabel=
"数据库监控"
></nz-option>
<nz-option
nzValue=
"12"
nzLabel=
"IPMI客户端"
></nz-option>
<nz-option
nzValue=
"13"
nzLabel=
"SSH 客户端"
></nz-option>
<nz-option
nzValue=
"14"
nzLabel=
"TELNET客户端"
></nz-option>
<nz-option
nzValue=
"16"
nzLabel=
"JMX agent代理程序"
></nz-option>
</nz-select>
<nz-form-explain
*
ngIf=
"validateForm.get('type').dirty && validateForm.get('type').errors"
>
请选择监测点类型!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<ng-container
*
ngIf=
"isInterface"
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
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}}"
nzLabel=
"{{item.ip}}:{{item.port}}"
></nz-option>
</nz-select>
<nz-form-explain
*
ngIf=
"validateForm.get('interfaceid').dirty && validateForm.get('interfaceid').errors"
>
请选择主机接口!
</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
"
>
<input
placeholder=
"输入键值"
type=
"text"
name=
"key_"
nz-input
formControlName=
"key_"
>
<nz-form-explain
*
ngIf=
"validateForm.get('key_').dirty && validateForm.get('key_').errors"
>
请选择键值!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<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
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
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>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"port"
>
端口
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
placeholder=
"输入端口"
type=
"text"
name=
"port"
nz-input
formControlName=
"port"
>
<nz-form-explain
*
ngIf=
"validateForm.get('port').dirty && validateForm.get('port').errors"
>
请选择键值!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
</ng-container>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"delay"
>
更新间隔
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
name=
"delay"
type=
"text"
placeholder=
"输入数据更新间隔"
nz-input
formControlName=
"delay"
>
<nz-form-explain
*
ngIf=
"validateForm.get('delay').dirty && validateForm.get('delay').errors"
>
请输入更新间隔!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
丢失时间
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
nzFor=
"lifetime"
>
<input
type=
"text"
name=
"lifetime"
placeholder=
"输入丢失时间"
nz-input
formControlName=
"lifetime"
>
</nz-form-control>
</nz-form-item>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"description"
>
描述
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<textarea
nz-input
name=
"description"
formControlName=
"description"
placeholder=
"描述"
[
nzAutosize
]="{
minRows:
2
,
maxRows:
6
}"
></textarea>
</nz-form-control>
</nz-form-item>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"status"
>
已启用
</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>
<!--键值查询-->
<smart-basic-key
(
keyValue
)="
getKey
($
event
)"
#
basicKey
></smart-basic-key>
<!--新建分类-->
<smart-new-type
(
data
)="
addItemType
($
event
)"
#
newType
></smart-new-type>
src/main/webapp/app/modal/discovery/discovery.component.ts
View file @
0ea9cfa4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
OnInit
,
Output
,
ViewChild
}
from
'@angular/core'
;
import
{
FormBuilder
,
FormControl
,
FormGroup
,
Validator
,
Validators
}
from
'@angular/forms'
;
import
{
OverAllService
}
from
'../../overAll/overAll.service'
;
import
{
BasicKeyComponent
}
from
'../basic-key/basic-key.component'
;
import
{
NewTypeComponent
}
from
'../new-type/new-type.component'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
@
Component
({
@
Component
({
selector
:
'smart-discovery'
,
selector
:
'smart-discovery'
,
...
@@ -6,10 +11,153 @@ import { Component, OnInit } from '@angular/core';
...
@@ -6,10 +11,153 @@ import { Component, OnInit } from '@angular/core';
styles
:
[]
styles
:
[]
})
})
export
class
DiscoveryComponent
implements
OnInit
{
export
class
DiscoveryComponent
implements
OnInit
{
@
ViewChild
(
'basicKey'
)
basicKey
:
BasicKeyComponent
;
@
ViewChild
(
'newType'
)
newType
:
NewTypeComponent
;
@
Output
()
done
=
new
EventEmitter
<
any
>
();
constructor
()
{
}
title
;
isVisiable
=
false
;
isInterface
=
true
;
nzSize
=
'large'
;
hostId
;
//主机ID
itemId
;
//监控项id
interfaceList
:
any
[];
valueMapList
=
[];
validateForm
:
FormGroup
;
checkList
;
//监测点分类
interval
;
//间隔时长
tabNum
:
number
;
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
)
{
}
ngOnInit
()
{
ngOnInit
()
{
this
.
initForm
();
}
initForm
()
{
this
.
tabNum
=
0
;
this
.
validateForm
=
this
.
fb
.
group
({
hostid
:
[
this
.
hostId
],
name
:
[
null
,
[
Validators
.
required
]],
type
:
[
null
,
[
Validators
.
required
]],
key_
:
[
null
,
[
Validators
.
required
]],
snmp_oid
:
[
'interfaces.ifTable.ifEntry.ifInOctets.1'
],
snmp_community
:
[
'public'
],
port
:
[
this
.
hostId
],
interfaceid
:
[
null
,
[
Validators
.
required
]],
delay
:
[
null
,
[
Validators
.
required
]],
description
:
[
null
],
lifetime
:
[
null
],
status
:
[
null
],
});
}
//新增
showAddModal
(
hostId
,
title
)
{
this
.
title
=
title
;
this
.
isVisiable
=
true
;
this
.
hostId
=
hostId
;
//主机接口
this
.
overAllSer
.
findInterface
(
this
.
hostId
).
subscribe
(
(
res
)
=>
{
this
.
interfaceList
=
res
.
data
;
}
);
}
//编辑
showEditModal
(
hostId
,
id
)
{
this
.
title
=
'编辑监测点'
;
this
.
hostId
=
hostId
;
this
.
isVisiable
=
true
;
this
.
itemId
=
id
;
this
.
overAllSer
.
findItemDetail
(
id
).
subscribe
(
(
res
)
=>
{
const
data
=
res
.
data
[
0
];
data
.
type
+=
''
;
data
.
interfaceid
+=
''
;
data
.
value_type
+=
''
;
if
(
data
.
applications
){
data
.
applications
=
data
.
applications
.
map
(
e
=>
{
return
e
.
applicationid
;
});
}
this
.
validateForm
.
patchValue
(
data
);
}
);
//主机接口
this
.
overAllSer
.
findInterface
(
this
.
hostId
).
subscribe
(
(
res
)
=>
{
this
.
interfaceList
=
res
.
data
;
}
);
}
//添加
handleCheckOk
()
{
for
(
let
i
in
this
.
validateForm
.
controls
)
{
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
}
if
(
this
.
validateForm
.
invalid
)
{
this
.
message
.
error
(
'请输入必填信息'
);
return
false
;
}
this
.
validateForm
.
value
.
applications
=
[
this
.
validateForm
.
value
.
applications
];
this
.
validateForm
.
value
.
hostid
=
this
.
hostId
;
if
(
this
.
title
==
'添加自动发现'
)
{
this
.
create
();
}
if
(
this
.
title
==
'编辑自动发现'
)
{
this
.
update
();
}
}
create
()
{
this
.
overAllSer
.
createLldrule
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'创建自动发现成功'
);
this
.
done
.
emit
();
this
.
tabNum
=
1
;
this
.
isVisiable
=
false
;
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
},
(
err
)
=>
{
this
.
message
.
error
(
'系统错误'
);
}
);
}
//修改监控项
update
()
{
this
.
validateForm
.
addControl
(
'itemid'
,
new
FormControl
(
this
.
itemId
));
this
.
overAllSer
.
updateLldrule
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'修改自动发现成功'
);
this
.
done
.
emit
();
this
.
tabNum
=
1
;
this
.
isVisiable
=
false
;
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
},
(
err
)
=>
{
this
.
message
.
error
(
'系统错误'
);
}
);
}
handleCheckCancel
():
void
{
this
.
isVisiable
=
false
;
this
.
initForm
();
}
}
}
}
src/main/webapp/app/overAll/overAll.service.ts
View file @
0ea9cfa4
...
@@ -85,8 +85,8 @@ export class OverAllService {
...
@@ -85,8 +85,8 @@ export class OverAllService {
}
}
//主机接口
//主机接口
getinterface
(
data
):
Observable
<
any
>
{
findInterface
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host
Interface/getinterface/'
+
data
);
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host
/findInterface/'
+
params
);
}
}
//查询键值
//查询键值
...
@@ -338,4 +338,29 @@ export class OverAllService {
...
@@ -338,4 +338,29 @@ export class OverAllService {
getTemplateGroups
():
Observable
<
any
>
{
getTemplateGroups
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/groups/getTemplateGroups'
);
return
this
.
http
.
get
(
SERVER_API_URL
+
'/groups/getTemplateGroups'
);
}
}
//添加主机自动发现
createLldrule
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/create'
,
data
);
}
//添加主机自动发现
updateLldrule
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/update'
,
data
);
}
//添加主机自动发现
findPageLldrule
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/findPage'
,
data
);
}
//添加主机自动发现
deleteLldrule
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/lldrule/delete'
,
data
);
}
//自动发现 详情
findLldrule
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/lldrule/find/'
+
params
);
}
}
}
src/main/webapp/app/overAll/template/check-list/check-list.component.html
0 → 100644
View file @
0ea9cfa4
<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"
></div>
</div>
<nz-table
#
nzTable
[
nzData
]="
childrenList
"
>
<thead>
<tr>
<th
nzShowCheckbox
[
nzIndeterminate
]="
indeterminate
"
[
nzChecked
]="
allChecked
"
(
nzCheckedChange
)="
checkAll
($
event
)"
></th>
<th>
名称
</th>
<th>
监控项
</th>
<th>
阈值
</th>
<th>
键值
</th>
<th>
间隔
</th>
<th>
类型
</th>
<th>
状态
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of childrenList"
>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
selectItem
(
data
,$
event
)"
></td>
<td
class=
"round-tag tag-form"
>
{{data.inventoryNo}}
</td>
<td>
{{data.name}}
</td>
<td>
{{data.inventorycount}}
</td>
<td>
{{data.stock}}
</td>
<td>
{{data.usedcount}}
</td>
<td>
{{data.lendcount}}
</td>
<td>
{{data.repaircount}}
</td>
</tr>
</tbody>
</nz-table>
\ No newline at end of file
src/main/webapp/app/overAll/template/check-list/check-list.component.ts
0 → 100644
View file @
0ea9cfa4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'smart-check-list'
,
templateUrl
:
'./check-list.component.html'
,
styles
:
[]
})
export
class
CheckListComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
()
{
}
}
src/main/webapp/app/overAll/template/discovery-list/discovery-list.component.html
0 → 100644
View file @
0ea9cfa4
<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>
模版:{{name}}
</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"
></div>
</div>
<nz-table
#
nzTable
[
nzData
]="
childrenList
"
>
<thead>
<tr>
<th
nzShowCheckbox
[
nzIndeterminate
]="
indeterminate
"
[
nzChecked
]="
allChecked
"
(
nzCheckedChange
)="
checkAll
($
event
)"
></th>
<th>
名称
</th>
<th>
监控项
</th>
<th>
阈值
</th>
<th>
键值
</th>
<th>
间隔
</th>
<th>
类型
</th>
<th>
状态
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of childrenList"
>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
selectItem
(
data
,$
event
)"
></td>
<td
class=
"round-tag tag-form"
>
{{data.inventoryNo}}
</td>
<td>
{{data.name}}
</td>
<td>
{{data.inventorycount}}
</td>
<td>
{{data.stock}}
</td>
<td>
{{data.usedcount}}
</td>
<td>
{{data.lendcount}}
</td>
<td>
{{data.repaircount}}
</td>
</tr>
</tbody>
</nz-table>
\ No newline at end of file
src/main/webapp/app/overAll/template/discovery-list/discovery-list.component.ts
0 → 100644
View file @
0ea9cfa4
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
CommonService
}
from
'../../../shared/common/common.service'
;
import
{
WorkService
}
from
'../../../work/work.service'
;
import
{
SystemService
}
from
'../../../system/system.service'
;
import
{
AssetsComponent
}
from
'../../../work/modal/assets/assets.component'
;
import
{
SERVER_API_URL
}
from
'../../../app.constants'
;
import
{
UploadComponent
}
from
'../../../work/modal/upload/upload.component'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
@
Component
({
selector
:
'smart-discovery-list'
,
templateUrl
:
'./discovery-list.component.html'
,
styles
:
[]
})
export
class
DiscoveryListComponent
implements
OnInit
{
@
ViewChild
(
'smartAssets'
)
smartAssets
:
AssetsComponent
;
@
ViewChild
(
'smartUpload'
)
smartUpload
:
UploadComponent
;
hostId
;
childrenList
;
name
;
allChecked
=
false
;
selectList
=
[];
disabledButton
=
true
;
indeterminate
=
false
;
constructor
(
private
workSer
:
WorkService
,
private
routerInfo
:
ActivatedRoute
,
private
router
:
Router
,
private
message
:
NzMessageService
,
private
systemSer
:
SystemService
,
private
commonSer
:
CommonService
)
{
this
.
routerInfo
.
queryParams
.
subscribe
(
(
res
)
=>
{
this
.
hostId
=
res
.
hostId
;
this
.
name
=
res
.
name
}
);
}
checkAll
(
value
:
boolean
):
void
{
this
.
childrenList
.
forEach
(
data
=>
data
.
checked
=
value
);
this
.
refreshStatus
();
}
currentPageDataChange
(
$event
:
Array
<
{
checked
:
boolean
}
>
):
void
{
this
.
childrenList
=
$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
.
childrenList
.
every
(
value
=>
value
.
checked
===
true
);
const
allUnChecked
=
this
.
childrenList
.
every
(
value
=>
!
value
.
checked
);
this
.
allChecked
=
allChecked
;
this
.
indeterminate
=
(
!
allChecked
)
&&
(
!
allUnChecked
);
}
ngOnInit
()
{
this
.
getList
();
}
getList
()
{
this
.
workSer
.
findInventory
(
this
.
hostId
).
subscribe
(
(
res
)
=>
{
this
.
childrenList
=
res
.
data
;
}
);
}
//删除资产--单个
deleteInVentory
(
item
){
const
data
=
{
inventoryIds
:[]
};
data
.
inventoryIds
.
push
(
item
.
id
);
this
.
commonSer
.
confirmThing
(
"删除"
,
"确定删除该资产?"
,()
=>
{
this
.
workSer
.
deleteInventory
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
getList
();
this
.
message
.
success
(
"删除资产成功"
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
})
}
//批量删除
batchDeleteInventory
(){
if
(
this
.
selectList
.
length
==
0
){
this
.
message
.
warning
(
"请选择需要删除的资产"
);
return
false
;
}
const
data
=
{
inventoryIds
:
this
.
selectList
.
map
(
e
=>
{
return
e
.
id
;
})
};
this
.
commonSer
.
confirmThing
(
"批量删除"
,
"确定删除选择的资产?"
,()
=>
{
this
.
workSer
.
deleteInventory
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
getList
();
this
.
message
.
success
(
"删除资产成功"
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
})
}
//添加资产
showAddModal
()
{
this
.
smartAssets
.
showAddModal
(
"添加资产"
);
}
//编辑资产
showEditModal
(
id
){
this
.
smartAssets
.
showEditModal
(
"编辑资产"
,
id
);
}
//goto 监测项原型
goToCheck
(
data
){
this
.
router
.
navigate
([
'app/main/checkList'
],{
queryParams
:{
invertoryId
:
data
.
id
}
})
}
//goto 阈值原型
goToTrigger
(
data
){
this
.
router
.
navigate
([
'app/main/triggerList'
],{
queryParams
:{
invertoryId
:
data
.
id
}
})
}
}
src/main/webapp/app/overAll/template/template.component.html
View file @
0ea9cfa4
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
<th
[
nzChecked
]="
allChecked
"
></th>
<th
[
nzChecked
]="
allChecked
"
></th>
<th>
名称
</th>
<th>
名称
</th>
<th>
描述
</th>
<th>
描述
</th>
<th>
自动发现
</th>
<th>
操作
</th>
<th>
操作
</th>
</tr>
</tr>
</thead>
</thead>
...
@@ -58,7 +59,8 @@
...
@@ -58,7 +59,8 @@
(
nzExpandChange
)="
getChildren
(
item
)"
>
(
nzExpandChange
)="
getChildren
(
item
)"
>
<span>
{{item.name}}
</span>
<span>
{{item.name}}
</span>
</td>
</td>
<td>
{{item.groupDescribe}}
</td>
<td>
{{item.description}}
</td>
<td></td>
</ng-container>
</ng-container>
<!--子集-->
<!--子集-->
<ng-container
*
ngIf=
"item.level"
>
<ng-container
*
ngIf=
"item.level"
>
...
@@ -67,7 +69,10 @@
...
@@ -67,7 +69,10 @@
<td
class=
"cursor"
[
nzIndentSize
]="
item
.
level
*
20
"
>
<td
class=
"cursor"
[
nzIndentSize
]="
item
.
level
*
20
"
>
<span>
{{item.name}}
</span>
<span>
{{item.name}}
</span>
</td>
</td>
<td></td>
<td>
{{item.description}}
</td>
<td
class=
"main-color cursor"
>
<span
(
click
)="
goToDiscovery
(
item
)"
>
{{item.discoveriesCount}}
</span>
</td>
</ng-container>
</ng-container>
<td
class=
"handle main-color"
>
<td
class=
"handle main-color"
>
...
@@ -78,16 +83,10 @@
...
@@ -78,16 +83,10 @@
</ng-container>
</ng-container>
<ng-container
*
ngIf=
"item.level"
>
<ng-container
*
ngIf=
"item.level"
>
<span
(
click
)="
showBasicCheckModal
(
item
.
templateid
,
item
.
host
)"
>
添加监测点
</span>
<span
(
click
)="
showBasicCheckModal
(
item
.
templateid
,
item
.
host
)"
>
添加监测点
</span>
<span
(
click
)="
showDiscoveryAddModal
(
item
)"
>
添加自动发现
</span>
<span
(
click
)="
showTempEditModal
(
item
)"
>
编辑
</span>
<span
(
click
)="
showTempEditModal
(
item
)"
>
编辑
</span>
<span
(
click
)="
showDeleteConfirm
(
item
)"
>
删除
</span>
<span
(
click
)="
showDeleteConfirm
(
item
)"
>
删除
</span>
<nz-dropdown
[
nzTrigger
]="'
click
'"
class=
"table-dropdown"
>
<span
(
click
)="
showAlarm
(
item
)"
>
添加告警
</span>
<a
nz-dropdown
>
更多
<i
class=
"anticon anticon-down"
></i>
</a>
<ul
nz-menu
nzSelectable
>
<li
nz-menu-item
(
click
)="
goDetail
(
item
)"
><a>
查看监测点
</a></li>
<li
(
click
)="
showAlarm
(
item
)"
nz-menu-item
><a>
添加告警
</a></li>
</ul>
</nz-dropdown>
</ng-container>
</ng-container>
</td>
</td>
</tr>
</tr>
...
@@ -104,19 +103,16 @@
...
@@ -104,19 +103,16 @@
<td
class=
"cursor"
>
<td
class=
"cursor"
>
<span
>
{{item.name}}
</span>
<span
>
{{item.name}}
</span>
</td>
</td>
<td></td>
<td>
{{item.description}}
</td>
<td
class=
"main-color cursor"
>
<span
(
click
)="
goToDiscovery
(
item
)"
>
{{item.discoveriesCount}}
</span>
</td>
<td
class=
"handle main-color"
>
<td
class=
"handle main-color"
>
<span
(
click
)="
showBasicCheckModal
(
item
.
templateid
,
item
.
host
)"
>
添加监测点
</span>
<span
(
click
)="
showBasicCheckModal
(
item
.
templateid
,
item
.
host
)"
>
添加监测点
</span>
<span
(
click
)="
showDiscoveryAddModal
(
item
.
templateid
,
item
.
host
)"
>
添加自动发现
</span>
<span
(
click
)="
editBasicModal
(
item
)"
>
编辑
</span>
<span
(
click
)="
editBasicModal
(
item
)"
>
编辑
</span>
<span
(
click
)="
showDeleteConfirm
(
item
)"
>
删除
</span>
<span
(
click
)="
showDeleteConfirm
(
item
)"
>
删除
</span>
<nz-dropdown
[
nzTrigger
]="'
click
'"
class=
"table-dropdown"
>
<span
(
click
)="
showAlarm
(
item
)"
>
添加告警
</span>
<a
nz-dropdown
>
更多
<i
class=
"anticon anticon-down"
></i>
</a>
<ul
nz-menu
nzSelectable
>
<li
nz-menu-item
(
click
)="
goDetail
(
item
)"
><a>
查看监测点
</a></li>
<li
(
click
)="
showAlarm
(
item
)"
nz-menu-item
><a>
添加告警
</a></li>
</ul>
</nz-dropdown>
</td>
</td>
</tr>
</tr>
</ng-container>
</ng-container>
...
...
src/main/webapp/app/overAll/template/template.component.ts
View file @
0ea9cfa4
...
@@ -173,11 +173,27 @@ export class TemplateComponent implements OnInit {
...
@@ -173,11 +173,27 @@ export class TemplateComponent implements OnInit {
this
.
smartStrategy
.
showEditModal
(
"编辑模版"
,
item
.
templateid
);
this
.
smartStrategy
.
showEditModal
(
"编辑模版"
,
item
.
templateid
);
}
}
//
添加
监测点
//
模版
监测点
showBasicCheckModal
(
hostid
,
host
)
{
showBasicCheckModal
(
hostid
,
host
)
{
this
.
smartCheck
.
showAddModal
(
hostid
,
host
,
"添加模版监测点"
);
this
.
smartCheck
.
showAddModal
(
hostid
,
host
,
"添加模版监测点"
);
}
}
//添加自动发现
showDiscoveryAddModal
(
item
){
this
.
smartDiscovery
.
showAddModal
(
item
.
templateid
,
"添加自动发现"
)
}
//goto 自动发现页面
goToDiscovery
(
item
){
this
.
router
.
navigate
([
'app/main/discoveryList'
],
{
queryParams
:
{
hostId
:
item
.
templateid
,
name
:
item
.
name
,
hostName
:
item
.
host
}
});
}
toTree
(
index
)
{
toTree
(
index
)
{
this
.
dataSet
.
forEach
(
item
=>
{
this
.
dataSet
.
forEach
(
item
=>
{
this
.
expandDataCache
[
item
.
host
]
=
this
.
convertTreeToList
(
item
,
item
.
id
,
index
);
this
.
expandDataCache
[
item
.
host
]
=
this
.
convertTreeToList
(
item
,
item
.
id
,
index
);
...
...
src/main/webapp/app/overAll/template/trigger-list/trigger-list.component.html
0 → 100644
View file @
0ea9cfa4
<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"
></div>
</div>
<nz-table
#
nzTable
[
nzData
]="
childrenList
"
>
<thead>
<tr>
<th
nzShowCheckbox
[
nzIndeterminate
]="
indeterminate
"
[
nzChecked
]="
allChecked
"
(
nzCheckedChange
)="
checkAll
($
event
)"
></th>
<th>
名称
</th>
<th>
监控项
</th>
<th>
阈值
</th>
<th>
键值
</th>
<th>
间隔
</th>
<th>
类型
</th>
<th>
状态
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of childrenList"
>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
selectItem
(
data
,$
event
)"
></td>
<td
class=
"round-tag tag-form"
>
{{data.inventoryNo}}
</td>
<td>
{{data.name}}
</td>
<td>
{{data.inventorycount}}
</td>
<td>
{{data.stock}}
</td>
<td>
{{data.usedcount}}
</td>
<td>
{{data.lendcount}}
</td>
<td>
{{data.repaircount}}
</td>
</tr>
</tbody>
</nz-table>
\ No newline at end of file
src/main/webapp/app/overAll/template/trigger-list/trigger-list.component.ts
0 → 100644
View file @
0ea9cfa4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'smart-trigger-list'
,
templateUrl
:
'./trigger-list.component.html'
,
styles
:
[]
})
export
class
TriggerListComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
()
{
}
}
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