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
d9eadc90
Commit
d9eadc90
authored
Jun 11, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容性测试
parent
bd08a093
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
219 additions
and
58 deletions
+219
-58
app.service.ts
src/main/webapp/app/app.service.ts
+1
-1
home.component.ts
src/main/webapp/app/home/home.component.ts
+215
-57
basic-edit.component.ts
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
+3
-0
No files found.
src/main/webapp/app/app.service.ts
View file @
d9eadc90
...
...
@@ -4,7 +4,7 @@ import {BehaviorSubject, Subscription} from 'rxjs';
@
Injectable
()
export
class
AppService
{
private
themeSource
:
BehaviorSubject
<
string
>
=
new
BehaviorSubject
(
'
dark
'
);
private
themeSource
:
BehaviorSubject
<
string
>
=
new
BehaviorSubject
(
'
white
'
);
public
theme
=
this
.
themeSource
.
asObservable
();
public
setTheme
(
value
:
string
){
...
...
src/main/webapp/app/home/home.component.ts
View file @
d9eadc90
...
...
@@ -17,104 +17,262 @@ import {Router} from '@angular/router';
]
})
export
class
HomeComponent
implements
OnInit
{
@
ViewChild
(
'smartTopologyView'
)
smartTopologyView
:
TopologyViewComponent
;
export
class
HomeComponent
implements
OnInit
,
AfterViewInit
{
@
ViewChild
(
'smartSelectGroup'
)
smartSelectGroup
:
SelectGroupComponent
;
@
ViewChild
(
"leftDiv"
)
leftDiv
:
ElementRef
;
@
ViewChild
(
"rightDiv"
)
rightDiv
:
ElementRef
;
color
=
color
;
obj
=
{
leftGroupId
:
''
,
};
noData
=
false
;
groupList
;
//分组数组
timeList
=
[
{
'label'
:
'最近一小时'
,
value
:
'1'
},
{
'label'
:
'最近一天'
,
value
:
'2'
},
{
'label'
:
'最近三天'
,
value
:
'3'
},
{
'label'
:
'最近一周'
,
value
:
'4'
},
];
timeTypeTrend
=
"0"
;
leftOneChart
;
leftTwoChart
;
rightOneChart
;
rightTwoChart
;
charTrendOption
;
//告警综述趋势
warnList
=
[];
totalNum
;
groupList
;
pageNum
=
1
;
pageCount
=
10
;
loading
=
false
;
obj
=
{
leftGroupId
:
null
,
alarmGroupId
:
null
};
leftOneData
=
{
high
:
0
,
warning
:
0
,
normal
:
0
,
disabled
:
0
,
high
:
0
,
warning
:
0
,
normal
:
0
,
disabled
:
0
,
};
leftOneDataPre
=
{
highPer
:
0
,
warningPer
:
0
,
normalPer
:
0
,
disabledPer
:
0
,
highPer
:
0
,
warningPer
:
0
,
normalPer
:
0
,
disabledPer
:
0
,
};
leftOneTotal
=
0
;
leftTwoData
=
{
high
:
0
,
warning
:
0
,
normal
:
0
,
disabled
:
0
,
leftTwoData
=
{
high
:
0
,
warning
:
0
,
normal
:
0
,
disabled
:
0
,
};
leftTwoDataPre
=
{
highPer
:
0
,
warningPer
:
0
,
normalPer
:
0
,
disabledPer
:
0
,
highPer
:
0
,
warningPer
:
0
,
normalPer
:
0
,
disabledPer
:
0
,
};
leftTwoTotal
=
0
;
rightTotal
=
0
;
flowListNum
;
//接口流量排行 数值
flowListPre
;
//发送利用率排名 百分比
countOrderList
;
//cpu内存使用率排名列表
isTrendLoading
=
false
;
trendObj
=
{
startTime
:
''
,
endTime
:
''
};
//我的关注
followList
;
dataSet
;
//拓扑图
topoId
;
//资源设备数量
deviceNo
;
constructor
(
private
overAllSer
:
OverAllService
,
private
message
:
NzMessageService
,
private
alarmSer
:
AlarmService
,
private
renderer
:
Renderer2
,
private
layoutSer
:
LayoutService
,
private
datePipe
:
DatePip
e
,
private
principal
:
Principal
,
private
topologySer
:
TopologyService
,
private
eventManager
:
JhiEventManager
,
private
analysisSer
:
AnalysisService
,
private
router
:
Router
,
private
commonSer
:
CommonService
,
private
overAllSer
:
OverAllService
,
private
message
:
NzMessageService
,
private
alarmSer
:
AlarmService
,
private
renderer
:
Renderer2
,
private
layoutSer
:
LayoutServic
e
,
private
principal
:
Principal
,
private
eventManager
:
JhiEventManager
,
private
router
:
Router
)
{
}
ngOnInit
()
{
this
.
getAlarmList
();
this
.
findGroupCount
();
this
.
findHostCount
();
this
.
getGroup
();
this
.
flowRankNum
();
this
.
flowRankPre
();
this
.
countOrde
();
this
.
getMyFollow
();
this
.
findSize
();
}
this
.
getList
();
ngAfterViewInit
(){
let
rightHeight
=
this
.
rightDiv
.
nativeElement
.
clientHeight
;
this
.
renderer
.
setStyle
(
this
.
leftDiv
.
nativeElement
,
"height"
,
rightHeight
+
"px"
);
}
//查看详情
goToDetail
(
item
)
{
this
.
router
.
navigate
([
'app/main/basic-detail'
],
{
queryParams
:
{
hostId
:
item
.
hostid
,
name
:
item
.
hostname
,
hostName
:
item
.
hostname
}
});
}
//我的关注
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
()
{
this
.
overAllSer
.
findGroup
().
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
&&
res
.
data
)
{
if
(
res
.
data
)
{
this
.
groupList
=
res
.
data
;
this
.
obj
.
leftGroupId
=
this
.
groupList
[
0
].
groupid
;
this
.
countGroupItem
();
...
...
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
View file @
d9eadc90
...
...
@@ -311,6 +311,9 @@ export class BasicEditComponent implements OnInit {
if
(
this
.
macroTYpe
==
'macroExpand'
)
{
this
.
validateForm
.
macros
=
this
.
macroList2
;
}
this
.
validateForm
.
interfaces
.
forEach
(
e
=>
{
e
.
hostid
=
this
.
hostId
});
this
.
validateForm
.
hostid
=
this
.
hostId
;
this
.
validateForm
.
macros
=
this
.
macroList1
;
this
.
overAllSer
.
updateHost
(
this
.
validateForm
).
subscribe
(
...
...
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