mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-07 01:03:41 +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,
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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