feat: add manual recharge and operation logs

This commit is contained in:
hectorzhao
2026-07-01 15:54:56 +08:00
parent 50d75f1cf3
commit 7ff6d7eac3
14 changed files with 339 additions and 32 deletions
+16 -16
View File
@@ -51,8 +51,8 @@ export function ClientHome() {
const pendingTemplates = templates.filter((item) => item.status === 'pending').length;
const pendingSignatures = signatures.filter((item) => item.status === 'pending').length;
const latestInvoice = invoices[0];
const quotaTotal = overview.availableMessages + overview.todaySent;
const quotaPercent = Math.round((overview.availableMessages / quotaTotal) * 100);
const balanceBaseline = overview.availableBalance + overview.todaySpend - overview.todayRefund;
const balancePercent = Math.min(100, Math.round((overview.availableBalance / balanceBaseline) * 100));
const sendTrendOption = useMemo(
() => createLineOption({
@@ -73,7 +73,7 @@ export function ClientHome() {
<div>
<p className="eyebrow"></p>
<h1></h1>
<p className="muted"></p>
<p className="muted"></p>
</div>
<div className="page-actions">
<Button icon={<Plus size={16} />} onClick={() => navigate('/client/templates')} variant="ghost">
@@ -85,19 +85,19 @@ export function ClientHome() {
<div className="dashboard-grid">
<div className="surface metric-card metric-card--featured">
<span></span>
<strong>{overview.availableMessages.toLocaleString('zh-CN')}</strong>
<small> {overview.todaySent.toLocaleString('zh-CN')} </small>
<span></span>
<strong>¥{overview.availableBalance.toLocaleString('zh-CN', { minimumFractionDigits: 2 })}</strong>
<small> ¥{overview.todaySpend.toLocaleString('zh-CN', { minimumFractionDigits: 2 })}</small>
</div>
<div className="surface metric-card">
<span></span>
<strong>{overview.successRate}%</strong>
<small> 24 </small>
<span></span>
<strong>{overview.todaySent.toLocaleString('zh-CN')}</strong>
<small> {overview.todaySuccessRate}%</small>
</div>
<div className="surface metric-card">
<span></span>
<strong>{pendingTemplates + pendingSignatures}</strong>
<small> {pendingTemplates} {pendingSignatures}</small>
<span></span>
<strong>¥{overview.todayRefund.toLocaleString('zh-CN', { minimumFractionDigits: 2 })}</strong>
<small>退</small>
</div>
</div>
@@ -128,7 +128,7 @@ export function ClientHome() {
<button className="quick-action" onClick={() => navigate('/client/billing')} type="button">
<WalletCards size={20} />
<span></span>
<small></small>
<small></small>
</button>
</div>
</div>
@@ -157,11 +157,11 @@ export function ClientHome() {
</div>
<div>
<div className="progress-heading">
<span></span>
<strong>{quotaPercent}%</strong>
<span></span>
<strong>{balancePercent}%</strong>
</div>
<div className="progress-track">
<span style={{ width: `${quotaPercent}%` }} />
<span style={{ width: `${balancePercent}%` }} />
</div>
</div>
</div>