feat: usage export data
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import { formatLargeNumber } from '@/utils';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export const overviewConfigs = [
|
||||
{
|
||||
key: 'worker_count',
|
||||
@@ -21,3 +24,49 @@ export const overviewConfigs = [
|
||||
backgroundColor: 'var(--color-white-1)'
|
||||
}
|
||||
];
|
||||
|
||||
export const exportTableColumns = [
|
||||
{
|
||||
title: 'Date',
|
||||
dataIndex: 'date',
|
||||
render: (text: string) => {
|
||||
return dayjs(text).format('YYYY-MM-DD');
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'User',
|
||||
dataIndex: 'user',
|
||||
render: (text: string) => {
|
||||
return text || 'admin';
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Model',
|
||||
dataIndex: 'model',
|
||||
render: (text: string) => {
|
||||
return text || 'All Models';
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: 'Completion Tokens',
|
||||
dataIndex: 'completion_tokens',
|
||||
render: (text: number) => {
|
||||
return formatLargeNumber(text) || 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Prompt Tokens',
|
||||
dataIndex: 'prompt_tokens',
|
||||
render: (text: number) => {
|
||||
return formatLargeNumber(text) || 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'API Requests',
|
||||
dataIndex: 'request_count',
|
||||
render: (text: number) => {
|
||||
return formatLargeNumber(text) || 0;
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user