feat(mining-admin): add total contribution to dashboard stats

- Add networkTotalContribution field to dashboard API response
- Display total hashrate alongside effective hashrate in stats cards
- Update price overview to show both effective and total contribution
- Change grid from 3 to 4 columns in price overview

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-14 23:32:29 -08:00
parent 546c0060da
commit dee9c511e5
6 changed files with 15 additions and 7 deletions

View File

@ -774,7 +774,8 @@
"Bash(ssh -J ceshi@103.39.231.231 ceshi@192.168.1.111 \"curl -s http://localhost:3021/api/v2/admin/status\")",
"Bash(del \"c:\\\\Users\\\\dong\\\\Desktop\\\\rwadurian\\\\frontend\\\\mining-app\\\\lib\\\\domain\\\\usecases\\\\trading\\\\buy_shares.dart\")",
"Bash(del \"c:\\\\Users\\\\dong\\\\Desktop\\\\rwadurian\\\\frontend\\\\mining-app\\\\lib\\\\domain\\\\usecases\\\\trading\\\\sell_shares.dart\")",
"Bash(ls -la \"c:\\\\Users\\\\dong\\\\Desktop\\\\rwadurian\\\\frontend\\\\mining-app\\\\lib\\\\presentation\\\\pages\"\" 2>/dev/null || dir /b \"c:UsersdongDesktoprwadurianfrontendmining-applibpresentationpages \")"
"Bash(ls -la \"c:\\\\Users\\\\dong\\\\Desktop\\\\rwadurian\\\\frontend\\\\mining-app\\\\lib\\\\presentation\\\\pages\"\" 2>/dev/null || dir /b \"c:UsersdongDesktoprwadurianfrontendmining-applibpresentationpages \")",
"Bash(cd:*)"
],
"deny": [],
"ask": []

View File

@ -31,6 +31,7 @@ export class DashboardController {
totalUsers: raw.users?.total || 0,
adoptedUsers: raw.users?.adopted || 0,
networkEffectiveContribution: raw.contribution?.effectiveContribution || '0',
networkTotalContribution: raw.contribution?.totalContribution || '0',
totalDistributed: raw.mining?.totalMined || '0',
totalBurned: raw.mining?.latestDailyStat?.totalBurned || '0',
circulationPool: raw.trading?.circulationPool?.totalShares || '0',

View File

@ -44,15 +44,19 @@ export function PriceOverview() {
</div>
<div className="mt-6 pt-6 border-t">
<div className="grid grid-cols-3 gap-4 text-center">
<div className="grid grid-cols-4 gap-4 text-center">
<div>
<p className="text-xs text-muted-foreground"></p>
<p className="text-sm font-medium">{formatCompactNumber(stats?.circulationPool)}</p>
</div>
<div>
<p className="text-xs text-muted-foreground"></p>
<p className="text-xs text-muted-foreground"></p>
<p className="text-sm font-medium">{formatCompactNumber(stats?.networkEffectiveContribution)}</p>
</div>
<div>
<p className="text-xs text-muted-foreground"></p>
<p className="text-sm font-medium">{formatCompactNumber(stats?.networkTotalContribution)}</p>
</div>
<div>
<p className="text-xs text-muted-foreground"></p>
<p className="text-sm font-medium">{stats?.adoptedUsers?.toLocaleString() ?? '-'}</p>

View File

@ -48,6 +48,7 @@ export function StatsCards() {
{
title: '全网算力',
value: formatCompactNumber(stats?.networkEffectiveContribution),
subValue: `总算力: ${formatCompactNumber(stats?.networkTotalContribution)}`,
icon: Activity,
iconColor: 'text-blue-500',
},

View File

@ -2,6 +2,7 @@ export interface DashboardStats {
totalUsers: number;
adoptedUsers: number;
networkEffectiveContribution: string;
networkTotalContribution: string;
totalDistributed: string;
totalBurned: string;
circulationPool: string;

View File

@ -9,14 +9,14 @@ import '../../providers/user_providers.dart';
import '../../providers/mining_providers.dart';
///
class MiningRecordsPage extends ConsumerStatefulWidget {
const MiningRecordsPage({super.key});
class MiningRecordsListPage extends ConsumerStatefulWidget {
const MiningRecordsListPage({super.key});
@override
ConsumerState<MiningRecordsPage> createState() => _MiningRecordsPageState();
ConsumerState<MiningRecordsListPage> createState() => _MiningRecordsListPageState();
}
class _MiningRecordsPageState extends ConsumerState<MiningRecordsPage> {
class _MiningRecordsListPageState extends ConsumerState<MiningRecordsListPage> {
static const Color _orange = Color(0xFFFF6B00);
static const Color _green = Color(0xFF22C55E);
static const Color _grayText = Color(0xFF6B7280);