Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
motorCity
Overview
Overview
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
node_server
motorCity
Commits
9c9a7fa9
Commit
9c9a7fa9
authored
Aug 11, 2022
by
孙香冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
8f7b0a9a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
14 deletions
+48
-14
serverConfig.ts
src/config/serverConfig.ts
+1
-1
hardwareData.ts
src/data/interface/hardwareData.ts
+46
-12
interfaceService.ts
src/data/interface/interfaceService.ts
+1
-1
No files found.
src/config/serverConfig.ts
View file @
9c9a7fa9
...
...
@@ -3,7 +3,7 @@ import * as fs from "fs";
import
{
BizError
}
from
"../util/bizError"
;
import
{
analysisXml
}
from
"../util/myXML"
;
export
let
port
=
Number
(
process
.
env
.
PORT
)
||
Number
(
process
.
argv
[
3
])
||
3000
2
;
//如果xml里面没有配置 就会使用到这里的端口
export
let
port
=
Number
(
process
.
env
.
PORT
)
||
Number
(
process
.
argv
[
3
])
||
3000
1
;
//如果xml里面没有配置 就会使用到这里的端口
export
let
dbConfig
;
...
...
src/data/interface/hardwareData.ts
View file @
9c9a7fa9
...
...
@@ -5,9 +5,9 @@ import { get } from "../../util/request";
export
async
function
getHardware
()
{
let
url
=
"http://10.51.50.140:8080/api/static/PrivateCloudUsageStatics"
;
let
result
:
any
=
await
get
(
url
,
{},
{});
//
let result:any = await get(url, {}, {});
result
=
{
let
云资源
result
=
{
"content"
:[
{
"id"
:
1
,
...
...
@@ -47,22 +47,56 @@ export async function getHardware() {
"first"
:
true
,
"empty"
:
false
};
console
.
log
(
result
);
if
(
result
.
content
&&
result
.
content
[
0
])
{
let
contentInfo
=
result
.
content
[
0
]
;
if
(
云资源
result
.
content
&&
云资源
result
.
content
[
0
])
{
let
contentInfo
=
云资源
result
.
content
[
0
];
let
{
id
,
cpu
,
mem
,
localDisk
,
cloudDisk
,
network
,
rack
,
security
,
server
}
=
contentInfo
;
let
计算云资源
=
{
"cpu"
:
""
,
"内存"
:
""
,
"本地磁盘"
:
""
,
"云磁盘总量"
:
""
"cpu"
:
cpu
,
"内存"
:
mem
,
"本地磁盘"
:
localDisk
,
"云磁盘总量"
:
cloudDisk
};
let
物理资源
=
{
"物理机"
:
""
,
"网络设备"
:
""
,
"安全设备"
:
""
,
"机柜"
:
""
};
}
let
使用率
result
=
{
"id"
:
30
,
"collectDate"
:
"2022072710"
,
"ssdUsed"
:
"24%"
,
"sataUsed"
:
"74%"
,
"bosUsed"
:
"73.83%"
,
"localDiskUsed"
:
"30.00%"
,
"memoryUsed"
:
"31.00%"
,
"vcpuUsed"
:
"65.00%"
,
"hosts"
:
"40"
,
"runningBcc"
:
"251"
,
"errorDiskNum"
:
"3"
}
if
(
使用率
result
)
{
let
使用率
=
{
"cpu"
:
""
,
"cpu"
:
使用率
result
.
vcpuUsed
,
"内存"
:
使用率
result
.
memoryUsed
,
"本地磁盘"
:
使用率
result
.
localDiskUsed
,
"云磁盘cds ssd池"
:
使用率
result
.
ssdUsed
,
"云磁盘cds sata池"
:
使用率
result
.
sataUsed
,
"对象存储"
:
使用率
result
.
bosUsed
};
}
let
物理资源
result
=
{}
console
.
log
();
}
src/data/interface/interfaceService.ts
View file @
9c9a7fa9
...
...
@@ -5,7 +5,7 @@ let 月里程数据:any = [];//格式 [{key:"日期 格式是 2021.1", count:"
let
企业日里程数据
=
{};
//格式 {"企业名称":{count:"测试里程", autoCount:"功能测试里程"} }
let
lastMonths
=
""
;
//数据库源数据接口
//
月度测试
数据库源数据接口
export
async
function
getTestAnalysis
()
{
//在月里程数据集合中 从后往前拿20个月份的数据,动态的拿本月的数据 拼接好返回 不要改变源数据
let
monthMileage
=
[];
...
...
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