Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a8bdd4b6
authored
Oct 27, 2026
by
renyizhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改统计数据
parent
10c2d96b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
src/api/apihub/aiTokenStats/index.ts
+2
-1
src/views/Home/ComputeResource.vue
+14
-5
No files found.
src/api/apihub/aiTokenStats/index.ts
View file @
a8bdd4b6
import
request
from
'@/config/axios'
export
interface
AiTokenStatsVO
{
statsCo
unt
:
number
statsCo
nsumeQuota
:
number
statsQuota
:
number
statsTokens
:
number
statsGiftAmount
:
number
}
export
const
AiTokenStatsApi
=
{
...
...
src/views/Home/ComputeResource.vue
View file @
a8bdd4b6
...
...
@@ -12,15 +12,15 @@
<div
class=
"stat-item"
>
<img
src=
"@/assets/images/statistical-icon1.png"
/>
<div
class=
"stat-content"
>
<div
class=
"stat-label"
>
统计次数
</div>
<div
class=
"stat-num"
>
{{
aiTokenStats
.
statsCount
}}
</div>
<div
class=
"stat-label"
>
消费额度
</div>
<div
class=
"stat-num"
>
¥
{{
aiTokenStats
.
statsConsumeQuota
||
'0.00'
}}
</div>
</div>
</div>
<div
class=
"stat-item"
>
<img
src=
"@/assets/images/statistical-icon4.png"
/>
<div
class=
"stat-content"
>
<div
class=
"stat-label"
>
统计
额度
</div>
<div
class=
"stat-num"
>
¥
{{
aiTokenStats
.
statsQuota
}}
</div>
<div
class=
"stat-label"
>
充值
额度
</div>
<div
class=
"stat-num"
>
¥
{{
aiTokenStats
.
statsQuota
||
'0.00'
}}
</div>
</div>
</div>
</div>
...
...
@@ -29,7 +29,7 @@
<img
src=
"@/assets/images/statistical-icon2.png"
/>
<div
class=
"stat-content"
>
<div
class=
"stat-label"
>
统计Tokens
</div>
<div
class=
"stat-num"
>
{{
aiTokenStats
.
statsTokens
}}
</div>
<div
class=
"stat-num"
>
{{
formatTokens
(
aiTokenStats
.
statsTokens
)
}}
</div>
</div>
</div>
<div
class=
"stat-item"
>
...
...
@@ -87,6 +87,15 @@ const fetchAiTokenStats = async () => {
}
}
// Tokens 数量过大,统一换算成 M 单位并保留一位小数
const
formatTokens
=
(
tokens
)
=>
{
const
num
=
Number
(
tokens
)
||
0
if
(
num
>=
1000000
)
{
return
(
num
/
1000000
).
toFixed
(
1
)
+
'M'
}
return
num
.
toLocaleString
()
}
// 获取算力资源分布数据
const
fetchComputeDistribution
=
()
=>
{
const
data
=
dashboardData
.
value
.
computeDistribution
||
{
gpu
:
[],
source
:
[],
resource
:
[]
}
...
...
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