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
bd170e8c
Commit
bd170e8c
authored
Nov 19, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
87e0dd17
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
36 deletions
+71
-36
basi-check.component.ts
src/main/webapp/app/modal/basi-check/basi-check.component.ts
+2
-2
basic-key.component.html
src/main/webapp/app/modal/basic-key/basic-key.component.html
+2
-2
basic-detail.component.html
...pp/overAll/basic/basic-detail/basic-detail.component.html
+14
-8
basic-detail.component.ts
.../app/overAll/basic/basic-detail/basic-detail.component.ts
+48
-19
overAll.service.ts
src/main/webapp/app/overAll/overAll.service.ts
+5
-5
No files found.
src/main/webapp/app/modal/basi-check/basi-check.component.ts
View file @
bd170e8c
...
...
@@ -87,7 +87,7 @@ export class BasiCheckComponent implements OnInit {
type
:
null
,
data_type
:
null
,
units
:
null
,
history
:
null
,
history
:
'100'
,
trends
:
null
,
valuemapid
:
null
,
delay
:
null
,
...
...
@@ -157,7 +157,7 @@ export class BasiCheckComponent implements OnInit {
this
.
overAllSer
.
create
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
==
10000
)
{
if
(
res
.
errCode
==
10000
)
{
this
.
isCheck
=
false
;
}
this
.
message
.
info
(
res
.
errMsg
);
...
...
src/main/webapp/app/modal/basic-key/basic-key.component.html
View file @
bd170e8c
...
...
@@ -6,8 +6,8 @@
<div
nz-col
[
nzSpan
]="
8
"
>
类型
<nz-select
name=
"select-error"
[(
ngModel
)]="
keyType
"
(
ngModelChange
)="
findList
()"
>
<nz-option
nzValue=
"1"
nzLabel=
"
zabbix
客户端"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"
zabbix
客户端(主动)"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"
Agent
客户端"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"
Agent
客户端(主动)"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"数据库监控"
></nz-option>
<nz-option
nzValue=
"4"
nzLabel=
"数据库监控 JMX_agent代理程序"
></nz-option>
<nz-option
nzValue=
"5"
nzLabel=
"简单检查"
></nz-option>
...
...
src/main/webapp/app/overAll/basic/basic-detail/basic-detail.component.html
View file @
bd170e8c
...
...
@@ -28,11 +28,11 @@
<button
nz-button
nzType=
"default"
>
删除
</button>
</div>
<div
class=
"releative"
>
<div
class=
"checkTags"
>
<span>
<nz-tag
[
nzColor
]="'#
64ad58
'"
></nz-tag>
{{checkStatus.
enable
}}
</span>
<div
class=
"checkTags
tag-form
"
>
<span>
<nz-tag
[
nzColor
]="'#
64ad58
'"
></nz-tag>
{{checkStatus.
normal
}}
</span>
<span>
<nz-tag
[
nzColor
]="'#
ed9e2e
'"
></nz-tag>
{{checkStatus.warning}}
</span>
<span>
<nz-tag
[
nzColor
]="'#
dd4127
'"
></nz-tag>
{{checkStatus.
error
}}
</span>
<span>
<nz-tag
[
nzColor
]="'#
aaaaaa
'"
></nz-tag>
{{checkStatus.disable}}
</span>
<span>
<nz-tag
[
nzColor
]="'#
dd4127
'"
></nz-tag>
{{checkStatus.
high
}}
</span>
<span>
<nz-tag
[
nzColor
]="'#
aaaaaa
'"
></nz-tag>
{{checkStatus.disable
d
}}
</span>
</div>
<nz-tabset
class=
"tabs-smart "
>
...
...
@@ -46,14 +46,14 @@
[
nzDisabled
]="
panel1
.
disabled
"
>
<div
nz-row
>
<div
class=
"releative"
nz-col
nzSpan=
"12"
>
<div
echarts
[
options
]="
chartOption1
"
style=
"height: 220px;width:
300px
"
></div>
<div
echarts
[
options
]="
chartOption1
"
style=
"height: 220px;width:
100%
"
></div>
<div
class=
"posiabsolutStr"
>
<p>
{{responseTimeStr}}
</p>
<p>
ms
</p>
</div>
</div>
<div
class=
"releative"
nz-col
nzSpan=
"12"
>
<div
echarts
[
options
]="
chartOption2
"
style=
"height: 220px;"
></div>
<div
echarts
[
options
]="
chartOption2
"
style=
"height: 220px;
width: 100%;
"
></div>
<div
class=
"posiabsolutStr"
>
<p>
{{losedStr}}
</p>
<p>
%
</p>
...
...
@@ -69,14 +69,14 @@
[
nzDisabled
]="
panel2
.
disabled
"
>
<div
nz-row
>
<div
class=
"releative"
nz-col
nzSpan=
"12"
>
<div
echarts
[
options
]="
chartOption3
"
style=
"height: 220px;"
></div>
<div
echarts
[
options
]="
chartOption3
"
style=
"height: 220px;
width: 100%;
"
></div>
<div
class=
"posiabsolutStr"
>
<p>
{{cpuUsedStr}}
</p>
<p>
%
</p>
</div>
</div>
<div
class=
"releative"
nz-col
nzSpan=
"12"
>
<div
echarts
[
options
]="
chartOption4
"
style=
"height: 220px;"
></div>
<div
echarts
[
options
]="
chartOption4
"
style=
"height: 220px;
width: 100%
"
></div>
<div
class=
"posiabsolutStr"
>
<p>
{{usedStr}}
</p>
<p>
%
</p>
...
...
@@ -158,6 +158,7 @@
<span
(
click
)="
showImageModal
(
data
)"
>
图表
</span>
</td>
<td
class=
"handle cursor"
>
<span
(
click
)="
deleteCheckItem
(
data
)"
>
编辑
</span>
<span
(
click
)="
deleteCheckItem
(
data
)"
>
删除
</span>
<span
*
ngIf=
"data.itemState == 0"
(
click
)="
updateItem
(
data
.
itemid
,
1
)"
>
停止
</span>
<span
*
ngIf=
"data.itemState == 1"
(
click
)="
updateItem
(
data
.
itemid
,
0
)"
>
启用
</span>
...
...
@@ -183,5 +184,10 @@
<smart-basi-check
#
smartCheck
></smart-basi-check>
<nz-modal
[
nzFooter
]="
null
"
nzWidth=
"1080"
[(
nzVisible
)]="
isGrapha
"
nzTitle=
""
(
nzOnCancel
)="
handleImageCancel
()"
>
<div
class=
"releative"
>
<div
class=
"time-select"
>
<nz-date-picker
[(
ngModel
)]="
imageSelectDate
"
(
ngModelChange
)="
getGraphDate
()"
[
nzSize
]="
size
"
></nz-date-picker>
</div>
<div
echarts
[
options
]="
chartOptionGrapha
"
style=
"height: 520px;width: 100%"
></div>
</div>
</nz-modal>
src/main/webapp/app/overAll/basic/basic-detail/basic-detail.component.ts
View file @
bd170e8c
...
...
@@ -7,6 +7,7 @@ import {BasiCheckComponent} from '../../../modal/basi-check/basi-check.component
import
{
NzModalService
}
from
'ng-zorro-antd'
;
import
{
pageSize
}
from
'../../../app.constants'
;
import
{
WarnListComponent
}
from
'../../../modal/warn-list/warn-list.component'
;
import
{
DatePipe
}
from
'@angular/common'
;
@
Component
({
selector
:
'jhi-basic-detail'
,
...
...
@@ -18,6 +19,12 @@ import {WarnListComponent} from '../../../modal/warn-list/warn-list.component';
top: 12px;
left: 233px;
}
.time-select{
position: absolute;
top: 55px;
right: 15px;
z-index: 999;
}
:host ::ng-deep .tabs-smart .ant-tabs-nav-scroll div.ant-tabs-tab:nth-child(3){
margin-right: 150px;
}
...
...
@@ -30,6 +37,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
@
ViewChild
(
'warnList'
)
warnList
:
WarnListComponent
;
loading
=
false
;
hostId
:
string
;
size
=
'default'
;
hostType
:
string
;
chartOption1
;
responseTimeStr
;
...
...
@@ -56,11 +64,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
checkList
:
any
[];
isCheck
=
false
;
checkStatus
=
{
disable
:
'0'
,
enable
:
'0'
,
error
:
'0'
,
warning
:
'0'
,
hostid
:
'0'
normal
:
'0'
,
disabled
:
'0'
,
high
:
'0'
};
isKey
=
false
;
...
...
@@ -69,7 +76,9 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//图表
isGrapha
=
false
;
selectGraphadata
;
chartOptionGrapha
;
imageSelectDate
=
new
Date
();
pageSize
=
pageSize
;
...
...
@@ -78,6 +87,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
totalNum
;
//总数据长度
applicationId
;
//分类ID
//进出口流量-分页
pageNum
=
1
;
totalNumInOut
;
//分页--告警
warn_totalNum
;
warn_pageNum
=
1
;
...
...
@@ -86,7 +99,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
constructor
(
private
routerInfo
:
ActivatedRoute
,
private
message
:
NzMessageService
,
private
overAllSer
:
OverAllService
,
private
renderer
:
Renderer
,
private
fb
:
FormBuilder
,
private
modalService
:
NzModalService
)
{
private
fb
:
FormBuilder
,
private
modalService
:
NzModalService
,
private
datePipe
:
DatePipe
)
{
}
ngOnInit
()
{
...
...
@@ -139,7 +152,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
title
:
{
text
:
'平均响应时间'
,
top
:
'5%'
,
left
:
'3
8
%'
,
left
:
'3
5
%'
,
textStyle
:
{
color
:
'#999'
,
fontSize
:
12
,
...
...
@@ -460,7 +473,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
},
},
data
:
res
.
data
.
disks
.
map
((
item
)
=>
{
const
pre
=
(
item
.
used
/
item
.
total
)
*
100
;
//已使用百分比
const
pre
=
(
(
item
.
used
/
item
.
total
)
*
100
).
toFixed
(
2
)
;
//已使用百分比
return
pre
;
})
},
...
...
@@ -485,9 +498,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
},
},
data
:
res
.
data
.
disks
.
map
((
item
)
=>
{
const
pre
=
(
item
.
total
-
item
.
used
)
/
(
item
.
total
)
*
100
;
//剩余百分比
// const use = (item.total - item.used)/(1024*1024*1024); //剩余空间
// const surplus = use.toFixed(2);
const
pre
=
(
(
item
.
total
-
item
.
used
)
/
(
item
.
total
)
*
100
).
toFixed
(
2
);
//剩余百分比
return
pre
;
})
},
...
...
@@ -555,12 +566,21 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
return
(
total
/
1024
/
1024
/
1024
).
toFixed
(
2
);
}
//进出口流量
//进出口流量
-SNMP
inOutInfo
()
{
this
.
overAllSer
.
inOutInfosnmp
(
this
.
hostId
).
subscribe
(
const
data
=
{
obj
:{
hostid
:
Number
(
this
.
hostId
)
},
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageSize
}
this
.
overAllSer
.
inOutInfoSnmp
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
dataSet
=
res
.
data
.
inOutInfo
;
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
}
}
);
...
...
@@ -641,14 +661,17 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
}
//删除监测点
deleteCheckItem
(
data
)
{
deleteCheckItem
(
item
)
{
this
.
modalService
.
confirm
({
nzTitle
:
'删除'
,
nzContent
:
'<b style="color: red;">确认删除该监测点吗?</b>'
,
nzOkText
:
'确定'
,
nzOkType
:
'danger'
,
nzOnOk
:
()
=>
{
this
.
overAllSer
.
deleteItem
(
data
.
hostid
).
subscribe
(
const
data
=
{
params
:[
item
.
itemid
]
};
this
.
overAllSer
.
deleteItem
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
info
(
'删除成功'
);
...
...
@@ -667,17 +690,23 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//图表
showImageModal
(
data
)
{
this
.
isGrapha
=
true
;
const
data1
=
{
date
:
'2018-10-20'
,
itemid
:
data
.
itemid
this
.
selectGraphadata
=
data
;
this
.
getGraphDate
();
}
//获取图表数据
getGraphDate
(){
const
data
=
{
date
:
this
.
datePipe
.
transform
(
this
.
imageSelectDate
,
'yyyy-MM-dd'
),
itemid
:
this
.
selectGraphadata
.
itemid
};
this
.
overAllSer
.
findGraphData
(
data
1
).
subscribe
(
this
.
overAllSer
.
findGraphData
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
&&
res
.
data
.
length
>
0
)
{
const
result
=
res
.
data
;
this
.
chartOptionGrapha
=
{
title
:
{
text
:
data
.
itemN
ame
text
:
this
.
selectGraphadata
.
n
ame
},
tooltip
:
{
trigger
:
'axis'
...
...
src/main/webapp/app/overAll/overAll.service.ts
View file @
bd170e8c
...
...
@@ -74,9 +74,9 @@ export class OverAllService {
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/disks/'
+
data
.
hostId
+
"/"
+
data
.
hostType
);
}
//进出口流量 --
交换机
inOutInfo
s
nmp
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/inOutInfo/'
+
data
);
//进出口流量 --
SNMP
inOutInfo
S
nmp
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/inOutInfo'
,
data
);
}
//进出口流量 --
...
...
@@ -165,8 +165,8 @@ export class OverAllService {
}
//监测点状态统计
findItemCount
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/item/findItem
Count/'
+
data
);
findItemCount
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/item/findItem
Statistics/'
+
params
);
}
//监测点图形数据
...
...
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