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
cfb94508
Commit
cfb94508
authored
Jan 12, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4a988a1f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
64 additions
and
37 deletions
+64
-37
discovery.component.html
src/main/webapp/app/modal/discovery/discovery.component.html
+2
-2
discovery.component.ts
src/main/webapp/app/modal/discovery/discovery.component.ts
+6
-7
strategy.component.ts
src/main/webapp/app/modal/strategy/strategy.component.ts
+17
-2
check-list.component.html
...app/overAll/template/check-list/check-list.component.html
+9
-6
check-list.component.ts
...p/app/overAll/template/check-list/check-list.component.ts
+1
-1
check-prototype.component.html
...late/modal/check-prototype/check-prototype.component.html
+1
-2
trigger-prototype.component.ts
...te/modal/trigger-prototype/trigger-prototype.component.ts
+24
-15
trigger-list.component.html
...overAll/template/trigger-list/trigger-list.component.html
+3
-1
trigger-list.component.ts
...p/overAll/template/trigger-list/trigger-list.component.ts
+1
-1
No files found.
src/main/webapp/app/modal/discovery/discovery.component.html
View file @
cfb94508
...
...
@@ -33,7 +33,7 @@
</nz-form-item>
<ng-container
*
ngIf=
"isInterface"
>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nz
Required
nz
For=
"interfaceid"
>
主机接口
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
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}}"
...
...
@@ -67,7 +67,7 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nz
Required
nz
For=
"port"
>
端口
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
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>
...
...
src/main/webapp/app/modal/discovery/discovery.component.ts
View file @
cfb94508
...
...
@@ -27,8 +27,6 @@ export class DiscoveryComponent implements OnInit {
checkList
;
//监测点分类
interval
;
//间隔时长
tabNum
:
number
;
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
)
{
}
...
...
@@ -38,7 +36,6 @@ export class DiscoveryComponent implements OnInit {
}
initForm
()
{
this
.
tabNum
=
0
;
this
.
validateForm
=
this
.
fb
.
group
({
hostid
:
[
this
.
hostId
],
name
:
[
null
,
[
Validators
.
required
]],
...
...
@@ -74,7 +71,7 @@ export class DiscoveryComponent implements OnInit {
this
.
hostId
=
hostId
;
this
.
isVisiable
=
true
;
this
.
itemId
=
discoveryid
;
this
.
overAllSer
.
find
ItemDetail
(
discoveryid
).
subscribe
(
this
.
overAllSer
.
find
Lldrule
(
discoveryid
).
subscribe
(
(
res
)
=>
{
const
data
=
res
.
data
[
0
];
data
.
type
+=
''
;
...
...
@@ -102,7 +99,10 @@ export class DiscoveryComponent implements OnInit {
this
.
message
.
error
(
'请输入必填信息'
);
return
false
;
}
this
.
validateForm
.
value
.
status
=
this
.
validateForm
.
value
.
status
?
1
:
0
;
let
d
=
this
.
validateForm
.
value
.
status
==
true
?
1
:
0
;
this
.
validateForm
.
patchValue
({
status
:
d
})
this
.
validateForm
.
value
.
hostid
=
this
.
hostId
;
if
(
this
.
title
==
'添加自动发现'
)
{
this
.
create
();
...
...
@@ -118,7 +118,6 @@ export class DiscoveryComponent implements OnInit {
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'创建自动发现成功'
);
this
.
done
.
emit
();
this
.
tabNum
=
1
;
this
.
isVisiable
=
false
;
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
...
...
@@ -133,12 +132,12 @@ export class DiscoveryComponent implements OnInit {
//修改监控项
update
()
{
this
.
validateForm
.
addControl
(
'itemid'
,
new
FormControl
(
this
.
itemId
));
console
.
log
(
this
.
validateForm
.
value
);
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
);
...
...
src/main/webapp/app/modal/strategy/strategy.component.ts
View file @
cfb94508
...
...
@@ -21,6 +21,7 @@ export class StrategyComponent implements OnInit {
validateForm
;
tempId
;
//模版Id
templateList
=
[];
//模版组
templatesResoure
;
//old模版
tempList
;
//模版
...
...
@@ -116,9 +117,12 @@ export class StrategyComponent implements OnInit {
if
(
data
.
parentTemplates
)
{
//模版回显
this
.
validateForm
.
templates
=
data
.
parentTemplates
.
map
(
e
=>
{
let
tempArr
=
[];
tempArr
=
data
.
parentTemplates
.
map
(
e
=>
{
return
e
.
templateid
;
});
this
.
validateForm
.
templates
=
tempArr
;
this
.
templatesResoure
=
tempArr
;
}
}
);
...
...
@@ -191,6 +195,16 @@ export class StrategyComponent implements OnInit {
}
update
(
arr
)
{
//比较监控模版是否发生变化
const
clearArr
=
[];
this
.
templatesResoure
.
forEach
(
res
=>
{
if
(
this
.
validateForm
.
templates
.
indexOf
(
res
)
==
-
1
)
{
const
d
=
{
templateid
:
res
}
clearArr
.
push
(
d
);
}
});
const
data
=
{
templateid
:
this
.
tempId
,
//模版id
host
:
this
.
validateForm
.
host
,
...
...
@@ -202,7 +216,8 @@ export class StrategyComponent implements OnInit {
};
return
d
;
}),
macros
:
[],
templates_clear
:
clearArr
,
macros
:
this
.
validateForm
.
macros
,
hosts
:
[],
};
this
.
overAllSer
.
updateTemplates
(
data
).
subscribe
(
...
...
src/main/webapp/app/overAll/template/check-list/check-list.component.html
View file @
cfb94508
...
...
@@ -28,7 +28,9 @@
<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-col
nzSpan=
"3"
>
<button
(
click
)="
deleteBatchCheck
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-close-circle-o"
></i>
批量删除
</button>
</div>
</div>
<nz-table
#
nzTable
[
nzData
]="
checkList
"
[
nzFrontPagination
]="
false
"
[
nzTotal
]="
totalNum
"
[
nzPageIndex
]="
pageNum
"
[
nzPageSize
]="
pageCount
"
(
nzPageIndexChange
)="
change
($
event
)"
[
nzLoading
]="
loading
"
>
...
...
@@ -38,7 +40,6 @@
<th>
名称
</th>
<th>
键值
</th>
<th>
间隔
</th>
<th>
类型
</th>
<th>
状态
</th>
<th>
操作
</th>
</tr>
...
...
@@ -49,11 +50,13 @@
<td
class=
"round-tag tag-form"
>
{{data.name}}
</td>
<td>
{{data.key_}}
</td>
<td>
{{data.usedcount}}
</td>
<td>
{{data.type}}
</td>
<td>
{{data.status}}
</td>
<td>
<span>
编辑
</span>
<span>
删除
</span>
<span
*
ngIf=
"data.status == 0"
>
启用
</span>
<span
*
ngIf=
"data.status == 1"
>
禁用
</span>
</td>
<td
class=
"main-color cursor"
>
<span
(
click
)="
showEditModal
(
data
)"
>
编辑
</span>
<span
(
click
)="
deleteCheck
(
data
)"
>
删除
</span>
</td>
</tr>
</tbody>
...
...
src/main/webapp/app/overAll/template/check-list/check-list.component.ts
View file @
cfb94508
...
...
@@ -110,7 +110,7 @@ export class CheckListComponent implements OnInit {
//单个删除
deleteCheck
(
item
)
{
this
.
commonSer
.
confirmThing
(
'删除'
,
'确定删除当前的
自动发现
'
,
()
=>
{
this
.
commonSer
.
confirmThing
(
'删除'
,
'确定删除当前的
监控项原型
'
,
()
=>
{
const
data
=
{
ids
:
[]
};
...
...
src/main/webapp/app/overAll/template/modal/check-prototype/check-prototype.component.html
View file @
cfb94508
...
...
@@ -105,12 +105,11 @@
<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"
<nz-select
nzPlaceHolder=
"选择监测点分类"
name=
"itemtype"
[
nzSize
]="
nzSize
"
nzMode=
"tags"
formControlName=
"applications"
>
<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>
...
...
src/main/webapp/app/overAll/template/modal/trigger-prototype/trigger-prototype.component.ts
View file @
cfb94508
...
...
@@ -4,9 +4,9 @@ import {OverAllService} from '../../../overAll.service';
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
@
Component
({
selector
:
'smart-trigger-prototype'
,
templateUrl
:
'./trigger-prototype.component.html'
,
styles
:
[]
selector
:
'smart-trigger-prototype'
,
templateUrl
:
'./trigger-prototype.component.html'
,
styles
:
[]
})
export
class
TriggerPrototypeComponent
implements
OnInit
{
...
...
@@ -31,10 +31,10 @@ export class TriggerPrototypeComponent implements OnInit {
initForm
()
{
this
.
triggerObj
=
{
expression
:
""
,
priority
:
"2"
,
description
:
""
}
expression
:
''
,
priority
:
'2'
,
description
:
''
}
;
}
//新增
...
...
@@ -45,14 +45,17 @@ export class TriggerPrototypeComponent implements OnInit {
}
//编辑
showEditModal
(
title
,
id
,
hostName
)
{
showEditModal
(
title
,
id
,
hostName
)
{
this
.
title
=
title
;
this
.
triggerId
=
id
;
this
.
isVisiable
=
true
;
this
.
hostName
=
hostName
;
this
.
overAllSer
.
findTriggerById
(
id
).
subscribe
(
(
res
)
=>
{
const
data
=
res
.
data
[
0
];
this
.
triggerObj
.
expression
=
data
.
expression
;
this
.
triggerObj
.
description
=
data
.
description
;
this
.
triggerObj
.
priority
=
data
.
priority
+
''
;
}
);
}
...
...
@@ -63,7 +66,7 @@ export class TriggerPrototypeComponent implements OnInit {
this
.
message
.
error
(
'请输入阈值'
);
return
false
;
}
if
(
this
.
title
==
"新增阈值原型"
)
{
if
(
this
.
title
==
'新增阈值原型'
)
{
this
.
createTrigger
();
}
if
(
this
.
title
==
'编辑阈值原型'
)
{
...
...
@@ -73,10 +76,10 @@ export class TriggerPrototypeComponent implements OnInit {
//校验是否填值
checkFun
()
{
if
(
!
this
.
triggerObj
.
expression
)
{
this
.
message
.
error
(
"请输入表达式"
);
return
false
;
}
if
(
!
this
.
triggerObj
.
expression
)
{
this
.
message
.
error
(
'请输入表达式'
);
return
false
;
}
return
true
;
}
...
...
@@ -98,7 +101,13 @@ export class TriggerPrototypeComponent implements OnInit {
//2.修改阈值
updateTrigger
()
{
this
.
overAllSer
.
updateTriggerPrototype
(
this
.
triggerObj
).
subscribe
(
res
=>
{
const
data
=
{
triggerid
:
this
.
triggerId
,
expression
:
this
.
triggerObj
.
expression
,
priority
:
this
.
triggerObj
.
priority
,
description
:
this
.
triggerObj
.
description
};
this
.
overAllSer
.
updateTriggerPrototype
(
data
).
subscribe
(
res
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'修改阈值成功'
);
this
.
initForm
();
...
...
src/main/webapp/app/overAll/template/trigger-list/trigger-list.component.html
View file @
cfb94508
...
...
@@ -28,7 +28,9 @@
<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-col
nzSpan=
"3"
>
<button
(
click
)="
deleteBatchTrigger
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-close-circle-o"
></i>
批量删除
</button>
</div>
</div>
<nz-table
#
nzTable
[
nzData
]="
triggerList
"
[
nzFrontPagination
]="
false
"
[
nzTotal
]="
totalNum
"
[
nzPageIndex
]="
pageNum
"
[
nzPageSize
]="
pageCount
"
(
nzPageIndexChange
)="
change
($
event
)"
[
nzLoading
]="
loading
"
>
...
...
src/main/webapp/app/overAll/template/trigger-list/trigger-list.component.ts
View file @
cfb94508
...
...
@@ -104,7 +104,7 @@ export class TriggerListComponent implements OnInit {
}
showEditModal
(
data
)
{
this
.
smartTriggerPrototype
.
showEditModal
(
'编辑阈值原型'
,
data
.
id
,
this
.
tempName
);
this
.
smartTriggerPrototype
.
showEditModal
(
'编辑阈值原型'
,
data
.
trigger
id
,
this
.
tempName
);
}
//单个删除
...
...
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