Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 59748c7b7f | |||
| c3b77479a0 | |||
| 374ac1fd90 |
@@ -300,8 +300,6 @@ export default function AdRevenueReportPage() {
|
|||||||
const { message } = App.useApp();
|
const { message } = App.useApp();
|
||||||
const [range, setRange] = useState<[Dayjs, Dayjs]>([dayjs().subtract(1, 'day'), dayjs().subtract(1, 'day')]);
|
const [range, setRange] = useState<[Dayjs, Dayjs]>([dayjs().subtract(1, 'day'), dayjs().subtract(1, 'day')]);
|
||||||
const [userId, setUserId] = useState<number | null>(null);
|
const [userId, setUserId] = useState<number | null>(null);
|
||||||
const [appEnv, setAppEnv] = useState<'prod' | 'test' | 'all'>('prod');
|
|
||||||
const [revenueScope, setRevenueScope] = useState<'business' | 'all'>('business');
|
|
||||||
const [adType, setAdType] = useState<string | undefined>();
|
const [adType, setAdType] = useState<string | undefined>();
|
||||||
// 「场景」作为后端全局筛选(feed_scene):同时影响明细 / 合计 / 趋势,与「用户 / 类型」一致,点「查询」生效。
|
// 「场景」作为后端全局筛选(feed_scene):同时影响明细 / 合计 / 趋势,与「用户 / 类型」一致,点「查询」生效。
|
||||||
const [scene, setScene] = useState<string | undefined>();
|
const [scene, setScene] = useState<string | undefined>();
|
||||||
@@ -335,8 +333,6 @@ export default function AdRevenueReportPage() {
|
|||||||
date_from: from,
|
date_from: from,
|
||||||
date_to: to,
|
date_to: to,
|
||||||
user_id: userId ?? undefined,
|
user_id: userId ?? undefined,
|
||||||
app_env: appEnv === 'all' ? undefined : appEnv,
|
|
||||||
revenue_scope: revenueScope,
|
|
||||||
ad_type: adType ?? undefined,
|
ad_type: adType ?? undefined,
|
||||||
feed_scene: scene ?? undefined,
|
feed_scene: scene ?? undefined,
|
||||||
granularity: gran,
|
granularity: gran,
|
||||||
@@ -378,7 +374,7 @@ export default function AdRevenueReportPage() {
|
|||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[range, userId, appEnv, revenueScope, adType, scene, granularity, limit, sortBy],
|
[range, userId, adType, scene, granularity, limit, sortBy],
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -624,8 +620,7 @@ export default function AdRevenueReportPage() {
|
|||||||
<br />
|
<br />
|
||||||
核心指标里的<b>「穿山甲后台收益(T+1)」</b>来自穿山甲 GroMore 数据 API(后台结算口径,次日出数):
|
核心指标里的<b>「穿山甲后台收益(T+1)」</b>来自穿山甲 GroMore 数据 API(后台结算口径,次日出数):
|
||||||
<b>穿山甲预估收益</b>=接口 revenue、<b>收益API</b>=各 ADN 回传更接近结算。穿山甲不提供分用户/类型/场景维度,
|
<b>穿山甲预估收益</b>=接口 revenue、<b>收益API</b>=各 ADN 回传更接近结算。穿山甲不提供分用户/类型/场景维度,
|
||||||
故仅在<b>可对账视图</b>(未按用户/类型/场景筛选)展示;环境和数据范围会同时作用于客户端与穿山甲汇总。
|
故仅在<b>全量视图</b>(未按用户/类型/场景筛选)展示;逐条事件行仍是客户端预估,不受其影响。
|
||||||
默认“正式 + 业务代码位”用于同口径对账;切到“全部代码位”会包含广告测试等非业务曝光。
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -660,31 +655,6 @@ export default function AdRevenueReportPage() {
|
|||||||
style={{ width: 130 }}
|
style={{ width: 130 }}
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
<Space size={6}>
|
|
||||||
<Typography.Text type="secondary">环境</Typography.Text>
|
|
||||||
<Select
|
|
||||||
value={appEnv}
|
|
||||||
onChange={setAppEnv}
|
|
||||||
style={{ width: 130 }}
|
|
||||||
options={[
|
|
||||||
{ value: 'prod', label: '正式(prod)' },
|
|
||||||
{ value: 'test', label: '测试(dev)' },
|
|
||||||
{ value: 'all', label: '全部' },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
<Space size={6}>
|
|
||||||
<Typography.Text type="secondary">数据范围</Typography.Text>
|
|
||||||
<Select
|
|
||||||
value={revenueScope}
|
|
||||||
onChange={setRevenueScope}
|
|
||||||
style={{ width: 150 }}
|
|
||||||
options={[
|
|
||||||
{ value: 'business', label: '业务代码位' },
|
|
||||||
{ value: 'all', label: '全部代码位' },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
<Space size={6}>
|
<Space size={6}>
|
||||||
<Typography.Text type="secondary">类型</Typography.Text>
|
<Typography.Text type="secondary">类型</Typography.Text>
|
||||||
<Select
|
<Select
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import type { CSSProperties, ReactNode } from 'react';
|
import type { CSSProperties, ReactNode } from 'react';
|
||||||
import {
|
import {
|
||||||
App, Button, Card, Col, Collapse, DatePicker, Descriptions, Divider, Drawer, Input, InputNumber,
|
App, Button, Card, Col, Collapse, DatePicker, Descriptions, Divider, Drawer, Input, InputNumber,
|
||||||
@@ -9,13 +9,8 @@ import {
|
|||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
import dayjs, { type Dayjs } from 'dayjs';
|
import dayjs, { type Dayjs } from 'dayjs';
|
||||||
import { api, errMsg } from '@/lib/api';
|
import { api, errMsg } from '@/lib/api';
|
||||||
import { formatWallTime, yuan } from '@/lib/format';
|
import { formatWallTime, percentile, yuan } from '@/lib/format';
|
||||||
import type {
|
import type { ComparisonRecordDetail, ComparisonRecordListItem, CursorPage } from '@/lib/types';
|
||||||
ComparisonRecordDetail,
|
|
||||||
ComparisonRecordListItem,
|
|
||||||
ComparisonRecordsSummary,
|
|
||||||
CursorPage,
|
|
||||||
} from '@/lib/types';
|
|
||||||
|
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
|
|
||||||
@@ -110,11 +105,8 @@ export default function ComparisonRecordsPage() {
|
|||||||
date_from: dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
|
date_from: dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
|
||||||
date_to: dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
|
date_to: dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
|
||||||
});
|
});
|
||||||
const [items, setItems] = useState<ComparisonRecordListItem[]>([]);
|
const [allItems, setAllItems] = useState<ComparisonRecordListItem[]>([]);
|
||||||
const [total, setTotal] = useState(0);
|
const [loading, setLoading] = useState(false);
|
||||||
const [overview, setOverview] = useState<ComparisonRecordsSummary | null>(null);
|
|
||||||
const [listLoading, setListLoading] = useState(false);
|
|
||||||
const [summaryLoading, setSummaryLoading] = useState(false);
|
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
const [pageSize, setPageSize] = useState(20);
|
const [pageSize, setPageSize] = useState(20);
|
||||||
// LLM 单价(元/百万 token),本地持久化;仅用于前端估算成本,不入库、不影响其它页面
|
// LLM 单价(元/百万 token),本地持久化;仅用于前端估算成本,不入库、不影响其它页面
|
||||||
@@ -133,8 +125,7 @@ export default function ComparisonRecordsPage() {
|
|||||||
const [detail, setDetail] = useState<ComparisonRecordDetail | null>(null);
|
const [detail, setDetail] = useState<ComparisonRecordDetail | null>(null);
|
||||||
const [detailLoading, setDetailLoading] = useState(false);
|
const [detailLoading, setDetailLoading] = useState(false);
|
||||||
|
|
||||||
const search = () => {
|
const search = () =>
|
||||||
setPage(1);
|
|
||||||
setApplied({
|
setApplied({
|
||||||
date_from: range[0].format('YYYY-MM-DD'),
|
date_from: range[0].format('YYYY-MM-DD'),
|
||||||
date_to: range[1].format('YYYY-MM-DD'),
|
date_to: range[1].format('YYYY-MM-DD'),
|
||||||
@@ -144,7 +135,6 @@ export default function ComparisonRecordsPage() {
|
|||||||
store: store.trim() || undefined,
|
store: store.trim() || undefined,
|
||||||
product: product.trim() || undefined,
|
product: product.trim() || undefined,
|
||||||
});
|
});
|
||||||
};
|
|
||||||
|
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
setUserId(null);
|
setUserId(null);
|
||||||
@@ -153,7 +143,6 @@ export default function ComparisonRecordsPage() {
|
|||||||
setStore('');
|
setStore('');
|
||||||
setProduct('');
|
setProduct('');
|
||||||
const yesterday = dayjs().subtract(1, 'day');
|
const yesterday = dayjs().subtract(1, 'day');
|
||||||
setPage(1);
|
|
||||||
setRange([yesterday, yesterday]);
|
setRange([yesterday, yesterday]);
|
||||||
setApplied({
|
setApplied({
|
||||||
date_from: yesterday.format('YYYY-MM-DD'),
|
date_from: yesterday.format('YYYY-MM-DD'),
|
||||||
@@ -163,50 +152,49 @@ export default function ComparisonRecordsPage() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let alive = true;
|
let alive = true;
|
||||||
const loadPage = async () => {
|
const loadAll = async () => {
|
||||||
setListLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const { data } = await api.get<CursorPage<ComparisonRecordListItem>>(
|
const serverFilters = { ...applied };
|
||||||
'/admin/api/comparison-records',
|
delete serverFilters.date_from;
|
||||||
{ params: { ...applied, limit: pageSize, cursor: (page - 1) * pageSize } },
|
delete serverFilters.date_to;
|
||||||
);
|
const rows: ComparisonRecordListItem[] = [];
|
||||||
|
let cursor = 0;
|
||||||
|
for (let pageIndex = 0; pageIndex < 200; pageIndex += 1) {
|
||||||
|
const { data } = await api.get<CursorPage<ComparisonRecordListItem>>(
|
||||||
|
'/admin/api/comparison-records',
|
||||||
|
{ params: { ...serverFilters, limit: 100, cursor } },
|
||||||
|
);
|
||||||
|
rows.push(...data.items);
|
||||||
|
if (data.next_cursor == null || data.items.length === 0) break;
|
||||||
|
cursor = data.next_cursor;
|
||||||
|
}
|
||||||
if (alive) {
|
if (alive) {
|
||||||
setItems(data.items);
|
setAllItems(rows);
|
||||||
setTotal(data.total ?? 0);
|
setPage(1);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (alive) message.error(errMsg(e));
|
if (alive) message.error(errMsg(e));
|
||||||
} finally {
|
} finally {
|
||||||
if (alive) setListLoading(false);
|
if (alive) setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
loadPage();
|
loadAll();
|
||||||
return () => {
|
|
||||||
alive = false;
|
|
||||||
};
|
|
||||||
}, [applied, message, page, pageSize]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
let alive = true;
|
|
||||||
const loadSummary = async () => {
|
|
||||||
setSummaryLoading(true);
|
|
||||||
try {
|
|
||||||
const { data } = await api.get<ComparisonRecordsSummary>(
|
|
||||||
'/admin/api/comparison-records/summary',
|
|
||||||
{ params: applied },
|
|
||||||
);
|
|
||||||
if (alive) setOverview(data);
|
|
||||||
} catch (e) {
|
|
||||||
if (alive) message.error(errMsg(e));
|
|
||||||
} finally {
|
|
||||||
if (alive) setSummaryLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
loadSummary();
|
|
||||||
return () => {
|
return () => {
|
||||||
alive = false;
|
alive = false;
|
||||||
};
|
};
|
||||||
}, [applied, message]);
|
}, [applied, message]);
|
||||||
|
|
||||||
|
const filteredItems = useMemo(() => {
|
||||||
|
const from = String(applied.date_from ?? '');
|
||||||
|
const to = String(applied.date_to ?? '');
|
||||||
|
return allItems.filter((item) => {
|
||||||
|
const date = dayjs(item.created_at).format('YYYY-MM-DD');
|
||||||
|
return (!from || date >= from) && (!to || date <= to);
|
||||||
|
});
|
||||||
|
}, [allItems, applied]);
|
||||||
|
const total = filteredItems.length;
|
||||||
|
const items = filteredItems.slice((page - 1) * pageSize, page * pageSize);
|
||||||
const onChange = (nextPage: number, nextPageSize: number) => {
|
const onChange = (nextPage: number, nextPageSize: number) => {
|
||||||
setPageSize(nextPageSize);
|
setPageSize(nextPageSize);
|
||||||
setPage(nextPageSize === pageSize ? nextPage : 1);
|
setPage(nextPageSize === pageSize ? nextPage : 1);
|
||||||
@@ -230,6 +218,46 @@ export default function ComparisonRecordsPage() {
|
|||||||
setDetailLoading(false);
|
setDetailLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const overview = useMemo(() => {
|
||||||
|
const completed = filteredItems.filter(
|
||||||
|
(item) => item.status === 'success' || item.status === 'failed',
|
||||||
|
);
|
||||||
|
const cancelled = filteredItems.filter((item) => item.status === 'cancelled');
|
||||||
|
const success = filteredItems.filter((item) => item.status === 'success');
|
||||||
|
const successRateDenominator = filteredItems.length - cancelled.length;
|
||||||
|
const completedDurations = completed
|
||||||
|
.map((item) => item.total_ms)
|
||||||
|
.filter((value): value is number => value != null);
|
||||||
|
const cancelledDurations = cancelled
|
||||||
|
.map((item) => item.total_ms)
|
||||||
|
.filter((value): value is number => value != null);
|
||||||
|
const costs = filteredItems
|
||||||
|
.map((item) => item.llm_cost_yuan)
|
||||||
|
.filter((value): value is number => value != null);
|
||||||
|
const avg = (values: number[]) =>
|
||||||
|
values.length ? values.reduce((sum, value) => sum + value, 0) / values.length : null;
|
||||||
|
return {
|
||||||
|
started: filteredItems.length,
|
||||||
|
completed: completed.length,
|
||||||
|
success: success.length,
|
||||||
|
successRate: successRateDenominator ? success.length / successRateDenominator : null,
|
||||||
|
avgTokenCost: avg(costs),
|
||||||
|
lowerPriceRate: success.length
|
||||||
|
? success.filter((item) => (item.saved_amount_cents ?? 0) > 0).length / success.length
|
||||||
|
: null,
|
||||||
|
avgMs: avg(completedDurations),
|
||||||
|
p5Ms: percentile(completedDurations, 0.05),
|
||||||
|
p50Ms: percentile(completedDurations, 0.5),
|
||||||
|
p95Ms: percentile(completedDurations, 0.95),
|
||||||
|
p99Ms: percentile(completedDurations, 0.99),
|
||||||
|
cancelled: cancelled.length,
|
||||||
|
cancelledRate: filteredItems.length ? cancelled.length / filteredItems.length : null,
|
||||||
|
cancelledP5Ms: percentile(cancelledDurations, 0.05),
|
||||||
|
cancelledP50Ms: percentile(cancelledDurations, 0.5),
|
||||||
|
cancelledP95Ms: percentile(cancelledDurations, 0.95),
|
||||||
|
};
|
||||||
|
}, [filteredItems]);
|
||||||
|
|
||||||
const columns: ColumnsType<ComparisonRecordListItem> = [
|
const columns: ColumnsType<ComparisonRecordListItem> = [
|
||||||
{ title: '时间', dataIndex: 'created_at', width: 150, render: (v: string) => formatWallTime(v) },
|
{ title: '时间', dataIndex: 'created_at', width: 150, render: (v: string) => formatWallTime(v) },
|
||||||
{
|
{
|
||||||
@@ -396,28 +424,28 @@ export default function ComparisonRecordsPage() {
|
|||||||
</Space>
|
</Space>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card size="small" style={{ marginBottom: 16 }} loading={summaryLoading}>
|
<Card size="small" style={{ marginBottom: 16 }} loading={loading}>
|
||||||
<Divider orientation="left" plain style={{ marginTop: 0 }}>数据概览</Divider>
|
<Divider orientation="left" plain style={{ marginTop: 0 }}>数据概览</Divider>
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col xs={12} md={6}><Statistic title="比价发起数" value={overview?.started ?? 0} /></Col>
|
<Col xs={12} md={6}><Statistic title="比价发起数" value={overview.started} /></Col>
|
||||||
<Col xs={12} md={6}><Statistic title="比价完成数" value={overview?.completed ?? 0} /></Col>
|
<Col xs={12} md={6}><Statistic title="比价完成数" value={overview.completed} /></Col>
|
||||||
<Col xs={12} md={6}><Statistic title="比价成功次数" value={overview?.success ?? 0} /></Col>
|
<Col xs={12} md={6}><Statistic title="比价成功次数" value={overview.success} /></Col>
|
||||||
<Col xs={12} md={6}><Statistic title="比价成功率" value={fmtRate(overview?.success_rate ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="比价成功率" value={fmtRate(overview.successRate)} /></Col>
|
||||||
<Col xs={12} md={6}><Statistic title="平均 TOKEN 成本" value={overview?.avg_token_cost ?? '-'} precision={4} prefix="¥" /></Col>
|
<Col xs={12} md={6}><Statistic title="平均 TOKEN 成本" value={overview.avgTokenCost ?? '-'} precision={4} prefix="¥" /></Col>
|
||||||
<Col xs={12} md={6}><Statistic title="比出更低价率" value={fmtRate(overview?.lower_price_rate ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="比出更低价率" value={fmtRate(overview.lowerPriceRate)} /></Col>
|
||||||
<Col xs={12} md={6}><Statistic title="耗时平均数" value={fmtMs(overview?.avg_duration_ms ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="耗时平均数" value={fmtMs(overview.avgMs)} /></Col>
|
||||||
<Col xs={12} md={6}><Statistic title="耗时 5 分位" value={fmtMs(overview?.p5_duration_ms ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="耗时 5 分位" value={fmtMs(overview.p5Ms)} /></Col>
|
||||||
<Col xs={12} md={6}><Statistic title="耗时 50 分位" value={fmtMs(overview?.p50_duration_ms ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="耗时 50 分位" value={fmtMs(overview.p50Ms)} /></Col>
|
||||||
<Col xs={12} md={6}><Statistic title="耗时 95 分位" value={fmtMs(overview?.p95_duration_ms ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="耗时 95 分位" value={fmtMs(overview.p95Ms)} /></Col>
|
||||||
<Col xs={12} md={6}><Statistic title="耗时 99 分位" value={fmtMs(overview?.p99_duration_ms ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="耗时 99 分位" value={fmtMs(overview.p99Ms)} /></Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Divider orientation="left" plain>中途退出</Divider>
|
<Divider orientation="left" plain>中途退出</Divider>
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col flex="1 1 180px"><Statistic title="中途退出次数" value={overview?.cancelled ?? 0} /></Col>
|
<Col xs={12} md={6}><Statistic title="中途退出次数" value={overview.cancelled} /></Col>
|
||||||
<Col flex="1 1 180px"><Statistic title="中途退出率" value={fmtRate(overview?.cancelled_rate ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="中途退出率" value={fmtRate(overview.cancelledRate)} /></Col>
|
||||||
<Col flex="1 1 180px"><Statistic title="退出耗时 5 分位" value={fmtMs(overview?.cancelled_p5_ms ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="退出耗时 5 分位" value={fmtMs(overview.cancelledP5Ms)} /></Col>
|
||||||
<Col flex="1 1 180px"><Statistic title="退出耗时 50 分位" value={fmtMs(overview?.cancelled_p50_ms ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="退出耗时 50 分位" value={fmtMs(overview.cancelledP50Ms)} /></Col>
|
||||||
<Col flex="1 1 180px"><Statistic title="退出耗时 95 分位" value={fmtMs(overview?.cancelled_p95_ms ?? null)} /></Col>
|
<Col xs={12} md={6}><Statistic title="退出耗时 95 分位" value={fmtMs(overview.cancelledP95Ms)} /></Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
@@ -425,7 +453,7 @@ export default function ComparisonRecordsPage() {
|
|||||||
rowKey="id"
|
rowKey="id"
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={items}
|
dataSource={items}
|
||||||
loading={listLoading}
|
loading={loading}
|
||||||
pagination={{
|
pagination={{
|
||||||
current: page,
|
current: page,
|
||||||
pageSize,
|
pageSize,
|
||||||
|
|||||||
@@ -499,7 +499,12 @@ export default function DashboardPage() {
|
|||||||
const tokenCostYuan = periodData?.comparison.token_cost_total_yuan ?? null;
|
const tokenCostYuan = periodData?.comparison.token_cost_total_yuan ?? null;
|
||||||
const couponRewardCoinTotal = periodData?.coins.coupon_reward_coin_total;
|
const couponRewardCoinTotal = periodData?.coins.coupon_reward_coin_total;
|
||||||
const comparisonRewardCoinTotal = periodData?.coins.comparison_reward_coin_total;
|
const comparisonRewardCoinTotal = periodData?.coins.comparison_reward_coin_total;
|
||||||
const regularTaskCoinTotal = periodData?.coins.regular_task_coin_total;
|
const signinCoinTotal = periodData?.coins.signin_coin_total;
|
||||||
|
const signinBoostCoinTotal = periodData?.coins.signin_boost_coin_total;
|
||||||
|
const taskCoinTotal = periodData?.coins.task_coin_total;
|
||||||
|
const regularTaskCoinTotal =
|
||||||
|
periodData?.coins.regular_task_coin_total ??
|
||||||
|
((signinCoinTotal ?? 0) + (signinBoostCoinTotal ?? 0) + (taskCoinTotal ?? 0));
|
||||||
const cpsAvailable = data?.cps.available === true;
|
const cpsAvailable = data?.cps.available === true;
|
||||||
const meituanCpsCommissionCents = data?.cps.meituan_commission_cents;
|
const meituanCpsCommissionCents = data?.cps.meituan_commission_cents;
|
||||||
const jdCpsCommissionCents = data?.cps.jd_commission_cents;
|
const jdCpsCommissionCents = data?.cps.jd_commission_cents;
|
||||||
@@ -1072,7 +1077,6 @@ export default function DashboardPage() {
|
|||||||
value={fmtInt(regularTaskCoinTotal)}
|
value={fmtInt(regularTaskCoinTotal)}
|
||||||
delta={regularTaskCoinRatio.value}
|
delta={regularTaskCoinRatio.value}
|
||||||
deltaTone={regularTaskCoinRatio.tone}
|
deltaTone={regularTaskCoinRatio.tone}
|
||||||
hint="每日签到、历史签到膨胀、通知/其他任务、上报更低价和反馈采纳的实发金币之和。"
|
|
||||||
/>
|
/>
|
||||||
<StatCard
|
<StatCard
|
||||||
title="本期提现金额"
|
title="本期提现金额"
|
||||||
|
|||||||
@@ -364,25 +364,6 @@ export interface ComparisonRecordListItem {
|
|||||||
created_at: string;
|
created_at: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ComparisonRecordsSummary {
|
|
||||||
started: number;
|
|
||||||
completed: number;
|
|
||||||
success: number;
|
|
||||||
success_rate: number | null;
|
|
||||||
avg_token_cost: number | null;
|
|
||||||
lower_price_rate: number | null;
|
|
||||||
avg_duration_ms: number | null;
|
|
||||||
p5_duration_ms: number | null;
|
|
||||||
p50_duration_ms: number | null;
|
|
||||||
p95_duration_ms: number | null;
|
|
||||||
p99_duration_ms: number | null;
|
|
||||||
cancelled: number;
|
|
||||||
cancelled_rate: number | null;
|
|
||||||
cancelled_p5_ms: number | null;
|
|
||||||
cancelled_p50_ms: number | null;
|
|
||||||
cancelled_p95_ms: number | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 单次 LLM 调用明细(pricebot chat() 收口落盘,server 按 trace 拉来)
|
// 单次 LLM 调用明细(pricebot chat() 收口落盘,server 按 trace 拉来)
|
||||||
export interface LlmCall {
|
export interface LlmCall {
|
||||||
ts?: number;
|
ts?: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user