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
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
341 additions
and
127 deletions
+341
-127
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
+52
-40
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
+11
-0
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'
import
{
NetworkCheckComponent
}
from
'./overAll/network-check/network-check.component'
;
import
{
NetworkDetailComponent
}
from
'./overAll/network-check/network-detail/network-detail.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
=
[
{
path
:
''
,
component
:
JhiMainComponent
,
canActivate
:[
LoginGuard
]},
...
...
@@ -47,6 +50,9 @@ export const route: Routes = [
{
path
:
'neTopology'
,
component
:
NeTopologyComponent
},
{
path
:
'flowTrend'
,
component
:
FlowTrendComponent
},
{
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>
<nz-modal
[
nzWidth
]="
880
"
[(
nzVisible
)]="
isCheck
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleCheckCancel
()"
<nz-modal
[
nzWidth
]="
880
"
[
nzFooter
]="
null
"
[
(
nzVisible
)]="
isCheck
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleCheckCancel
()"
(
nzOnOk
)="
handleCheckOk
()"
>
<form
nz-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"
>
<form
[
formGroup
]="
validateForm
"
nz-form
>
<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>--
>
<input
id=
"name"
name=
"name"
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=
"选择类型"
[(
ngModel
)]="
validateForm
.
type
"
>
<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>
...
...
@@ -32,22 +34,24 @@
<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"
[(
ngModel
)]="
validateForm
.
interfaceid
"
nzPlaceHolder=
"选择主机接口"
>
<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.type == 1 || validateForm.type == 4 || validateForm
.type == 6"
>
<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
[(
ngModel
)]="
validateForm
.
snmp_oid
"
>
<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>
...
...
@@ -55,7 +59,7 @@
<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
"
>
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>
...
...
@@ -64,45 +68,47 @@
<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_
"
>
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-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-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-form-explain
*
ngIf=
"validateForm.get('value_type').dirty && validateForm.get('value_type').errors"
>
请选择信息类型!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"data
type"
>
数据类型
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"data_
type"
>
数据类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"datatype"
[(
ngModel
)]="
validateForm
.
data_type
"
nzPlaceHolder=
"请选择数据类型"
>
<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
[(
ngModel
)]="
validateForm
.
units
"
>
<!--<nz-form-explain *ngIf="validateForm.get('note').dirty && validateForm.get('note').errors">Please input your username!</nz-form-explain>-->
<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"
[(
ngModel
)]="
validateForm
.
applicationids
"
>
formControlName=
"
applicationids"
>
<nz-option
*
ngFor=
"let item of checkList"
nzValue=
"{{item.applicationid}}"
nzLabel=
"{{item.name}}"
></nz-option>
</nz-select>
...
...
@@ -110,11 +116,11 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"multiple
"
>
使用自定义倍数
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"formula
"
>
使用自定义倍数
</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>--
>
<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-item>
...
...
@@ -122,49 +128,51 @@
<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>--
>
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
"
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" nzFor="interval">自定义时间间隔</nz-form-label>--
>
<!--<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
[(
ngModel
)]="
validateForm
.
history
"
>
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
[(
ngModel
)]="
validateForm
.
trends
"
>
<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
[(
ngModel
)]="
validateForm
.
delta
"
>
<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"
[(
ngModel
)]="
validateForm
.
valuemapid
"
>
<input
type=
"text"
nz-input
name=
"valuemapid"
formControlName=
"
valuemapid"
>
</nz-form-control>
</nz-form-item>
</form>
<div
style=
"padding: 16px;font-size: 18px;"
>
阈值设置
</div>
<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
"
>
...
...
@@ -173,7 +181,6 @@
</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>
...
...
@@ -241,13 +248,18 @@
<nz-form-item
nzFlex
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
<p>
危险阈值
</p>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
validateForm
.
condition_high
"
></textarea>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
triggerObj
.
condition
"
></textarea>
<p>
故障阈值
</p>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
validateForm
.
faultCondition_high
"
></textarea>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
triggerObj
.
faultCondition
"
></textarea>
</nz-form-control>
</nz-form-item>
</ng-container>
<div
class=
"modal-footer-btn"
>
<button
nz-button
(
click
)="
handEditleOk
()"
nzType=
"primary"
>
完成
</button>
</div>
</nz-tab>
</nz-tabset>
</nz-modal>
</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
{
OverAllService
}
from
'../../overAll/overAll.service'
;
import
{
FormBuilder
,
FormBuilder
,
FormControl
,
FormGroup
,
Validators
}
from
'@angular/forms'
;
...
...
@@ -20,7 +20,11 @@ import {NewTypeComponent} from '../new-type/new-type.component';
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
border-color: #d9d9d9;
}`
}
:host ::ng-deep .ant-tabs-nav .ant-tabs-tab-disabled{
color: rgba(0,0,0,.65);
}
`
]
})
export
class
BasiCheckComponent
implements
OnInit
{
...
...
@@ -33,7 +37,7 @@ export class BasiCheckComponent implements OnInit {
hostId
;
//主机ID
itemId
;
//监控项id
interfaceList
:
any
[];
validateForm
;
validateForm
:
FormGroup
;
checkList
;
//监测点分类
interval
;
//间隔时长
conditionType
=
'commonly'
;
...
...
@@ -51,38 +55,41 @@ export class BasiCheckComponent implements OnInit {
value
:
''
,
}
];
//故障list
tabNum
:
number
;
triggerObj
=
{
condition
:
''
,
faultCondition
:
''
,
itemName
:
''
};
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
)
{
}
ngOnInit
()
{
this
.
tabNum
=
0
;
this
.
initForm
();
}
initForm
(){
this
.
validateForm
=
{
hostid
:
this
.
hostId
,
name
:
null
,
interfaceid
:
null
,
key_
:
null
,
value_type
:
null
,
type
:
null
,
data_type
:
null
,
units
:
null
,
history
:
'100'
,
trends
:
null
,
valuemapid
:
null
,
delay
:
null
,
snmp_oid
:
null
,
snmp_community
:
null
,
condition_commonly
:
null
,
//故障
condition_high
:
null
,
//故障
faultCondition_commonly
:
null
,
//危险
faultCondition_high
:
null
,
//危险
delta
:
null
,
formula
:
null
,
applicationids
:
null
};
this
.
validateForm
=
this
.
fb
.
group
({
hostid
:[
null
],
name
:[
null
,[
Validators
.
required
]],
interfaceid
:[
null
,[
Validators
.
required
]],
key_
:[
null
,[
Validators
.
required
]],
value_type
:[
null
,[
Validators
.
required
]],
type
:[
null
,[
Validators
.
required
]],
data_type
:[
null
,[
Validators
.
required
]],
units
:[
null
],
formula
:[
null
,[
Validators
.
required
]],
history
:[
null
],
trends
:[
null
],
valuemapid
:[
null
],
delay
:[
null
,[
Validators
.
required
]],
snmp_oid
:[
null
],
snmp_community
:[
null
],
delta
:[
null
],
applicationids
:[
null
],
})
}
//新增
...
...
@@ -109,11 +116,12 @@ export class BasiCheckComponent implements OnInit {
this
.
overAllSer
.
findItemDetail
(
id
).
subscribe
(
(
res
)
=>
{
this
.
validateForm
=
res
.
data
[
0
];
this
.
validateForm
.
type
=
this
.
validateForm
.
type
+
''
;
this
.
validateForm
.
interfaceid
=
this
.
validateForm
.
interfaceid
+
""
;
this
.
validateForm
.
value_type
=
this
.
validateForm
.
value_type
+
""
;
this
.
validateForm
.
data_type
=
this
.
validateForm
.
data_type
+
""
;
this
.
validateForm
.
applicationids
=
this
.
validateForm
.
applications
[
0
].
applicationid
+
""
;
this
.
validateForm
.
patchValue
(
res
.
date
[
0
]);
// this.validateForm.type = this.validateForm.type +'';
// this.validateForm.interfaceid = this.validateForm.interfaceid +"";
// this.validateForm.value_type = this.validateForm.value_type +"";
// 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 {
}
//添加
handleCheckOk
():
void
{
const
data
=
{
hostid
:
this
.
hostId
,
name
:
this
.
validateForm
.
name
,
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
;
handleCheckOk
()
{
for
(
let
i
in
this
.
validateForm
.
controls
)
{
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
}
if
(
this
.
validateForm
.
invalid
){
return
false
;
}
this
.
validateForm
.
value
.
applicationids
=
[
this
.
validateForm
.
value
.
applicationids
];
if
(
this
.
title
==
"添加监测点"
){
this
.
create
(
data
);
this
.
create
();
}
if
(
this
.
title
==
"编辑监测点"
){
this
.
update
(
data
);
this
.
update
();
}
}
create
(
data
){
this
.
overAllSer
.
create
(
data
).
subscribe
(
create
(){
this
.
overAllSer
.
create
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
isCheck
=
false
;
this
.
initForm
();
this
.
done
.
emit
();
// this.isCheck = false;
// this.initForm();
// this.done.emit();
this
.
tabNum
=
1
;
}
this
.
message
.
info
(
res
.
errMsg
);
},
...
...
@@ -198,9 +182,11 @@ export class BasiCheckComponent implements OnInit {
);
}
update
(
data
){
data
.
itemid
=
this
.
itemId
;
this
.
overAllSer
.
itemUpdata
(
data
).
subscribe
(
//修改监控项
update
(){
this
.
validateForm
.
addControl
(
'itemid'
,
new
FormControl
(
this
.
itemId
));
// data.itemid = this.itemId;
this
.
overAllSer
.
itemUpdata
(
this
.
validateForm
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
isCheck
=
false
;
...
...
@@ -281,6 +267,57 @@ export class BasiCheckComponent implements OnInit {
}
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 @@
<th
[
nzChecked
]="
allChecked
"
></th>
<th>
名称
</th>
<th>
告警状态
</th>
<th>
关联资产
</th>
<th
nzWidth=
"20%"
>
状态
</th>
<th>
可用性
</th>
<th>
操作
</th>
...
...
@@ -105,10 +106,11 @@
</ng-container>
<td
class=
"round-tag"
>
<nz-tag
*
ngIf=
"item.maxLevel == 4 || item.maxLevel == 5"
[
nzColor
]="
'#
fc0d1b
'
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 2 || item.maxLevel == 3"
[
nzColor
]="
'#
fd9827
'
"
></nz-tag>
<
span
*
ngIf=
"item.maxLevel < 2"
>
正常
</span
>
<nz-tag
*
ngIf=
"item.maxLevel == 4 || item.maxLevel == 5"
[
nzColor
]="
color
.
red
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 2 || item.maxLevel == 3"
[
nzColor
]="
col
.
yellow
"
></nz-tag>
<
nz-tag
*
ngIf=
"item.maxLevel < 2"
[
nzColor
]="
col
.
green
"
></nz-tag
>
</td>
<td>
关联资产
</td>
<td>
<span
*
ngIf=
"item.status == 0"
>
已监控
</span>
<span
*
ngIf=
"item.status == 1"
>
未监控
</span>
...
...
@@ -172,6 +174,7 @@
<li
(
click
)="
showTempStop
(
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>
</ul>
</nz-dropdown>
</ng-container>
...
...
@@ -204,10 +207,11 @@
</ng-container>
<td
class=
"round-tag tag-form"
>
<nz-tag
*
ngIf=
"item.maxLevel == 4 || item.maxLevel == 5"
[
nzColor
]="
'#
fc0d1b
'
"
></nz-tag>
<nz-tag
*
ngIf=
"item.maxLevel == 2 || item.maxLevel == 3"
[
nzColor
]="
'#
fd9827
'
"
></nz-tag>
<
span
*
ngIf=
"item.maxLevel < 2"
>
正常
</span
>
<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"
[
nzColor
]="
color
.
green
"
></nz-tag
>
</td>
<td>
关联资产
</td>
<td>
<span
*
ngIf=
"item.status == 0"
>
已监控
</span>
<span
*
ngIf=
"item.status == 1"
>
未监控
</span>
...
...
@@ -243,7 +247,6 @@
<ng-container
*
ngIf=
"item.jmx_available == 2"
>
<nz-tag
[
nzColor
]="'#
d44f51
'"
>
JMX
</nz-tag>
</ng-container>
<ng-container
*
ngIf=
"item.ipmi_available == 0"
>
<nz-tag>
IPMI
</nz-tag>
</ng-container>
...
...
@@ -298,12 +301,14 @@
<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 == 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>
<span
*
ngIf=
"item.status == 0"
>
已监控
</span>
<span
*
ngIf=
"item.status == 1"
>
未监控
</span>
</td>
<td>
<ng-container
*
ngIf=
"item.level"
>
<ng-container
*
ngIf=
"item.available == 0"
>
...
...
src/main/webapp/app/overAll/overAll.service.ts
View file @
f1f6d9b7
...
...
@@ -298,4 +298,15 @@ export class OverAllService {
findTree
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/hostType/findTree'
);
}
//创建触发器
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>
work-handle works!
</p>
<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>
</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';
})
export
class
WorkHandleComponent
implements
OnInit
{
timeFormatL
=
'yyyy-MM-dd'
;
eventList
;
timeBegin
;
timeEnd
;
constructor
()
{
}
ngOnInit
()
{
...
...
src/main/webapp/app/work/work.service.ts
View file @
f1f6d9b7
import
{
Injectable
}
from
'@angular/core'
;
import
{
Observable
}
from
'rxjs/Rx'
;
import
{
SERVER_API_URL
}
from
'../app.constants'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
@
Injectable
()
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