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
e4163f54
Commit
e4163f54
authored
Aug 08, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pipe
parent
f04460a2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
194 additions
and
137 deletions
+194
-137
app.main.module.ts
src/main/webapp/app/app.main.module.ts
+2
-0
basic-detail.component.html
...pp/overAll/basic/basic-detail/basic-detail.component.html
+1
-25
basic.component.ts
src/main/webapp/app/overAll/basic/basic.component.ts
+119
-109
server.component.html
...ain/webapp/app/overAll/modal/server/server.component.html
+2
-2
common.service.ts
src/main/webapp/app/shared/common/common.service.ts
+19
-0
pipe.module.ts
src/main/webapp/app/shared/pipe/pipe.module.ts
+21
-0
unit-conversion.pipe.ts
...p/app/shared/pipe/unit-conversion/unit-conversion.pipe.ts
+27
-0
shared.module.ts
src/main/webapp/app/shared/shared.module.ts
+3
-1
No files found.
src/main/webapp/app/app.main.module.ts
View file @
e4163f54
...
@@ -120,6 +120,7 @@ import {CostComponent} from './work/modal/cost/cost.component';
...
@@ -120,6 +120,7 @@ import {CostComponent} from './work/modal/cost/cost.component';
import
{
CommonProblemComponent
}
from
'./knowladge/common-problem/common-problem.component'
;
import
{
CommonProblemComponent
}
from
'./knowladge/common-problem/common-problem.component'
;
import
{
InformationTechComponent
}
from
'./knowladge/information-tech/information-tech.component'
;
import
{
InformationTechComponent
}
from
'./knowladge/information-tech/information-tech.component'
;
import
{
ManagementSystemComponent
}
from
'./knowladge/management-system/management-system.component'
;
import
{
ManagementSystemComponent
}
from
'./knowladge/management-system/management-system.component'
;
import
{
PipeModule
}
from
'./shared/pipe/pipe.module'
;
@
NgModule
({
@
NgModule
({
imports
:
[
imports
:
[
...
@@ -128,6 +129,7 @@ import {ManagementSystemComponent} from './knowladge/management-system/managemen
...
@@ -128,6 +129,7 @@ import {ManagementSystemComponent} from './knowladge/management-system/managemen
NgxEchartsModule
,
NgxEchartsModule
,
FormsModule
,
FormsModule
,
ReactiveFormsModule
,
ReactiveFormsModule
,
PipeModule
,
NgZorroAntdModule
.
forRoot
()
NgZorroAntdModule
.
forRoot
()
],
],
declarations
:
[
declarations
:
[
...
...
src/main/webapp/app/overAll/basic/basic-detail/basic-detail.component.html
View file @
e4163f54
...
@@ -119,30 +119,6 @@
...
@@ -119,30 +119,6 @@
</nz-collapse-panel>
</nz-collapse-panel>
</nz-collapse>
</nz-collapse>
</div>
</div>
<!--<div nz-row>-->
<!--<nz-table #basicTable [nzData]="dataSet" [nzFrontPagination]="false" [nzTotal]="totalNumInOut" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="changeInoutInfo($event)" [nzLoading]="inOutLoading">-->
<!--<thead>-->
<!--<tr>-->
<!--<th>状态</th>-->
<!--<th>接口</th>-->
<!--<th>进流量</th>-->
<!--<th>出流量</th>-->
<!--<th>状态变更时间</th>-->
<!--<!–<th nzWidth="150px">图表</th>–>-->
<!--</tr>-->
<!--</thead>-->
<!--<tbody>-->
<!--<tr *ngFor="let data of basicTable.data">-->
<!--<td>{{data.state}}</td>-->
<!--<td>{{data.name}}</td>-->
<!--<td>{{data.in}}</td>-->
<!--<td>{{data.out}}</td>-->
<!--<td>{{data.changeState}}</td>-->
<!--<!–<td>图表</td>–>-->
<!--</tr>-->
<!--</tbody>-->
<!--</nz-table>-->
<!--</div>-->
</section>
</section>
</nz-tab>
</nz-tab>
<nz-tab
nzTitle=
"监测点列表"
>
<nz-tab
nzTitle=
"监测点列表"
>
...
@@ -151,7 +127,7 @@
...
@@ -151,7 +127,7 @@
<button
(
click
)="
getCheckList
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-search"
style=
"color: #6097b7"
></i>
搜索
</button>
<button
(
click
)="
getCheckList
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-search"
style=
"color: #6097b7"
></i>
搜索
</button>
</div>
</div>
<div
class=
"padding-15-0"
>
<div
class=
"padding-15-0"
>
<nz-radio-group
[(
ngModel
)]="
itemTypeValue
"
[
nzButtonStyle
]="'
solid
'"
>
<nz-radio-group
[(
ngModel
)]="
itemTypeValue
"
>
<label
*
ngFor=
"let item of itemTypeList"
(
click
)="
changeType
(
item
)"
nz-radio-button
[
nzValue
]="
item
.
applicationid
"
>
{{item.name}}
</label>
<label
*
ngFor=
"let item of itemTypeList"
(
click
)="
changeType
(
item
)"
nz-radio-button
[
nzValue
]="
item
.
applicationid
"
>
{{item.name}}
</label>
</nz-radio-group>
</nz-radio-group>
</div>
</div>
...
...
src/main/webapp/app/overAll/basic/basic.component.ts
View file @
e4163f54
...
@@ -33,7 +33,12 @@ export interface TreeNodeInterface {
...
@@ -33,7 +33,12 @@ export interface TreeNodeInterface {
styles
:
[
styles
:
[
`:host ::ng-deep .table-dropdown a {
`:host ::ng-deep .table-dropdown a {
font-weight: 300;
font-weight: 300;
}`
}
.button .ant-btn {
padding: 0 10px;
}
`
]
]
})
})
export
class
BasicComponent
implements
OnInit
{
export
class
BasicComponent
implements
OnInit
{
...
@@ -50,7 +55,6 @@ export class BasicComponent implements OnInit {
...
@@ -50,7 +55,6 @@ export class BasicComponent implements OnInit {
//表格信息
//表格信息
loading
=
false
;
loading
=
false
;
selectedValue
;
isCheck
=
false
;
isCheck
=
false
;
allChecked
=
false
;
allChecked
=
false
;
interfaceList
:
any
[];
interfaceList
:
any
[];
...
@@ -71,7 +75,6 @@ export class BasicComponent implements OnInit {
...
@@ -71,7 +75,6 @@ export class BasicComponent implements OnInit {
gray
;
gray
;
//搜索
//搜索
searchStatus
=
true
;
searchName
;
searchName
;
searchData
;
searchData
;
status
;
status
;
...
@@ -80,6 +83,12 @@ export class BasicComponent implements OnInit {
...
@@ -80,6 +83,12 @@ export class BasicComponent implements OnInit {
pageCount
=
pageSize
;
pageCount
=
pageSize
;
totalNum
;
totalNum
;
selectedValue
=
'group'
;
groupList
=
[];
//分组列表
groupid
=
null
;
equipmentTypeid
=
null
;
constructor
(
private
fb
:
FormBuilder
,
private
overAllSer
:
OverAllService
,
private
router
:
Router
,
constructor
(
private
fb
:
FormBuilder
,
private
overAllSer
:
OverAllService
,
private
router
:
Router
,
private
commonSer
:
CommonService
,
private
commonSer
:
CommonService
,
private
modalService
:
NzModalService
,
private
message
:
NzMessageService
,
private
main
:
JhiMainComponent
)
{
private
modalService
:
NzModalService
,
private
message
:
NzMessageService
,
private
main
:
JhiMainComponent
)
{
...
@@ -142,41 +151,48 @@ export class BasicComponent implements OnInit {
...
@@ -142,41 +151,48 @@ export class BasicComponent implements OnInit {
});
});
}
}
//获取下级list
ngOnInit
():
void
{
getChildren
(
item
)
{
this
.
findOpStatus
();
if
(
item
.
list
)
{
this
.
select
(
'group'
);
if
(
item
.
expand
)
{
}
item
.
expand
=
false
;
}
else
{
select
(
e
)
{
item
.
expand
=
true
;
this
.
groupid
=
null
;
}
this
.
equipmentTypeid
=
null
;
return
false
;
if
(
e
==
'group'
)
{
this
.
getGroup
();
}
else
{
this
.
getType
();
}
}
this
.
loading
=
true
;
}
const
data
=
{
//获取资源分组
'groupids'
:
[
item
.
groupid
],
getGroup
()
{
};
this
.
overAllSer
.
findGroup
().
subscribe
(
this
.
overAllSer
.
findHostNew
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
data
)
{
if
(
res
.
errCode
==
10000
)
{
this
.
dataSet
[
item
.
host
].
list
=
res
.
data
;
this
.
groupList
=
res
.
data
;
this
.
toTree
(
item
.
host
);
this
.
search
();
}
else
{
this
.
message
.
info
(
'该分组下无资源'
);
}
}
this
.
loading
=
false
;
}
}
);
);
}
}
ngOnInit
():
void
{
//获取设备类型
this
.
selectedValue
=
'group'
;
getType
()
{
this
.
select
();
this
.
overAllSer
.
findType
().
subscribe
(
this
.
findOpStatus
();
(
res
)
=>
{
this
.
loading
=
false
;
if
(
res
.
errCode
==
10000
)
{
this
.
groupList
=
res
.
data
;
this
.
search
();
}
}
);
}
}
changeStatus
(
status
)
{
changeStatus
(
status
)
{
this
.
loading
=
true
;
if
(
this
.
status
==
status
)
{
if
(
this
.
status
==
status
)
{
this
.
status
=
null
;
this
.
status
=
null
;
}
else
{
}
else
{
...
@@ -190,22 +206,43 @@ export class BasicComponent implements OnInit {
...
@@ -190,22 +206,43 @@ export class BasicComponent implements OnInit {
//waringName:(值为:正常,禁用,告警,严重)
//waringName:(值为:正常,禁用,告警,严重)
*/
*/
search
()
{
search
()
{
this
.
loading
=
true
;
this
.
pageNum
=
1
;
this
.
pageNum
=
1
;
this
.
searchRe
();
this
.
searchRe
();
}
}
searchRe
()
{
changeGroup
(
e
)
{
this
.
loading
=
true
;
this
.
pageNum
=
1
;
this
.
groupid
=
e
;
this
.
equipmentTypeid
=
null
;
this
.
searchRe
();
}
changeEquiment
(
e
)
{
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
searchStatus
=
true
;
this
.
pageNum
=
1
;
this
.
groupid
=
null
;
this
.
equipmentTypeid
=
e
;
this
.
searchRe
();
}
searchRe
()
{
const
data
=
{
const
data
=
{
pageNum
:
this
.
pageNum
,
pageNum
:
this
.
pageNum
,
pageCount
:
this
.
pageCount
,
pageCount
:
this
.
pageCount
,
obj
:
{
obj
:
{
name
:
this
.
searchName
,
name
:
this
.
searchName
,
waringName
:
this
.
status
,
waringName
:
this
.
status
,
equipmentTypeid
:
this
.
equipmentTypeid
,
groupids
:
[]
groupids
:
[]
}
}
};
};
if
(
this
.
groupid
)
{
data
.
obj
.
groupids
.
push
(
this
.
groupid
);
}
else
{
data
.
obj
.
groupids
=
[];
}
this
.
overAllSer
.
findHostPageNew
(
data
).
subscribe
(
this
.
overAllSer
.
findHostPageNew
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
errCode
==
10000
)
{
...
@@ -219,17 +256,14 @@ export class BasicComponent implements OnInit {
...
@@ -219,17 +256,14 @@ export class BasicComponent implements OnInit {
//翻页
//翻页
change
(
event
)
{
change
(
event
)
{
if
(
event
>
0
)
{
this
.
loading
=
true
;
this
.
pageNum
=
event
;
this
.
pageNum
=
event
;
this
.
searchRe
();
this
.
searchRe
();
}
}
}
//backList
//backList
backList
()
{
backList
()
{
this
.
select
();
this
.
findOpStatus
();
this
.
findOpStatus
();
this
.
searchStatus
=
false
;
}
}
//查询设备状态
//查询设备状态
...
@@ -242,8 +276,6 @@ export class BasicComponent implements OnInit {
...
@@ -242,8 +276,6 @@ export class BasicComponent implements OnInit {
this
.
yellow
=
res
.
data
.
waring
;
this
.
yellow
=
res
.
data
.
waring
;
this
.
red
=
res
.
data
.
serious
;
this
.
red
=
res
.
data
.
serious
;
this
.
deviceNo
=
res
.
data
.
total
;
this
.
deviceNo
=
res
.
data
.
total
;
}
else
{
this
.
message
.
info
(
res
.
Msg
);
}
}
}
}
);
);
...
@@ -279,53 +311,10 @@ export class BasicComponent implements OnInit {
...
@@ -279,53 +311,10 @@ export class BasicComponent implements OnInit {
);
);
}
}
//选择分组
select
()
{
this
.
loading
=
true
;
this
.
searchStatus
=
false
;
this
.
findOpStatus
();
if
(
this
.
selectedValue
==
'group'
)
{
this
.
overAllSer
.
getgroups
({}).
subscribe
(
(
res
)
=>
{
this
.
loading
=
false
;
if
(
res
.
errCode
==
10000
)
{
this
.
dataSet
=
res
.
data
;
// this.dataSet = this.dataSet.filter(d => d.list); //过滤无list的
for
(
let
i
=
0
;
i
<
this
.
dataSet
.
length
;
i
++
)
{
this
.
dataSet
[
i
].
host
=
i
;
this
.
dataSet
[
i
].
checked
=
false
;
}
this
.
toTree
(
null
);
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
}
}
);
}
else
if
(
this
.
selectedValue
==
'type'
)
{
this
.
overAllSer
.
findType
().
subscribe
(
(
res
)
=>
{
this
.
loading
=
false
;
if
(
res
.
errCode
==
10000
)
{
this
.
dataSet
=
res
.
data
;
// this.dataSet = this.dataSet.filter(d => d.list); //过滤无list的
for
(
let
i
=
0
;
i
<
this
.
dataSet
.
length
;
i
++
)
{
this
.
dataSet
[
i
].
host
=
i
;
this
.
dataSet
[
i
].
checked
=
false
;
}
this
.
toTree
(
null
);
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
}
}
);
}
else
if
(
this
.
selectedValue
==
'all'
)
{
this
.
findList
();
}
}
//删除单个资源
//删除单个资源
showDeleteConfirm
(
item
)
{
showDeleteConfirm
(
item
)
{
this
.
commonSer
.
confirmThing
(
'删除'
,
'确认删除该资源吗?'
,
()
=>
{
this
.
commonSer
.
confirmThing
(
'删除'
,
'确认删除该资源吗?'
,
()
=>
{
this
.
loading
=
true
;
const
data
=
{
const
data
=
{
hostids
:
[]
hostids
:
[]
};
};
...
@@ -334,7 +323,7 @@ export class BasicComponent implements OnInit {
...
@@ -334,7 +323,7 @@ export class BasicComponent implements OnInit {
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
info
(
'删除成功'
);
this
.
message
.
info
(
'删除成功'
);
this
.
se
lect
();
this
.
se
archRe
();
}
else
{
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
this
.
message
.
info
(
res
.
errMsg
);
}
}
...
@@ -351,6 +340,7 @@ export class BasicComponent implements OnInit {
...
@@ -351,6 +340,7 @@ export class BasicComponent implements OnInit {
}
}
this
.
commonSer
.
confirmThing
(
'删除'
,
'确认要删除所选设备吗?'
,
()
=>
{
this
.
commonSer
.
confirmThing
(
'删除'
,
'确认要删除所选设备吗?'
,
()
=>
{
this
.
loading
=
true
;
const
data
=
{
const
data
=
{
hostids
:
this
.
batchDelList
hostids
:
this
.
batchDelList
};
};
...
@@ -359,7 +349,7 @@ export class BasicComponent implements OnInit {
...
@@ -359,7 +349,7 @@ export class BasicComponent implements OnInit {
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
info
(
'删除成功'
);
this
.
message
.
info
(
'删除成功'
);
this
.
batchDelList
=
[];
this
.
batchDelList
=
[];
this
.
se
lect
();
this
.
se
archRe
();
}
else
{
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
this
.
message
.
error
(
res
.
errMsg
);
}
}
...
@@ -374,33 +364,49 @@ export class BasicComponent implements OnInit {
...
@@ -374,33 +364,49 @@ export class BasicComponent implements OnInit {
}
}
//编辑分组
//编辑分组
updateGroup
(
item
)
{
updateGroup
()
{
if
(
!
this
.
groupid
&&
!
this
.
equipmentTypeid
)
{
this
.
message
.
info
(
'请选择分组!'
);
return
false
;
}
let
item
;
if
(
this
.
groupid
)
{
this
.
groupList
.
forEach
(
e
=>
{
if
(
e
.
groupid
==
this
.
groupid
)
{
item
=
e
;
}
});
}
else
{
this
.
groupList
.
forEach
(
e
=>
{
if
(
e
.
equipmentTypeId
==
this
.
equipmentTypeid
)
{
item
=
e
;
}
});
}
this
.
smartCreateGroup
.
showEditModal
(
'修改分组'
,
item
);
this
.
smartCreateGroup
.
showEditModal
(
'修改分组'
,
item
);
}
}
//删除分组
//删除分组
showDeleteGroupConfirm
(
item
)
{
showDeleteGroupConfirm
()
{
this
.
modalService
.
confirm
(
{
if
(
!
this
.
groupid
&&
!
this
.
equipmentTypeid
)
{
nzTitle
:
'删除'
,
this
.
message
.
info
(
'请选择分组!'
);
nzContent
:
'<b style="color: red;">确认删除该分组吗?</b>'
,
return
false
;
nzOkText
:
'确定'
,
}
nzOkType
:
'danger'
,
this
.
commonSer
.
confirmThing
(
'删除'
,
'确认删除该分组吗?'
,
()
=>
{
nzOnOk
:
()
=>
{
this
.
loading
=
true
;
const
data
=
{
groupid
:
[]};
const
data
=
{
groupid
:
[]};
data
.
groupid
.
push
(
item
.
groupid
);
if
(
this
.
groupid
)
data
.
groupid
.
push
(
this
.
groupid
);
this
.
overAllSer
.
deleteGroup
(
data
).
subscribe
(
if
(
this
.
equipmentTypeid
)
data
.
groupid
.
push
(
this
.
equipmentTypeid
);
(
res
)
=>
{
this
.
overAllSer
.
deleteGroup
(
data
).
subscribe
(
if
(
res
.
errCode
==
10000
)
{
(
res
)
=>
{
this
.
message
.
info
(
'删除成功'
);
if
(
res
.
errCode
==
10000
)
{
this
.
select
(
);
this
.
message
.
info
(
'删除成功'
);
}
else
{
this
.
searchRe
();
this
.
message
.
info
(
res
.
errMsg
);
}
else
{
}
this
.
message
.
info
(
res
.
errMsg
);
}
}
);
}
},
);
nzCancelText
:
'取消'
,
nzOnCancel
:
()
=>
console
.
log
(
'Cancel'
)
});
});
}
}
...
@@ -410,7 +416,8 @@ export class BasicComponent implements OnInit {
...
@@ -410,7 +416,8 @@ export class BasicComponent implements OnInit {
}
}
handleOk
(
e
)
{
handleOk
(
e
)
{
this
.
select
();
this
.
loading
=
true
;
this
.
searchRe
();
}
}
//根据设备类型查询主机资源
//根据设备类型查询主机资源
...
@@ -476,6 +483,7 @@ export class BasicComponent implements OnInit {
...
@@ -476,6 +483,7 @@ export class BasicComponent implements OnInit {
nzOkText
:
'确定'
,
nzOkText
:
'确定'
,
nzCancelText
:
'取消'
,
nzCancelText
:
'取消'
,
nzOnOk
:
()
=>
{
nzOnOk
:
()
=>
{
this
.
loading
=
true
;
let
params1
=
0
;
let
params1
=
0
;
if
(
item
.
status
==
0
)
{
if
(
item
.
status
==
0
)
{
params1
=
1
;
params1
=
1
;
...
@@ -485,7 +493,7 @@ export class BasicComponent implements OnInit {
...
@@ -485,7 +493,7 @@ export class BasicComponent implements OnInit {
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
info
(
'修改成功'
);
this
.
message
.
info
(
'修改成功'
);
this
.
se
lect
();
this
.
se
archRe
();
}
else
{
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
this
.
message
.
info
(
res
.
errMsg
);
}
}
...
@@ -508,6 +516,7 @@ export class BasicComponent implements OnInit {
...
@@ -508,6 +516,7 @@ export class BasicComponent implements OnInit {
nzOkText
:
'确定'
,
nzOkText
:
'确定'
,
nzCancelText
:
'取消'
,
nzCancelText
:
'取消'
,
nzOnOk
:
()
=>
{
nzOnOk
:
()
=>
{
this
.
loading
=
true
;
const
data
=
{
const
data
=
{
status
:
status
,
status
:
status
,
hostids
:
this
.
batchDelList
hostids
:
this
.
batchDelList
...
@@ -518,7 +527,7 @@ export class BasicComponent implements OnInit {
...
@@ -518,7 +527,7 @@ export class BasicComponent implements OnInit {
this
.
message
.
info
(
'修改成功'
);
this
.
message
.
info
(
'修改成功'
);
this
.
batchDelList
=
[];
this
.
batchDelList
=
[];
this
.
findOpStatus
();
this
.
findOpStatus
();
this
.
se
lect
();
this
.
se
archRe
();
}
else
{
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
this
.
message
.
info
(
res
.
errMsg
);
}
}
...
@@ -541,7 +550,7 @@ export class BasicComponent implements OnInit {
...
@@ -541,7 +550,7 @@ export class BasicComponent implements OnInit {
//前往设备类型页面
//前往设备类型页面
goEquip
(
item
)
{
goEquip
(
item
)
{
let
type
;
let
type
;
if
(
item
.
equipmentType
==
'数据库'
)
{
if
(
item
.
equipmentType
==
'数据库'
||
item
.
equipmentType
==
'业务软件'
)
{
type
=
'database'
;
type
=
'database'
;
}
else
if
(
item
.
equipmentType
==
'交换机'
)
{
}
else
if
(
item
.
equipmentType
==
'交换机'
)
{
type
=
'switch'
;
type
=
'switch'
;
...
@@ -555,4 +564,5 @@ export class BasicComponent implements OnInit {
...
@@ -555,4 +564,5 @@ export class BasicComponent implements OnInit {
}
}
});
});
}
}
}
}
src/main/webapp/app/overAll/modal/server/server.component.html
View file @
e4163f54
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
</div>
</div>
<nz-row>
<nz-row>
<nz-col
nzSpan=
"12"
>
总大小:
</nz-col>
<nz-col
nzSpan=
"12"
>
总大小:
</nz-col>
<nz-col
nzSpan=
"12"
>
{{hostObj.disk[diskType].total |
| '-'
}}
</nz-col>
<nz-col
nzSpan=
"12"
>
{{hostObj.disk[diskType].total |
unitConversion
}}
</nz-col>
</nz-row>
</nz-row>
<nz-row>
<nz-row>
<nz-col
nzSpan=
"12"
>
已用大小:
</nz-col>
<nz-col
nzSpan=
"12"
>
已用大小:
</nz-col>
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
</nz-row>
</nz-row>
<nz-row>
<nz-row>
<nz-col
nzSpan=
"8"
>
IP地址:
</nz-col>
<nz-col
nzSpan=
"8"
>
IP地址:
</nz-col>
<nz-col
nzSpan=
"16"
>
{{server?.
ip
|| '-'}}
</nz-col>
<nz-col
nzSpan=
"16"
>
{{server?.
host
|| '-'}}
</nz-col>
</nz-row>
</nz-row>
<nz-row>
<nz-row>
<nz-col
nzSpan=
"8"
>
设备类型:
</nz-col>
<nz-col
nzSpan=
"8"
>
设备类型:
</nz-col>
...
...
src/main/webapp/app/shared/common/common.service.ts
View file @
e4163f54
...
@@ -225,4 +225,23 @@ export class CommonService implements OnInit {
...
@@ -225,4 +225,23 @@ export class CommonService implements OnInit {
}
}
return
obj
;
return
obj
;
}
}
//内存单位换算
unitConversion
(
unit
){
let
res
;
let
Gbps
=
1000
*
1000
*
1000
;
let
Mbps
=
1000
*
1000
;
let
kbps
=
1000
;
let
size
=
Math
.
abs
(
unit
);
if
(
size
/
Gbps
>
1
)
{
res
+=
(
size
/
Gbps
).
toFixed
(
2
)
+
'Gbps'
;
}
else
if
(
size
/
Mbps
>
1
)
{
res
+=
(
size
/
Mbps
).
toFixed
(
2
)
+
'Mbps'
;
}
else
if
(
size
/
kbps
>
1
)
{
res
+=
(
size
/
kbps
).
toFixed
(
2
)
+
'kbps'
;
}
else
{
res
+=
(
size
)
+
'bps'
;
}
return
res
;
}
}
}
src/main/webapp/app/shared/pipe/pipe.module.ts
0 → 100644
View file @
e4163f54
import
{
NgModule
,
CUSTOM_ELEMENTS_SCHEMA
}
from
'@angular/core'
;
import
{
UnitConversionPipe
}
from
'./unit-conversion/unit-conversion.pipe'
;
@
NgModule
({
imports
:
[
],
declarations
:
[
UnitConversionPipe
],
providers
:
[
],
entryComponents
:
[],
exports
:
[
UnitConversionPipe
],
schemas
:
[
CUSTOM_ELEMENTS_SCHEMA
]
})
export
class
PipeModule
{}
src/main/webapp/app/shared/pipe/unit-conversion/unit-conversion.pipe.ts
0 → 100644
View file @
e4163f54
import
{
Pipe
,
PipeTransform
}
from
'@angular/core'
;
@
Pipe
({
name
:
'unitConversion'
})
export
class
UnitConversionPipe
implements
PipeTransform
{
transform
(
value
:
any
,
args
?:
any
):
any
{
console
.
log
(
value
);
let
res
=
''
;
let
Gbps
=
1000
*
1000
*
1000
;
let
Mbps
=
1000
*
1000
;
let
kbps
=
1000
;
let
size
=
Math
.
abs
(
value
);
if
(
size
/
Gbps
>
1
)
{
res
+=
(
size
/
Gbps
).
toFixed
(
2
)
+
'Gbps'
;
}
else
if
(
size
/
Mbps
>
1
)
{
res
+=
(
size
/
Mbps
).
toFixed
(
2
)
+
'Mbps'
;
}
else
if
(
size
/
kbps
>
1
)
{
res
+=
(
size
/
kbps
).
toFixed
(
2
)
+
'kbps'
;
}
else
{
res
+=
(
size
)
+
'bps'
;
}
return
res
;
}
}
src/main/webapp/app/shared/shared.module.ts
View file @
e4163f54
...
@@ -19,13 +19,15 @@ import {ReactiveFormsModule} from '@angular/forms';
...
@@ -19,13 +19,15 @@ import {ReactiveFormsModule} from '@angular/forms';
import
{
CommonService
}
from
'./common/common.service'
;
import
{
CommonService
}
from
'./common/common.service'
;
import
{
UtilService
}
from
'./common/util.service'
;
import
{
UtilService
}
from
'./common/util.service'
;
import
{
DisableControlDirective
}
from
'./common/disable-control.directive'
;
import
{
DisableControlDirective
}
from
'./common/disable-control.directive'
;
import
{
PipeModule
}
from
'./pipe/pipe.module'
;
@
NgModule
({
@
NgModule
({
imports
:
[
imports
:
[
ReactiveFormsModule
,
ReactiveFormsModule
,
NgZorroAntdModule
,
NgZorroAntdModule
,
BootappSharedLibsModule
,
BootappSharedLibsModule
,
BootappSharedCommonModule
BootappSharedCommonModule
,
PipeModule
,
],
],
declarations
:
[
declarations
:
[
JhiLoginModalComponent
,
JhiLoginModalComponent
,
...
...
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