mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-06 16:53:42 +08:00
fix: improve code formatting and readability in Dashboard component
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import React, {useEffect, useState} from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import {useTranslation} from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {Card, Grid} from 'semantic-ui-react';
|
import { Card, Grid } from 'semantic-ui-react';
|
||||||
import {
|
import {
|
||||||
Bar,
|
Bar,
|
||||||
BarChart,
|
BarChart,
|
||||||
@@ -242,7 +242,7 @@ const Dashboard = () => {
|
|||||||
<Card.Content>
|
<Card.Content>
|
||||||
<Card.Header>
|
<Card.Header>
|
||||||
{t('dashboard.charts.requests.title')}
|
{t('dashboard.charts.requests.title')}
|
||||||
{/* <span className='stat-value'>{summaryData.todayRequests}</span> */}
|
{/* <span className='stat-value'>{summaryData.todayRequests}</span> */}
|
||||||
</Card.Header>
|
</Card.Header>
|
||||||
<div className='chart-container'>
|
<div className='chart-container'>
|
||||||
<ResponsiveContainer
|
<ResponsiveContainer
|
||||||
@@ -271,7 +271,9 @@ const Dashboard = () => {
|
|||||||
t('dashboard.charts.requests.tooltip'),
|
t('dashboard.charts.requests.tooltip'),
|
||||||
]}
|
]}
|
||||||
labelFormatter={(label) =>
|
labelFormatter={(label) =>
|
||||||
`${t('dashboard.statistics.tooltip.date')}: ${formatDate(label)}`
|
`${t(
|
||||||
|
'dashboard.statistics.tooltip.date'
|
||||||
|
)}: ${formatDate(label)}`
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Line
|
<Line
|
||||||
@@ -294,7 +296,7 @@ const Dashboard = () => {
|
|||||||
<Card.Content>
|
<Card.Content>
|
||||||
<Card.Header>
|
<Card.Header>
|
||||||
{t('dashboard.charts.quota.title')}
|
{t('dashboard.charts.quota.title')}
|
||||||
{/* <span className='stat-value'>
|
{/* <span className='stat-value'>
|
||||||
${summaryData.todayQuota.toFixed(3)}
|
${summaryData.todayQuota.toFixed(3)}
|
||||||
</span> */}
|
</span> */}
|
||||||
</Card.Header>
|
</Card.Header>
|
||||||
@@ -321,11 +323,13 @@ const Dashboard = () => {
|
|||||||
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
||||||
}}
|
}}
|
||||||
formatter={(value) => [
|
formatter={(value) => [
|
||||||
value,
|
value.toFixed(6),
|
||||||
t('dashboard.charts.quota.tooltip'),
|
t('dashboard.charts.quota.tooltip'),
|
||||||
]}
|
]}
|
||||||
labelFormatter={(label) =>
|
labelFormatter={(label) =>
|
||||||
`${t('dashboard.statistics.tooltip.date')}: ${formatDate(label)}`
|
`${t(
|
||||||
|
'dashboard.statistics.tooltip.date'
|
||||||
|
)}: ${formatDate(label)}`
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Line
|
<Line
|
||||||
@@ -348,7 +352,7 @@ const Dashboard = () => {
|
|||||||
<Card.Content>
|
<Card.Content>
|
||||||
<Card.Header>
|
<Card.Header>
|
||||||
{t('dashboard.charts.tokens.title')}
|
{t('dashboard.charts.tokens.title')}
|
||||||
{/* <span className='stat-value'>{summaryData.todayTokens}</span> */}
|
{/* <span className='stat-value'>{summaryData.todayTokens}</span> */}
|
||||||
</Card.Header>
|
</Card.Header>
|
||||||
<div className='chart-container'>
|
<div className='chart-container'>
|
||||||
<ResponsiveContainer
|
<ResponsiveContainer
|
||||||
@@ -377,7 +381,9 @@ const Dashboard = () => {
|
|||||||
t('dashboard.charts.tokens.tooltip'),
|
t('dashboard.charts.tokens.tooltip'),
|
||||||
]}
|
]}
|
||||||
labelFormatter={(label) =>
|
labelFormatter={(label) =>
|
||||||
`${t('dashboard.statistics.tooltip.date')}: ${formatDate(label)}`
|
`${t(
|
||||||
|
'dashboard.statistics.tooltip.date'
|
||||||
|
)}: ${formatDate(label)}`
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Line
|
<Line
|
||||||
@@ -422,7 +428,9 @@ const Dashboard = () => {
|
|||||||
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
||||||
}}
|
}}
|
||||||
labelFormatter={(label) =>
|
labelFormatter={(label) =>
|
||||||
`${t('dashboard.statistics.tooltip.date')}: ${formatDate(label)}`
|
`${t('dashboard.statistics.tooltip.date')}: ${formatDate(
|
||||||
|
label
|
||||||
|
)}`
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Legend
|
<Legend
|
||||||
|
|||||||
Reference in New Issue
Block a user