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
c1158be1
Commit
c1158be1
authored
Oct 29, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug update
parent
92dee72e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
260 deletions
+13
-260
app.constants.ts
src/main/webapp/app/app.constants.ts
+2
-1
home.component.html
src/main/webapp/app/home/home.component.html
+0
-59
home.component.ts
src/main/webapp/app/home/home.component.ts
+3
-197
basic-edit.component.html
...ain/webapp/app/modal/basic-edit/basic-edit.component.html
+0
-0
basic-edit.component.ts
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
+8
-3
No files found.
src/main/webapp/app/app.constants.ts
View file @
c1158be1
...
@@ -2,7 +2,8 @@ export const VERSION = process.env.VERSION;
...
@@ -2,7 +2,8 @@ export const VERSION = process.env.VERSION;
export
const
DEBUG_INFO_ENABLED
:
boolean
=
!!
process
.
env
.
DEBUG_INFO_ENABLED
;
export
const
DEBUG_INFO_ENABLED
:
boolean
=
!!
process
.
env
.
DEBUG_INFO_ENABLED
;
export
const
SERVER_API_URL_COMS
=
'/coms'
;
export
const
SERVER_API_URL_COMS
=
'/coms'
;
// export const SERVER_API_URL = '/anke';
// export const SERVER_API_URL = '/anke';
export
const
SERVER_API_URL
=
'/zabbixBox'
;
export
const
SERVER_API_URL
=
'/zhouxi'
;
// export const SERVER_API_URL = '/zabbixBox';
export
const
SERVER_API_URL_MONITOR
=
'/api'
;
export
const
SERVER_API_URL_MONITOR
=
'/api'
;
export
const
BUILD_TIMESTAMP
=
process
.
env
.
BUILD_TIMESTAMP
;
export
const
BUILD_TIMESTAMP
=
process
.
env
.
BUILD_TIMESTAMP
;
export
const
pageSize
=
10
;
export
const
pageSize
=
10
;
...
...
src/main/webapp/app/home/home.component.html
View file @
c1158be1
...
@@ -121,62 +121,3 @@
...
@@ -121,62 +121,3 @@
</tr>
</tr>
</tbody>
</tbody>
</nz-table>
</nz-table>
<div
nz-row
class=
"padding-15-0"
>
<div
nz-col
nzSpan=
"12"
>
<h2>
关注资源
</h2>
</div>
<div
nz-col
nzSpan=
"12"
class=
"text-right"
>
<button
nz-button
nzType=
"default"
(
click
)="
showAddFollow
()"
><i
class=
"anticon anticon-plus-circle-o"
></i>
添加资源
</button>
</div>
</div>
<div
nz-row
>
<ng-container
*
ngFor=
"let item of followList;let i = index;"
>
<div
nz-col
nzSpan=
"12"
class=
"follow"
>
<span
(
click
)="
cancel
(
i
,
item
)"
class=
"cursor calcle-follow"
><i
class=
"anticon anticon-close-circle"
></i></span>
<div
class=
"follow-container"
>
<div
class=
"follow-title"
>
<div>
<p>
{{item.name}}
<span>
类型:{{item.extendName}}
</span>
<span
style=
"margin-left: 10px"
>
IP:{{item.host}}
</span>
</p>
<p>
所在分组:
<span
style=
"margin-right: 5px;"
*
ngFor=
"let groups of item.groupName"
>
{{groups}}
</span></p>
</div>
</div>
<div
nz-row
>
<div
nz-col
nzSpan=
"12"
class=
"height-150 releative"
>
<div
class=
"container-top"
>
<p>
监测点
</p>
<p
class=
"round-tag tag-form"
>
<nz-tag
class=
"tag-red"
[
nzColor
]="
color
.
red
"
></nz-tag>
<span
style=
"margin-right: 10px"
>
{{item.item.high}}
</span>
<nz-tag
class=
"tag-yellow"
[
nzColor
]="
color
.
yellow
"
></nz-tag>
<span
style=
"margin-right: 10px"
>
{{item.item.warning}}
</span>
</p>
</div>
<div
class=
"container-bottom"
>
<p>
PING值:{{item.lose}}
</p>
</div>
</div>
<div
nz-col
nzSpan=
"12"
class=
"height-150"
echarts
[
options
]="
item
.
option
"
></div>
<div
class=
"chart-font"
>
<p>
<nz-tag
nzColor=
"#f09363"
></nz-tag>
CPU使用率 {{item.cpu}}%
</p>
<p>
<nz-tag
nzColor=
"#80ba78"
></nz-tag>
内存使用率 {{(item.memory).toFixed(2)}}%
</p>
<!--<p>-->
<!--<nz-tag nzColor="#73b6e4"></nz-tag>-->
<!--带宽使用率 {{item.lose}}%-->
<!--</p>-->
</div>
</div>
</div>
</div>
</ng-container>
</div>
<smart-select-group
#
smartSelectGroup
(
done
)="
getItem
($
event
)"
></smart-select-group>
src/main/webapp/app/home/home.component.ts
View file @
c1158be1
...
@@ -18,7 +18,6 @@ import {Router} from '@angular/router';
...
@@ -18,7 +18,6 @@ import {Router} from '@angular/router';
})
})
export
class
HomeComponent
implements
OnInit
,
AfterViewInit
{
export
class
HomeComponent
implements
OnInit
,
AfterViewInit
{
@
ViewChild
(
'smartSelectGroup'
)
smartSelectGroup
:
SelectGroupComponent
;
@
ViewChild
(
"leftDiv"
)
leftDiv
:
ElementRef
;
@
ViewChild
(
"leftDiv"
)
leftDiv
:
ElementRef
;
@
ViewChild
(
"rightDiv"
)
rightDiv
:
ElementRef
;
@
ViewChild
(
"rightDiv"
)
rightDiv
:
ElementRef
;
...
@@ -73,9 +72,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
...
@@ -73,9 +72,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
rightTotal
=
0
;
rightTotal
=
0
;
//我的关注
followList
;
//资源设备数量
//资源设备数量
deviceNo
;
deviceNo
;
...
@@ -97,8 +93,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
...
@@ -97,8 +93,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
this
.
getGroup
();
this
.
getGroup
();
this
.
getMyFollow
();
this
.
findSize
();
this
.
findSize
();
}
}
...
@@ -118,156 +112,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
...
@@ -118,156 +112,6 @@ export class HomeComponent implements OnInit,AfterViewInit {
});
});
}
}
//我的关注
getMyFollow
(){
this
.
layoutSer
.
myFollow
().
subscribe
(
(
res
)
=>
{
this
.
followList
=
res
.
data
;
if
(
this
.
followList
.
length
>
0
){
let
dataStyle
=
{
normal
:
{
label
:
{
show
:
false
},
labelLine
:
{
show
:
false
},
shadowBlur
:
40
,
borderWidth
:
10
,
shadowColor
:
'rgba(0, 0, 0, 0)'
//边框阴影
}
};
let
placeHolderStyle
=
{
normal
:
{
color
:
'#eee'
,
label
:
{
show
:
false
},
labelLine
:
{
show
:
false
}
},
emphasis
:
{
color
:
'#393d50'
}
};
this
.
followList
.
forEach
(
e
=>
{
e
.
option
=
{
backgroundColor
:
'#fff'
,
title
:
{
text
:
''
,
x
:
'center'
,
y
:
'center'
,
textStyle
:
{
fontWeight
:
'normal'
,
fontSize
:
24
,
color
:
"red"
,
}
},
tooltip
:
{
trigger
:
'item'
,
show
:
true
,
formatter
:
"{b} : <br/>{d}%"
,
backgroundColor
:
'rgba(0,0,0,0.7)'
,
// 背景
padding
:
[
8
,
10
],
//内边距
extraCssText
:
'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);'
,
//添加阴影
},
series
:
[{
name
:
'CPU使用率'
,
type
:
'pie'
,
clockWise
:
false
,
radius
:
[
50
,
58
],
center
:[
'30%'
,
'50%'
],
itemStyle
:
dataStyle
,
hoverAnimation
:
false
,
startAngle
:
90
,
label
:{
borderRadius
:
'10'
,
},
data
:
[{
value
:
e
.
cpu
,
name
:
'CPU使用率'
,
itemStyle
:
{
normal
:
{
color
:
"#f09363"
}
}
},
{
value
:
100
-
e
.
cpu
,
name
:
''
,
tooltip
:
{
show
:
false
},
itemStyle
:
placeHolderStyle
},
]
},
{
name
:
'内存使用率'
,
type
:
'pie'
,
clockWise
:
false
,
radius
:
[
35
,
43
],
center
:[
'30%'
,
'50%'
],
itemStyle
:
dataStyle
,
hoverAnimation
:
false
,
startAngle
:
90
,
data
:
[{
value
:
e
.
memory
,
name
:
'内存使用率'
,
itemStyle
:
{
normal
:
{
color
:
"#80ba78"
}
}
},
{
value
:
100
-
e
.
memory
,
name
:
''
,
tooltip
:
{
show
:
false
},
itemStyle
:
placeHolderStyle
},
]
},
// {
// name: '带宽使用率',
// type: 'pie',
// clockWise: false,
// radius: [20, 28],
// center:['30%','50%'],
// itemStyle: dataStyle,
// hoverAnimation: false,
// startAngle: 90,
// data: [{
// value: e.lose,
// name: '带宽使用率',
// itemStyle: {
// normal: {
// color: "#73b6e4"
// }
// }
// },
// {
// value: 100 - e.lose,
// name: '',
// tooltip: {
// show: false
// },
// itemStyle: placeHolderStyle
// },
// ]
// }
]
};
})
}
}
)
}
//获取分组
//获取分组
getGroup
()
{
getGroup
()
{
this
.
overAllSer
.
findGroup
().
subscribe
(
this
.
overAllSer
.
findGroup
().
subscribe
(
...
@@ -558,8 +402,7 @@ export class HomeComponent implements OnInit,AfterViewInit {
...
@@ -558,8 +402,7 @@ export class HomeComponent implements OnInit,AfterViewInit {
);
);
}
}
//获取告警分组
getAlarmList
()
{
getAlarmList
(){
this
.
loading
=
true
;
this
.
loading
=
true
;
const
data
=
{
const
data
=
{
pageNum
:
this
.
pageNum
,
pageNum
:
this
.
pageNum
,
...
@@ -571,8 +414,8 @@ export class HomeComponent implements OnInit,AfterViewInit {
...
@@ -571,8 +414,8 @@ export class HomeComponent implements OnInit,AfterViewInit {
};
};
this
.
alarmSer
.
eventFind
(
data
).
subscribe
(
this
.
alarmSer
.
eventFind
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
data
)
{
if
(
res
.
data
)
{
this
.
warnList
=
res
.
data
.
data
;
this
.
warnList
=
res
.
data
.
data
;
this
.
totalNum
=
res
.
data
.
totalNum
;
this
.
totalNum
=
res
.
data
.
totalNum
;
}
}
...
@@ -582,47 +425,10 @@ export class HomeComponent implements OnInit,AfterViewInit {
...
@@ -582,47 +425,10 @@ export class HomeComponent implements OnInit,AfterViewInit {
);
);
}
}
showAddFollow
(){
this
.
smartSelectGroup
.
showAddModal
(
"选择资源"
)
}
change
(
e
){
change
(
e
){
if
(
e
>
0
){
if
(
e
>
0
){
this
.
pageNum
=
e
;
this
.
pageNum
=
e
;
this
.
getAlarmList
();
this
.
getAlarmList
();
}
}
}
}
//设置关注
getItem
(
e
){
const
data
=
{
resourceIds
:
e
.
map
(
res
=>
{
return
res
+
""
;
})
};
this
.
layoutSer
.
addFollow
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
message
.
success
(
"添加关注成功"
);
this
.
getMyFollow
();
}
}
)
}
//取消关注
cancel
(
index
,
item
){
this
.
followList
.
splice
(
index
,
1
);
const
data
=
{
resourceIds
:[
item
.
hostId
+
""
]
};
this
.
layoutSer
.
unFollow
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
getMyFollow
();
this
.
message
.
success
(
'取消关注成功'
);
}
}
)
}
}
}
src/main/webapp/app/modal/basic-edit/basic-edit.component.html
View file @
c1158be1
This diff is collapsed.
Click to expand it.
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
View file @
c1158be1
...
@@ -130,7 +130,7 @@ export class BasicEditComponent implements OnInit {
...
@@ -130,7 +130,7 @@ export class BasicEditComponent implements OnInit {
this
.
modalTitle
=
'编辑资源'
;
this
.
modalTitle
=
'编辑资源'
;
this
.
overAllSer
.
findDetailed
(
this
.
hostId
).
subscribe
(
this
.
overAllSer
.
findDetailed
(
this
.
hostId
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
const
data
=
res
.
data
[
0
]
;
const
data
=
res
.
data
;
this
.
validateForm
.
name
=
data
.
name
;
this
.
validateForm
.
name
=
data
.
name
;
this
.
validateForm
.
host
=
data
.
host
;
this
.
validateForm
.
host
=
data
.
host
;
...
@@ -146,6 +146,13 @@ export class BasicEditComponent implements OnInit {
...
@@ -146,6 +146,13 @@ export class BasicEditComponent implements OnInit {
}
}
}
}
}
}
for
(
let
i
=
0
;
i
<
this
.
groupList
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
this
.
validateForm
.
groups
.
length
;
j
++
)
{
if
(
this
.
validateForm
.
groups
[
j
].
groupid
==
this
.
groupList
[
i
].
value
)
{
this
.
groupList
[
i
].
checked
=
true
;
}
}
}
}
}
//模版对象
//模版对象
...
@@ -162,7 +169,6 @@ export class BasicEditComponent implements OnInit {
...
@@ -162,7 +169,6 @@ export class BasicEditComponent implements OnInit {
if
(
data
.
interfaces
)
{
if
(
data
.
interfaces
)
{
this
.
interfaceslist
=
data
.
interfaces
;
this
.
interfaceslist
=
data
.
interfaces
;
this
.
interfaceslist
.
forEach
(
res
=>
{
this
.
interfaceslist
.
forEach
(
res
=>
{
res
.
main
=
res
.
main
+
''
;
res
.
type
=
res
.
type
+
''
;
res
.
type
=
res
.
type
+
''
;
});
});
}
}
...
@@ -187,7 +193,6 @@ export class BasicEditComponent implements OnInit {
...
@@ -187,7 +193,6 @@ export class BasicEditComponent implements OnInit {
if
(
data
.
inventory
)
{
if
(
data
.
inventory
)
{
this
.
validateForm
.
inventoryExtend
=
data
.
inventory
;
this
.
validateForm
.
inventoryExtend
=
data
.
inventory
;
this
.
inventoryParentId
=
data
.
inventory
.
typeparentid
;
this
.
inventoryParentId
=
data
.
inventory
.
typeparentid
;
this
.
getTypeByParent
(
this
.
inventoryParentId
);
this
.
isInVentory
=
true
;
this
.
isInVentory
=
true
;
this
.
isYesInVentory
=
'default'
;
this
.
isYesInVentory
=
'default'
;
this
.
isNOInVentory
=
'primary'
;
this
.
isNOInVentory
=
'primary'
;
...
...
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