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
f1f6d9b7
Commit
f1f6d9b7
authored
Dec 10, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
58553072
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
537 additions
and
324 deletions
+537
-324
app.route.ts
src/main/webapp/app/app.route.ts
+6
-0
basi-check.component.html
...ain/webapp/app/modal/basi-check/basi-check.component.html
+247
-235
basi-check.component.ts
src/main/webapp/app/modal/basi-check/basi-check.component.ts
+112
-75
basic.component.html
src/main/webapp/app/overAll/basic/basic.component.html
+13
-8
overAll.service.ts
src/main/webapp/app/overAll/overAll.service.ts
+12
-2
work-handle.component.html
...in/webapp/app/work/work-handle/work-handle.component.html
+97
-3
work-handle.component.ts
...main/webapp/app/work/work-handle/work-handle.component.ts
+4
-0
work.service.ts
src/main/webapp/app/work/work.service.ts
+46
-1
No files found.
src/main/webapp/app/app.route.ts
View file @
f1f6d9b7
...
@@ -20,6 +20,9 @@ import {FlowTrendComponent} from './netTopology/flow-trend/flow-trend.component'
...
@@ -20,6 +20,9 @@ import {FlowTrendComponent} from './netTopology/flow-trend/flow-trend.component'
import
{
NetworkCheckComponent
}
from
'./overAll/network-check/network-check.component'
;
import
{
NetworkCheckComponent
}
from
'./overAll/network-check/network-check.component'
;
import
{
NetworkDetailComponent
}
from
'./overAll/network-check/network-detail/network-detail.component'
;
import
{
NetworkDetailComponent
}
from
'./overAll/network-check/network-detail/network-detail.component'
;
import
{
TopologyImgComponent
}
from
'./netTopology/topology-img/topology-img.component'
;
import
{
TopologyImgComponent
}
from
'./netTopology/topology-img/topology-img.component'
;
import
{
WorkHandleComponent
}
from
'./work/work-handle/work-handle.component'
;
import
{
InspectPlanComponent
}
from
'./work/inspect-plan/inspect-plan.component'
;
import
{
AssetPartComponent
}
from
'./work/asset-part/asset-part.component'
;
export
const
route
:
Routes
=
[
export
const
route
:
Routes
=
[
{
path
:
''
,
component
:
JhiMainComponent
,
canActivate
:[
LoginGuard
]},
{
path
:
''
,
component
:
JhiMainComponent
,
canActivate
:[
LoginGuard
]},
...
@@ -47,6 +50,9 @@ export const route: Routes = [
...
@@ -47,6 +50,9 @@ export const route: Routes = [
{
path
:
'neTopology'
,
component
:
NeTopologyComponent
},
{
path
:
'neTopology'
,
component
:
NeTopologyComponent
},
{
path
:
'flowTrend'
,
component
:
FlowTrendComponent
},
{
path
:
'flowTrend'
,
component
:
FlowTrendComponent
},
{
path
:
'topoImg'
,
component
:
TopologyImgComponent
},
{
path
:
'topoImg'
,
component
:
TopologyImgComponent
},
{
path
:
'workHandle'
,
component
:
WorkHandleComponent
},
{
path
:
'inspectPlan'
,
component
:
InspectPlanComponent
},
{
path
:
'assetPart'
,
component
:
AssetPartComponent
},
]
]
},
},
]
]
...
...
src/main/webapp/app/modal/basi-check/basi-check.component.html
View file @
f1f6d9b7
<section>
<section>
<nz-modal
[
nzWidth
]="
880
"
[(
nzVisible
)]="
isCheck
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleCheckCancel
()"
<nz-modal
[
nzWidth
]="
880
"
[
nzFooter
]="
null
"
[
(
nzVisible
)]="
isCheck
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleCheckCancel
()"
(
nzOnOk
)="
handleCheckOk
()"
>
(
nzOnOk
)="
handleCheckOk
()"
>
<form
nz-form
>
<div
style=
"padding: 16px;font-size: 18px;"
>
基本属性
</div>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"name"
>
监测点名称
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"name"
name=
"name"
type=
"text"
nz-input
[(
ngModel
)]="
validateForm
.
name
"
>
<!--<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=
"type"
>
类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"type"
name=
"type"
nzPlaceHolder=
"选择类型"
[(
ngModel
)]="
validateForm
.
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-option
nzValue=
"15"
nzLabel=
"可计算的"
></nz-option>
<nz-option
nzValue=
"18"
nzLabel=
"相关项目"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"interfaceid"
>
主机接口
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"interfaceid"
[(
ngModel
)]="
validateForm
.
interfaceid
"
nzPlaceHolder=
"选择主机接口"
>
<nz-option
*
ngFor=
"let item of interfaceList"
nzValue=
"{{item.interfaceid}}"
nzLabel=
"{{item.ip}}:{{item.port}}"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<ng-container
*
ngIf=
"validateForm.type == 1 || validateForm.type == 4 || validateForm.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
[(
ngModel
)]="
validateForm
.
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
[(
ngModel
)]="
validateForm
.
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
"
>
<input
id=
"key_"
style=
"width: 85%;display: inline-block"
placeholder=
"输入键值"
type=
"text"
name=
"key_"
nz-input
[(
ngModel
)]="
validateForm
.
key_
"
>
<button
nz-button
nzType=
"primary"
(
click
)="
showKeymodal
()"
>
选择
</button>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"value_type"
>
信息类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"value_type"
[(
ngModel
)]="
validateForm
.
value_type
"
nzPlaceHolder=
"请选择信息类型"
>
<nz-option
nzValue=
"1"
nzLabel=
"数字"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"浮点数"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"字符"
></nz-option>
<nz-option
nzValue=
"4"
nzLabel=
"日志"
></nz-option>
<nz-option
nzValue=
"5"
nzLabel=
"文本"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"datatype"
>
数据类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"datatype"
[(
ngModel
)]="
validateForm
.
data_type
"
nzPlaceHolder=
"请选择数据类型"
>
<nz-option
nzValue=
"0"
nzLabel=
"十进制"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"八进制"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"二进制"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"布尔"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"units"
>
单位
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"units"
name=
"units"
type=
"text"
nz-input
[(
ngModel
)]="
validateForm
.
units
"
>
<!--<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=
"itemtype"
>
监测点分类
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
style=
"width: 80%;display: inline-block"
nzPlaceHolder=
"选择监测点分类"
name=
"itemtype"
[(
ngModel
)]="
validateForm
.
applicationids
"
>
<nz-option
*
ngFor=
"let item of checkList"
nzValue=
"{{item.applicationid}}"
nzLabel=
"{{item.name}}"
></nz-option>
</nz-select>
<button
nz-button
nzType=
"primary"
(
click
)="
showTypeModal
()"
>
新建分类
</button>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"multiple"
>
使用自定义倍数
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"multiple"
name=
"multiple"
type=
"text"
placeholder=
"输入倍数"
nz-input
[(
ngModel
)]="
validateForm
.
formula
"
>
<!--<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=
"delay"
>
数据更新间隔
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"delay"
name=
"delay"
type=
"text"
placeholder=
"输入数据更新间隔"
nz-input
[(
ngModel
)]="
validateForm
.
delay
"
>
<!--<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=
"interval"
>
自定义时间间隔
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"interval1"
name=
"interval1"
placeholder=
"输入自定义时间间隔"
type=
"text"
nz-input
[(
ngModel
)]="
interval
"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
历史数据保留时长(单位天)
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
nzFor=
"history"
>
<input
type=
"text"
name=
"history"
id=
"history"
placeholder=
"输入历史数据保留时长"
nz-input
[(
ngModel
)]="
validateForm
.
history
"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
趋势数据存储周期(单位天)
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
type=
"text"
name=
"trends"
nz-input
[(
ngModel
)]="
validateForm
.
trends
"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
存储值
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
type=
"text"
name=
"storagevalue"
nz-input
[(
ngModel
)]="
validateForm
.
delta
"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
查看值
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
type=
"text"
nz-input
name=
"valuemapid"
[(
ngModel
)]="
validateForm
.
valuemapid
"
>
</nz-form-control>
</nz-form-item>
</form>
<div
style=
"padding: 16px;font-size: 18px;"
>
阈值设置
</div>
<nz-tabset
[
nzSelectedIndex
]="
tabNum
"
style=
"padding-bottom: 25px;min-height: 500px"
>
<nz-tab
nzTitle=
"基本属性"
nzDisabled=
"true"
>
<nz-form-item
nzFlex
>
<form
[
formGroup
]="
validateForm
"
nz-form
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
<nz-form-item>
<nz-radio-group
[(
ngModel
)]="
conditionType
"
>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"name"
>
监测点名称
</nz-form-label>
<label
nz-radio-button
nzValue=
"commonly"
><span>
常规
</span></label>
<nz-form-control
[
nzSpan
]="
14
"
>
<label
nz-radio-button
nzValue=
"high"
><span>
高级
</span></label>
<input
id=
"name"
name=
"name"
type=
"text"
nz-input
formControlName=
"name"
>
</nz-radio-group>
<nz-form-explain
*
ngIf=
"validateForm.get('name').dirty && validateForm.get('name').errors"
>
请输入监测点名称!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<ng-container
*
ngIf=
"conditionType == 'commonly'"
>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"type"
>
类型
</nz-form-label>
<nz-form-item
class=
"form-select"
*
ngFor=
"let fault of faultConditionList;let i = index;"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-label
[
nzSpan
]="
6
"
*
ngIf=
"!fault.and"
>
危险阈值
</nz-form-label>
<nz-select
name=
"type"
name=
"type"
nzPlaceHolder=
"选择类型"
formControlName=
"type"
>
<nz-form-label
nzOffset=
"3"
[
nzSpan
]="
3
"
*
ngIf=
"fault.and"
>
<nz-option
nzValue=
"0"
nzLabel=
"Agent客户端"
></nz-option>
<nz-select
name=
"interfaces_main"
[(
ngModel
)]="
fault
.
and
"
>
<nz-option
nzValue=
"7"
nzLabel=
"Agent客户端(主动式)"
></nz-option>
<nz-option
nzValue=
"&"
nzLabel=
"并且"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"简单检查"
></nz-option>
<nz-option
nzValue=
"||"
nzLabel=
"或"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"SNMPv1 客户端"
></nz-option>
</nz-select>
<nz-option
nzValue=
"4"
nzLabel=
"SNMPv2 客户端"
></nz-option>
</nz-form-label>
<nz-option
nzValue=
"6"
nzLabel=
"SNMPv3 客户端"
></nz-option>
<nz-form-control
[
nzSpan
]="
18
"
class=
"form-select"
>
<nz-option
nzValue=
"5"
nzLabel=
"Agent内部"
></nz-option>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-option
nzValue=
"2"
nzLabel=
"Agent采集器"
></nz-option>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-option
nzValue=
"8"
nzLabel=
"Agent整合"
></nz-option>
<button
class=
"tag-button"
nz-button
nzType=
"default"
>
返回值
</button>
<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-option
nzValue=
"15"
nzLabel=
"可计算的"
></nz-option>
<nz-option
nzValue=
"18"
nzLabel=
"相关项目"
></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>
<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
*
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
"
>
<input
id=
"key_"
style=
"width: 85%;display: inline-block"
placeholder=
"输入键值"
type=
"text"
name=
"key_"
nz-input
formControlName=
"key_"
>
<button
nz-button
nzType=
"primary"
(
click
)="
showKeymodal
()"
>
选择
</button>
<nz-form-explain
*
ngIf=
"validateForm.get('key_').dirty && validateForm.get('key_').errors"
>
请选择键值!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
</nz-form-item>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
equal
"
>
<nz-form-item>
<nz-option
nzValue=
"="
nzLabel=
"="
></nz-option>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"value_type"
>
信息类型
</nz-form-label>
<nz-option
nzValue=
">"
nzLabel=
">"
></nz-option>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-option
nzValue=
"<"
nzLabel=
"<"
></nz-option>
<nz-select
name=
"value_type"
formControlName=
"value_type"
nzPlaceHolder=
"请选择信息类型"
>
<nz-option
nzValue=
"1"
nzLabel=
"数字"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"浮点数"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"字符"
></nz-option>
<nz-option
nzValue=
"4"
nzLabel=
"日志"
></nz-option>
<nz-option
nzValue=
"5"
nzLabel=
"文本"
></nz-option>
</nz-select>
</nz-select>
<nz-form-explain
*
ngIf=
"validateForm.get('value_type').dirty && validateForm.get('value_type').errors"
>
请选择信息类型!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
</nz-form-item>
<input
type=
"text"
placeholder=
"值"
nz-input
name=
"value"
[(
ngModel
)]="
fault
.
value
"
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"data_type"
>
数据类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"data_type"
formControlName=
"data_type"
nzPlaceHolder=
"请选择数据类型"
>
<nz-option
nzValue=
"0"
nzLabel=
"十进制"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"八进制"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"二进制"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"布尔"
></nz-option>
</nz-select>
<nz-form-explain
*
ngIf=
"validateForm.get('data_type').dirty && validateForm.get('data_type').errors"
>
请选择数据类型!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"units"
>
单位
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"units"
name=
"units"
type=
"text"
nz-input
formControlName=
"units"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"itemtype"
>
监测点分类
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
style=
"width: 80%;display: inline-block"
nzPlaceHolder=
"选择监测点分类"
name=
"itemtype"
formControlName=
"applicationids"
>
<nz-option
*
ngFor=
"let item of checkList"
nzValue=
"{{item.applicationid}}"
nzLabel=
"{{item.name}}"
></nz-option>
</nz-select>
<button
nz-button
nzType=
"primary"
(
click
)="
showTypeModal
()"
>
新建分类
</button>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
</nz-form-item>
<button
*
ngIf=
"i == 0"
nz-button
nzType=
"primary"
(
click
)="
addFault
()"
>
添加条件
</button>
<nz-form-item>
<button
*
ngIf=
"i > 0"
nz-button
nzType=
"primary"
(
click
)="
deleteFault
(
i
)"
>
删除条件
</button>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"formula"
>
使用自定义倍数
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"formula"
name=
"formula"
type=
"text"
placeholder=
"输入倍数"
nz-input
formControlName=
"formula"
>
<nz-form-explain
*
ngIf=
"validateForm.get('formula').dirty && validateForm.get('formula').errors"
>
请输入自定义倍数!
</nz-form-explain>
</nz-form-control>
</nz-form-control>
</div>
</nz-form-item>
</nz-form-control>
</nz-form-item>
<nz-form-item
class=
"form-select"
*
ngFor=
"let fault of conditionList;let i = index;"
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
*
ngIf=
"!fault.and"
>
故障阈值
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"delay"
>
数据更新间隔
</nz-form-label>
<nz-form-label
nzOffset=
"3"
[
nzSpan
]="
3
"
*
ngIf=
"fault.and"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"interfaces_main"
[(
ngModel
)]="
fault
.
and
"
>
<input
id=
"delay"
name=
"delay"
type=
"text"
placeholder=
"输入数据更新间隔"
nz-input
<nz-option
nzValue=
"&"
nzLabel=
"并且"
></nz-option>
formControlName=
"delay"
>
<nz-option
nzValue=
"||"
nzLabel=
"或"
></nz-option>
<nz-form-explain
*
ngIf=
"validateForm.get('delay').dirty && validateForm.get('delay').errors"
>
请输入数据更新间隔!
</nz-form-explain>
</nz-select>
</nz-form-label>
<nz-form-control
[
nzSpan
]="
18
"
class=
"form-select"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<button
class=
"tag-button"
nz-button
nzType=
"default"
>
返回值
</button>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
</nz-form-item>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
equal
"
>
<nz-option
nzValue=
"="
nzLabel=
"="
></nz-option>
<!--<nz-form-item>-->
<nz-option
nzValue=
">"
nzLabel=
">"
></nz-option>
<!--<nz-form-label [nzSpan]="6" nzFor="interval">自定义时间间隔</nz-form-label>-->
<nz-option
nzValue=
"<"
nzLabel=
"<"
></nz-option>
<!--<nz-form-control [nzSpan]="14">-->
<!--<input id="interval" name="interval" placeholder="输入自定义时间间隔" type="text" nz-input-->
<!--formControlName="interval">-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
历史数据保留时长(单位天)
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
nzFor=
"history"
>
<input
type=
"text"
name=
"history"
id=
"history"
placeholder=
"输入历史数据保留时长"
nz-input
formControlName=
"history"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
趋势数据存储周期(单位天)
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
type=
"text"
name=
"trends"
nz-input
formControlName=
"trends"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
存储值
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
type=
"text"
name=
"storagevalue"
nz-input
formControlName=
"delta"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
查看值
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
type=
"text"
nz-input
name=
"valuemapid"
formControlName=
"valuemapid"
>
</nz-form-control>
</nz-form-item>
</form>
<div
class=
"modal-footer-btn"
>
<button
nz-button
(
click
)="
handleCheckOk
()"
nzType=
"primary"
>
下一步
</button>
</div>
</nz-tab>
<nz-tab
nzTitle=
"阈值设置"
nzDisabled=
"true"
>
<nz-form-item
nzFlex
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
<nz-radio-group
[(
ngModel
)]="
conditionType
"
>
<label
nz-radio-button
nzValue=
"commonly"
><span>
常规
</span></label>
<label
nz-radio-button
nzValue=
"high"
><span>
高级
</span></label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
<ng-container
*
ngIf=
"conditionType == 'commonly'"
>
<nz-form-item
class=
"form-select"
*
ngFor=
"let fault of faultConditionList;let i = index;"
>
<nz-form-label
[
nzSpan
]="
6
"
*
ngIf=
"!fault.and"
>
危险阈值
</nz-form-label>
<nz-form-label
nzOffset=
"3"
[
nzSpan
]="
3
"
*
ngIf=
"fault.and"
>
<nz-select
name=
"interfaces_main"
[(
ngModel
)]="
fault
.
and
"
>
<nz-option
nzValue=
"&"
nzLabel=
"并且"
></nz-option>
<nz-option
nzValue=
"||"
nzLabel=
"或"
></nz-option>
</nz-select>
</nz-select>
</nz-form-label>
<nz-form-control
[
nzSpan
]="
18
"
class=
"form-select"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<button
class=
"tag-button"
nz-button
nzType=
"default"
>
返回值
</button>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
equal
"
>
<nz-option
nzValue=
"="
nzLabel=
"="
></nz-option>
<nz-option
nzValue=
">"
nzLabel=
">"
></nz-option>
<nz-option
nzValue=
"<"
nzLabel=
"<"
></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<input
type=
"text"
placeholder=
"值"
nz-input
name=
"value"
[(
ngModel
)]="
fault
.
value
"
>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<button
*
ngIf=
"i == 0"
nz-button
nzType=
"primary"
(
click
)="
addFault
()"
>
添加条件
</button>
<button
*
ngIf=
"i > 0"
nz-button
nzType=
"primary"
(
click
)="
deleteFault
(
i
)"
>
删除条件
</button>
</nz-form-control>
</div>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
</nz-form-item>
<input
type=
"text"
placeholder=
"值"
nz-input
name=
"value"
[(
ngModel
)]="
fault
.
value
"
>
<nz-form-item
class=
"form-select"
*
ngFor=
"let fault of conditionList;let i = index;"
>
<nz-form-label
[
nzSpan
]="
6
"
*
ngIf=
"!fault.and"
>
故障阈值
</nz-form-label>
<nz-form-label
nzOffset=
"3"
[
nzSpan
]="
3
"
*
ngIf=
"fault.and"
>
<nz-select
name=
"interfaces_main"
[(
ngModel
)]="
fault
.
and
"
>
<nz-option
nzValue=
"&"
nzLabel=
"并且"
></nz-option>
<nz-option
nzValue=
"||"
nzLabel=
"或"
></nz-option>
</nz-select>
</nz-form-label>
<nz-form-control
[
nzSpan
]="
18
"
class=
"form-select"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<button
class=
"tag-button"
nz-button
nzType=
"default"
>
返回值
</button>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
equal
"
>
<nz-option
nzValue=
"="
nzLabel=
"="
></nz-option>
<nz-option
nzValue=
">"
nzLabel=
">"
></nz-option>
<nz-option
nzValue=
"<"
nzLabel=
"<"
></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<input
type=
"text"
placeholder=
"值"
nz-input
name=
"value"
[(
ngModel
)]="
fault
.
value
"
>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<button
*
ngIf=
"i == 0"
nz-button
nzType=
"primary"
(
click
)="
addcondition
()"
>
添加条件
</button>
<button
*
ngIf=
"i > 0"
nz-button
nzType=
"primary"
(
click
)="
deleteCondition
(
i
)"
>
删除条件
</button>
</nz-form-control>
</div>
</nz-form-control>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
</nz-form-item>
<button
*
ngIf=
"i == 0"
nz-button
nzType=
"primary"
(
click
)="
addcondition
()"
>
添加条件
</button>
</ng-container>
<button
*
ngIf=
"i > 0"
nz-button
nzType=
"primary"
(
click
)="
deleteCondition
(
i
)"
>
删除条件
</button>
<ng-container
*
ngIf=
"conditionType == 'high'"
>
<nz-form-item
nzFlex
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
<p>
危险阈值
</p>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
triggerObj
.
condition
"
></textarea>
<p>
故障阈值
</p>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
triggerObj
.
faultCondition
"
></textarea>
</nz-form-control>
</nz-form-control>
</div>
</nz-form-item>
</nz-form-control>
</nz-form-item>
</ng-container>
<ng-container
*
ngIf=
"conditionType == 'high'"
>
<nz-form-item
nzFlex
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
<p>
危险阈值
</p>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
validateForm
.
condition_high
"
></textarea>
<p>
故障阈值
</p>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
validateForm
.
faultCondition_high
"
></textarea>
</nz-form-control>
</nz-form-item>
</ng-container>
</ng-container>
<div
class=
"modal-footer-btn"
>
<button
nz-button
(
click
)="
handEditleOk
()"
nzType=
"primary"
>
完成
</button>
</div>
</nz-tab>
</nz-tabset>
</nz-modal>
</nz-modal>
</section>
</section>
...
...
src/main/webapp/app/modal/basi-check/basi-check.component.ts
View file @
f1f6d9b7
import
{
Component
,
EventEmitter
,
OnInit
,
Output
,
ViewChild
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
OnInit
,
Output
,
ViewChild
}
from
'@angular/core'
;
import
{
OverAllService
}
from
'../../overAll/overAll.service'
;
import
{
OverAllService
}
from
'../../overAll/overAll.service'
;
import
{
import
{
FormBuilder
,
FormBuilder
,
FormControl
,
FormGroup
,
FormGroup
,
Validators
Validators
}
from
'@angular/forms'
;
}
from
'@angular/forms'
;
...
@@ -20,7 +20,11 @@ import {NewTypeComponent} from '../new-type/new-type.component';
...
@@ -20,7 +20,11 @@ import {NewTypeComponent} from '../new-type/new-type.component';
color: rgba(0, 0, 0, 0.65);
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
background-color: #fff;
border-color: #d9d9d9;
border-color: #d9d9d9;
}`
}
:host ::ng-deep .ant-tabs-nav .ant-tabs-tab-disabled{
color: rgba(0,0,0,.65);
}
`
]
]
})
})
export
class
BasiCheckComponent
implements
OnInit
{
export
class
BasiCheckComponent
implements
OnInit
{
...
@@ -33,7 +37,7 @@ export class BasiCheckComponent implements OnInit {
...
@@ -33,7 +37,7 @@ export class BasiCheckComponent implements OnInit {
hostId
;
//主机ID
hostId
;
//主机ID
itemId
;
//监控项id
itemId
;
//监控项id
interfaceList
:
any
[];
interfaceList
:
any
[];
validateForm
;
validateForm
:
FormGroup
;
checkList
;
//监测点分类
checkList
;
//监测点分类
interval
;
//间隔时长
interval
;
//间隔时长
conditionType
=
'commonly'
;
conditionType
=
'commonly'
;
...
@@ -51,38 +55,41 @@ export class BasiCheckComponent implements OnInit {
...
@@ -51,38 +55,41 @@ export class BasiCheckComponent implements OnInit {
value
:
''
,
value
:
''
,
}
}
];
//故障list
];
//故障list
tabNum
:
number
;
triggerObj
=
{
condition
:
''
,
faultCondition
:
''
,
itemName
:
''
};
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
)
{
private
message
:
NzMessageService
)
{
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
tabNum
=
0
;
this
.
initForm
();
this
.
initForm
();
}
}
initForm
(){
initForm
(){
this
.
validateForm
=
{
this
.
validateForm
=
this
.
fb
.
group
({
hostid
:
this
.
hostId
,
hostid
:[
null
],
name
:
null
,
name
:[
null
,[
Validators
.
required
]],
interfaceid
:
null
,
interfaceid
:[
null
,[
Validators
.
required
]],
key_
:
null
,
key_
:[
null
,[
Validators
.
required
]],
value_type
:
null
,
value_type
:[
null
,[
Validators
.
required
]],
type
:
null
,
type
:[
null
,[
Validators
.
required
]],
data_type
:
null
,
data_type
:[
null
,[
Validators
.
required
]],
units
:
null
,
units
:[
null
],
history
:
'100'
,
formula
:[
null
,[
Validators
.
required
]],
trends
:
null
,
history
:[
null
],
valuemapid
:
null
,
trends
:[
null
],
delay
:
null
,
valuemapid
:[
null
],
snmp_oid
:
null
,
delay
:[
null
,[
Validators
.
required
]],
snmp_community
:
null
,
snmp_oid
:[
null
],
condition_commonly
:
null
,
//故障
snmp_community
:[
null
],
condition_high
:
null
,
//故障
delta
:[
null
],
faultCondition_commonly
:
null
,
//危险
applicationids
:[
null
],
faultCondition_high
:
null
,
//危险
})
delta
:
null
,
formula
:
null
,
applicationids
:
null
};
}
}
//新增
//新增
...
@@ -109,11 +116,12 @@ export class BasiCheckComponent implements OnInit {
...
@@ -109,11 +116,12 @@ export class BasiCheckComponent implements OnInit {
this
.
overAllSer
.
findItemDetail
(
id
).
subscribe
(
this
.
overAllSer
.
findItemDetail
(
id
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
this
.
validateForm
=
res
.
data
[
0
];
this
.
validateForm
=
res
.
data
[
0
];
this
.
validateForm
.
type
=
this
.
validateForm
.
type
+
''
;
this
.
validateForm
.
patchValue
(
res
.
date
[
0
]);
this
.
validateForm
.
interfaceid
=
this
.
validateForm
.
interfaceid
+
""
;
// this.validateForm.type = this.validateForm.type +'';
this
.
validateForm
.
value_type
=
this
.
validateForm
.
value_type
+
""
;
// this.validateForm.interfaceid = this.validateForm.interfaceid +"";
this
.
validateForm
.
data_type
=
this
.
validateForm
.
data_type
+
""
;
// this.validateForm.value_type = this.validateForm.value_type +"";
this
.
validateForm
.
applicationids
=
this
.
validateForm
.
applications
[
0
].
applicationid
+
""
;
// this.validateForm.data_type = this.validateForm.data_type +"";
// this.validateForm.applicationids = this.validateForm.applications[0].applicationid +"";
}
}
);
);
...
@@ -140,55 +148,31 @@ export class BasiCheckComponent implements OnInit {
...
@@ -140,55 +148,31 @@ export class BasiCheckComponent implements OnInit {
}
}
//添加
//添加
handleCheckOk
():
void
{
handleCheckOk
()
{
const
data
=
{
for
(
let
i
in
this
.
validateForm
.
controls
)
{
hostid
:
this
.
hostId
,
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
name
:
this
.
validateForm
.
name
,
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
interfaceid
:
this
.
validateForm
.
interfaceid
,
key_
:
this
.
validateForm
.
key_
,
value_type
:
Number
(
this
.
validateForm
.
value_type
),
type
:
Number
(
this
.
validateForm
.
type
),
data_type
:
Number
(
this
.
validateForm
.
data_type
),
units
:
this
.
validateForm
.
units
,
history
:
this
.
validateForm
.
history
,
trends
:
this
.
validateForm
.
trends
,
valuemapid
:
this
.
validateForm
.
valuemapid
,
delay
:
this
.
validateForm
.
delay
,
snmp_oid
:
this
.
validateForm
.
snmp_oid
,
snmp_community
:
this
.
validateForm
.
snmp_community
,
condition
:
''
,
//故障
faultCondition
:
''
,
//危险
delta
:
Number
(
this
.
validateForm
.
delta
),
formula
:
this
.
validateForm
.
formula
,
applicationids
:
[
this
.
validateForm
.
applicationids
]
};
if
(
this
.
conditionType
==
'commonly'
)
{
//常规
this
.
conditionList
.
forEach
(
res
=>
{
data
.
condition
+=
'{'
+
this
.
validateForm
.
name
+
':'
+
this
.
validateForm
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
});
this
.
faultConditionList
.
forEach
(
res
=>
{
data
.
faultCondition
+=
'{'
+
this
.
validateForm
.
name
+
':'
+
this
.
validateForm
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
});
}
else
{
//高级
data
.
condition
=
this
.
validateForm
.
condition_high
;
data
.
faultCondition
=
this
.
validateForm
.
faultCondition_high
;
}
}
if
(
this
.
validateForm
.
invalid
){
return
false
;
}
this
.
validateForm
.
value
.
applicationids
=
[
this
.
validateForm
.
value
.
applicationids
];
if
(
this
.
title
==
"添加监测点"
){
if
(
this
.
title
==
"添加监测点"
){
this
.
create
(
data
);
this
.
create
();
}
}
if
(
this
.
title
==
"编辑监测点"
){
if
(
this
.
title
==
"编辑监测点"
){
this
.
update
(
data
);
this
.
update
();
}
}
}
}
create
(
data
){
create
(){
this
.
overAllSer
.
create
(
data
).
subscribe
(
this
.
overAllSer
.
create
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
errCode
==
10000
)
{
this
.
isCheck
=
false
;
// this.isCheck = false;
this
.
initForm
();
// this.initForm();
this
.
done
.
emit
();
// this.done.emit();
this
.
tabNum
=
1
;
}
}
this
.
message
.
info
(
res
.
errMsg
);
this
.
message
.
info
(
res
.
errMsg
);
},
},
...
@@ -198,9 +182,11 @@ export class BasiCheckComponent implements OnInit {
...
@@ -198,9 +182,11 @@ export class BasiCheckComponent implements OnInit {
);
);
}
}
update
(
data
){
//修改监控项
data
.
itemid
=
this
.
itemId
;
update
(){
this
.
overAllSer
.
itemUpdata
(
data
).
subscribe
(
this
.
validateForm
.
addControl
(
'itemid'
,
new
FormControl
(
this
.
itemId
));
// data.itemid = this.itemId;
this
.
overAllSer
.
itemUpdata
(
this
.
validateForm
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
errCode
==
10000
)
{
this
.
isCheck
=
false
;
this
.
isCheck
=
false
;
...
@@ -281,6 +267,57 @@ export class BasiCheckComponent implements OnInit {
...
@@ -281,6 +267,57 @@ export class BasiCheckComponent implements OnInit {
}
}
getKey
(
keyValue
):
void
{
getKey
(
keyValue
):
void
{
this
.
validateForm
.
key_
=
keyValue
;
this
.
validateForm
.
value
.
key_
=
keyValue
;
}
}
//阈值--start
save
(){
const
data
=
{
condition
:
''
,
faultCondition
:
''
};
if
(
this
.
conditionType
==
'commonly'
)
{
//常规
this
.
conditionList
.
forEach
(
res
=>
{
data
.
condition
+=
'{'
+
this
.
validateForm
.
value
.
name
+
':'
+
this
.
validateForm
.
value
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
});
this
.
faultConditionList
.
forEach
(
res
=>
{
data
.
faultCondition
+=
'{'
+
this
.
validateForm
.
value
.
name
+
':'
+
this
.
validateForm
.
value
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
});
}
else
{
//高级
data
.
condition
=
this
.
validateForm
.
value
.
condition_high
;
data
.
faultCondition
=
this
.
validateForm
.
value
.
faultCondition_high
;
}
if
(
this
.
title
==
"添加监测点"
){
this
.
createTrigger
(
data
);
}
if
(
this
.
title
==
"编辑监测点"
){
this
.
updateTrigger
(
data
);
}
}
//1.创建阈值
createTrigger
(
data
){
const
res
=
{
itemName
:
this
.
validateForm
.
value
.
name
,
faultCondition
:
data
.
faultCondition
,
condition
:
data
.
condition
};
this
.
overAllSer
.
createTrigger
(
res
).
subscribe
(
res
=>
{
})
}
//2.修改阈值
updateTrigger
(
data
){
const
res
=
{
triggerid
:
''
,
itemName
:
this
.
validateForm
.
value
.
name
,
faultCondition
:
data
.
faultCondition
,
condition
:
data
.
condition
};
this
.
overAllSer
.
updateTrigger
(
data
).
subscribe
(
res
=>
{
})
}
//阈值--end
}
}
src/main/webapp/app/overAll/basic/basic.component.html
View file @
f1f6d9b7
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
<th
[
nzChecked
]="
allChecked
"
></th>
<th
[
nzChecked
]="
allChecked
"
></th>
<th>
名称
</th>
<th>
名称
</th>
<th>
告警状态
</th>
<th>
告警状态
</th>
<th>
关联资产
</th>
<th
nzWidth=
"20%"
>
状态
</th>
<th
nzWidth=
"20%"
>
状态
</th>
<th>
可用性
</th>
<th>
可用性
</th>
<th>
操作
</th>
<th>
操作
</th>
...
@@ -105,10 +106,11 @@
...
@@ -105,10 +106,11 @@
</ng-container>
</ng-container>
<td
class=
"round-tag"
>
<td
class=
"round-tag"
>
<nz-tag
*
ngIf=
"item.maxLevel == 4 || item.maxLevel == 5"
[
nzColor
]="
'#
fc0d1b
'
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 4 || item.maxLevel == 5"
[
nzColor
]="
color
.
red
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 2 || item.maxLevel == 3"
[
nzColor
]="
'#
fd9827
'
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 2 || item.maxLevel == 3"
[
nzColor
]="
col
.
yellow
"
></nz-tag>
<
span
*
ngIf=
"item.maxLevel < 2"
>
正常
</span
>
<
nz-tag
*
ngIf=
"item.maxLevel < 2"
[
nzColor
]="
col
.
green
"
></nz-tag
>
</td>
</td>
<td>
关联资产
</td>
<td>
<td>
<span
*
ngIf=
"item.status == 0"
>
已监控
</span>
<span
*
ngIf=
"item.status == 0"
>
已监控
</span>
<span
*
ngIf=
"item.status == 1"
>
未监控
</span>
<span
*
ngIf=
"item.status == 1"
>
未监控
</span>
...
@@ -172,6 +174,7 @@
...
@@ -172,6 +174,7 @@
<li
(
click
)="
showTempStop
(
item
)"
nz-menu-item
><a>
临时暂停
</a></li>
<li
(
click
)="
showTempStop
(
item
)"
nz-menu-item
><a>
临时暂停
</a></li>
<li
(
click
)="
goDetail
(
item
)"
nz-menu-item
><a>
查看监测点
</a></li>
<li
(
click
)="
goDetail
(
item
)"
nz-menu-item
><a>
查看监测点
</a></li>
<li
(
click
)="
showAlarm
(
item
)"
nz-menu-item
><a>
添加告警
</a></li>
<li
(
click
)="
showAlarm
(
item
)"
nz-menu-item
><a>
添加告警
</a></li>
<li
(
click
)="
showAlarm
(
item
)"
nz-menu-item
><a>
关联资产
</a></li>
</ul>
</ul>
</nz-dropdown>
</nz-dropdown>
</ng-container>
</ng-container>
...
@@ -204,10 +207,11 @@
...
@@ -204,10 +207,11 @@
</ng-container>
</ng-container>
<td
class=
"round-tag tag-form"
>
<td
class=
"round-tag tag-form"
>
<nz-tag
*
ngIf=
"item.maxLevel == 4 || item.maxLevel == 5"
[
nzColor
]="
'#
fc0d1b
'
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 4 || item.maxLevel == 5"
[
nzColor
]="
color
.
red
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 2 || item.maxLevel == 3"
[
nzColor
]="
'#
fd9827
'
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 2 || item.maxLevel == 3"
[
nzColor
]="
color
.
yellow
"
></nz-tag>
<
span
*
ngIf=
"item.maxLevel < 2"
>
正常
</span
>
<
nz-tag
*
ngIf=
"item.maxLevel < 2"
[
nzColor
]="
color
.
green
"
></nz-tag
>
</td>
</td>
<td>
关联资产
</td>
<td>
<td>
<span
*
ngIf=
"item.status == 0"
>
已监控
</span>
<span
*
ngIf=
"item.status == 0"
>
已监控
</span>
<span
*
ngIf=
"item.status == 1"
>
未监控
</span>
<span
*
ngIf=
"item.status == 1"
>
未监控
</span>
...
@@ -243,7 +247,6 @@
...
@@ -243,7 +247,6 @@
<ng-container
*
ngIf=
"item.jmx_available == 2"
>
<ng-container
*
ngIf=
"item.jmx_available == 2"
>
<nz-tag
[
nzColor
]="'#
d44f51
'"
>
JMX
</nz-tag>
<nz-tag
[
nzColor
]="'#
d44f51
'"
>
JMX
</nz-tag>
</ng-container>
</ng-container>
<ng-container
*
ngIf=
"item.ipmi_available == 0"
>
<ng-container
*
ngIf=
"item.ipmi_available == 0"
>
<nz-tag>
IPMI
</nz-tag>
<nz-tag>
IPMI
</nz-tag>
</ng-container>
</ng-container>
...
@@ -298,12 +301,14 @@
...
@@ -298,12 +301,14 @@
<td
class=
"round-tag tag-form"
>
<td
class=
"round-tag tag-form"
>
<nz-tag
*
ngIf=
"item.maxLevel == 4 || item.maxLevel == 5"
[
nzColor
]="
color
.
red
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 4 || item.maxLevel == 5"
[
nzColor
]="
color
.
red
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 2 || item.maxLevel == 3"
[
nzColor
]="
color
.
yellow
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 2 || item.maxLevel == 3"
[
nzColor
]="
color
.
yellow
"
></nz-tag>
<
span
*
ngIf=
"item.maxLevel < 2"
>
正常
</span
>
<
nz-tag
*
ngIf=
"item.maxLevel < 2"
[
nzColor
]="
color
.
green
"
></nz-tag
>
</td>
</td>
<td>
关联资产
</td>
<td>
<td>
<span
*
ngIf=
"item.status == 0"
>
已监控
</span>
<span
*
ngIf=
"item.status == 0"
>
已监控
</span>
<span
*
ngIf=
"item.status == 1"
>
未监控
</span>
<span
*
ngIf=
"item.status == 1"
>
未监控
</span>
</td>
</td>
<td>
<td>
<ng-container
*
ngIf=
"item.level"
>
<ng-container
*
ngIf=
"item.level"
>
<ng-container
*
ngIf=
"item.available == 0"
>
<ng-container
*
ngIf=
"item.available == 0"
>
...
...
src/main/webapp/app/overAll/overAll.service.ts
View file @
f1f6d9b7
...
@@ -298,4 +298,15 @@ export class OverAllService {
...
@@ -298,4 +298,15 @@ export class OverAllService {
findTree
():
Observable
<
any
>
{
findTree
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/hostType/findTree'
);
return
this
.
http
.
get
(
SERVER_API_URL
+
'/hostType/findTree'
);
}
}
}
\ No newline at end of file
//创建触发器
createTrigger
(
data
){
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/createItemTrigger'
,
data
);
}
//修改触发器
updateTrigger
(
data
){
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/updateItemTrigger'
,
data
);
}
}
src/main/webapp/app/work/work-handle/work-handle.component.html
View file @
f1f6d9b7
<p>
<div
nz-row
class=
"breadcrumbs"
>
work-handle works!
<div
nz-col
nzSpan=
"16"
>
</p>
<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>
</div>
<div
nz-col
nzSpan=
"8"
class=
"text-right"
>
<button
nz-button
nzType=
"primary"
><i
class=
"anticon anticon-search"
></i></button>
<button
nz-button
nzType=
"primary"
><i
class=
"anticon anticon-sync"
></i></button>
<button
nz-button
nzType=
"primary"
><i
class=
"anticon anticon-arrows-alt"
></i></button>
</div>
</div>
<div
nz-row
[
nzGutter
]="
4
"
class=
"search-form"
>
<div
nz-col
nzSpan=
"3"
>
<nz-select
style=
"width: 100%;"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"事件分类"
>
<nz-option
nzLabel=
"告警"
nzValue=
"告警"
></nz-option>
<nz-option
nzLabel=
"严重"
nzValue=
"严重"
></nz-option>
</nz-select>
</div>
<div
nz-col
nzSpan=
"3"
>
<nz-select
style=
"width: 100%;"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"事件状态"
>
<nz-option
nzLabel=
""
nzValue=
""
></nz-option>
</nz-select>
</div>
<div
nz-col
nzSpan=
"3"
>
<nz-select
style=
"width: 100%;"
nzShowSearch
nzAllowClear
nzPlaceHolder=
"事件来源"
>
<nz-option
nzLabel=
""
nzValue=
""
></nz-option>
</nz-select>
</div>
<div
nz-col
nzSpan=
"8"
>
<nz-date-picker
nzShowTime
[
nzFormat
]="
timeFormat
"
[(
ngModel
)]="
timeBegin
"
nzPlaceHolder=
"开始时间"
></nz-date-picker>
<nz-date-picker
nzShowTime
[
nzFormat
]="
timeFormat
"
[(
ngModel
)]="
timeEnd
"
nzPlaceHolder=
"结束时间"
></nz-date-picker>
</div>
<div
nz-col
nzSpan=
"3"
>
<button
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
新增事件
</button>
</div>
</div>
<nz-table
#
nzTable
[
nzData
]="
eventList
"
>
<thead>
<tr>
<th>
事件编号
</th>
<th>
标题
</th>
<th>
时间
</th>
<th>
时间来源
</th>
<th>
事件分类
</th>
<th>
处理人
</th>
<th>
状态
</th>
<th
style=
"text-align: center"
>
操作
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of eventList"
>
<td
class=
"round-tag tag-form"
>
{{data.description}}
</td>
<td>
<span
*
ngIf=
"data.type == 0"
>
邮件
</span>
<span
*
ngIf=
"data.type == 1"
>
脚本
</span>
<span
*
ngIf=
"data.type == 2"
>
SMS
</span>
<span
*
ngIf=
"data.type == 3"
>
Jabber
</span>
<span
*
ngIf=
"data.type == 100"
>
EZ texting
</span>
</td>
<td>
用于告警中
</td>
<td>
用于告警中
</td>
<td>
用于告警中
</td>
<td>
<span
*
ngIf=
"data.status == 0"
>
启用
</span>
<span
*
ngIf=
"data.status == 1"
>
暂停
</span>
</td>
<td>
细节
</td>
<td
class=
"handle text-center"
>
<span
(
click
)="
showEditModal
(
data
)"
>
编辑
</span>
<span
(
click
)="
deleteSend
(
data
)"
>
删除
</span>
<span
(
click
)="
operationSend
('启用',
0
,
data
)"
*
ngIf=
"data.status == 1"
>
启用
</span>
<span
(
click
)="
operationSend
('暂停',
1
,
data
)"
*
ngIf=
"data.status == 0"
>
暂停
</span>
</td>
</tr>
</tbody>
</nz-table>
\ No newline at end of file
src/main/webapp/app/work/work-handle/work-handle.component.ts
View file @
f1f6d9b7
...
@@ -7,6 +7,10 @@ import { Component, OnInit } from '@angular/core';
...
@@ -7,6 +7,10 @@ import { Component, OnInit } from '@angular/core';
})
})
export
class
WorkHandleComponent
implements
OnInit
{
export
class
WorkHandleComponent
implements
OnInit
{
timeFormatL
=
'yyyy-MM-dd'
;
eventList
;
timeBegin
;
timeEnd
;
constructor
()
{
}
constructor
()
{
}
ngOnInit
()
{
ngOnInit
()
{
...
...
src/main/webapp/app/work/work.service.ts
View file @
f1f6d9b7
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs/Rx'
;
import
{
SERVER_API_URL
}
from
'../app.constants'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
@
Injectable
()
@
Injectable
()
export
class
WorkService
{
export
class
WorkService
{
constructor
()
{
}
constructor
(
private
http
:
HttpClient
)
{
}
//事件转派
transfer
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/sysevent/transfer'
,
data
);
}
//修改事件
update
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/sysevent/update'
,
data
);
}
//删除事件
delete
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/sysevent/delete'
,
data
);
}
//查找事件列表
find
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/sysevent/find'
,
data
);
}
//根据事件编号查询
findByNo
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/sysevent/find/'
+
params
);
}
//添加事件
create
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/sysevent/create'
,
data
);
}
//事件信息流转记录查询接口
transferInfo
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/sysevent/transferInfo/'
+
params
);
}
//处理事件
deal
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/sysevent/deal'
,
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