1
This commit is contained in:
@@ -20,6 +20,8 @@ interface UsageItem {
|
||||
creditsCost: number;
|
||||
tokensUsed: number;
|
||||
requestDurationMs: number;
|
||||
duration: number | null;
|
||||
resolution: string | null;
|
||||
status: string;
|
||||
errorMessage: string | null;
|
||||
errorCode: string | null;
|
||||
@@ -69,13 +71,15 @@ const AdminApiUsage: React.FC = () => {
|
||||
|
||||
// 导出 CSV
|
||||
const handleExport = () => {
|
||||
const headers = ['时间', '公司', 'api-key', '类型', '模型', '消耗(元)', 'Token', '耗时(ms)', '状态', '错误信息'];
|
||||
const headers = ['时间', '公司', 'api-key', '类型', '模型', '时长(秒)', '分辨率', '消耗(元)', 'Token', '耗时(ms)', '状态', '错误信息'];
|
||||
const rows = items.map(item => [
|
||||
item.createdAt ? new Date(item.createdAt).toLocaleString() : '',
|
||||
item.companyName || '',
|
||||
item.apiKeyPrefix || '',
|
||||
item.genType === 'video' ? '视频' : '图片',
|
||||
item.modelName || '',
|
||||
item.duration || '',
|
||||
item.resolution || '',
|
||||
(item.creditsCost || 0).toFixed(2),
|
||||
item.tokensUsed || '',
|
||||
item.requestDurationMs || '',
|
||||
|
||||
Reference in New Issue
Block a user