parent
4f5a12f33b
commit
02fcb6a61e
@ -13,6 +13,7 @@
|
|||||||
"every_month": "Moon",
|
"every_month": "Moon",
|
||||||
"export_confirm": "Export confirmation",
|
"export_confirm": "Export confirmation",
|
||||||
"export_confirm_tip": "There are currently {{total}} usage records in total. Are you sure to export?",
|
"export_confirm_tip": "There are currently {{total}} usage records in total. Are you sure to export?",
|
||||||
|
"export_title": "Time,Members,Type,Project name,AI points",
|
||||||
"feishu": "Feishu",
|
"feishu": "Feishu",
|
||||||
"generation_time": "Generation time",
|
"generation_time": "Generation time",
|
||||||
"input_token_length": "input tokens",
|
"input_token_length": "input tokens",
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
"export_confirm": "导出确认",
|
"export_confirm": "导出确认",
|
||||||
"export_confirm_tip": "当前共 {{total}} 条使用记录,确认导出?",
|
"export_confirm_tip": "当前共 {{total}} 条使用记录,确认导出?",
|
||||||
"export_success": "导出成功",
|
"export_success": "导出成功",
|
||||||
|
"export_title": "时间,成员,类型,项目名,AI 积分消耗",
|
||||||
"feishu": "飞书",
|
"feishu": "飞书",
|
||||||
"generation_time": "生成时间",
|
"generation_time": "生成时间",
|
||||||
"input_token_length": "输入 tokens",
|
"input_token_length": "输入 tokens",
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
"every_month": "月",
|
"every_month": "月",
|
||||||
"export_confirm": "導出確認",
|
"export_confirm": "導出確認",
|
||||||
"export_confirm_tip": "當前共 {{total}} 筆使用記錄,確認導出?",
|
"export_confirm_tip": "當前共 {{total}} 筆使用記錄,確認導出?",
|
||||||
|
"export_title": "時間,成員,類型,項目名,AI 積分消耗",
|
||||||
"feishu": "飛書",
|
"feishu": "飛書",
|
||||||
"generation_time": "生成時間",
|
"generation_time": "生成時間",
|
||||||
"input_token_length": "輸入 tokens",
|
"input_token_length": "輸入 tokens",
|
||||||
|
|||||||
@ -43,24 +43,47 @@ const UsageTableList = ({
|
|||||||
|
|
||||||
const { dateRange, selectTmbIds, isSelectAllTmb, usageSources, isSelectAllSource, projectName } =
|
const { dateRange, selectTmbIds, isSelectAllTmb, usageSources, isSelectAllSource, projectName } =
|
||||||
filterParams;
|
filterParams;
|
||||||
const requestParans = useMemo(
|
const requestParams = useMemo(() => {
|
||||||
() => ({
|
const appNameMap = {
|
||||||
|
['core.app.Question Guide']: t('common:core.app.Question Guide'),
|
||||||
|
['common:support.wallet.usage.Audio Speech']: t('common:support.wallet.usage.Audio Speech'),
|
||||||
|
['support.wallet.usage.Whisper']: t('common:support.wallet.usage.Whisper'),
|
||||||
|
['support.wallet.moduleName.index']: t('common:support.wallet.moduleName.index'),
|
||||||
|
['support.wallet.moduleName.qa']: t('common:support.wallet.moduleName.qa'),
|
||||||
|
['core.dataset.training.Auto mode']: t('common:core.dataset.training.Auto mode'),
|
||||||
|
['common:core.module.template.ai_chat']: t('common:core.module.template.ai_chat')
|
||||||
|
};
|
||||||
|
|
||||||
|
const sourcesMap = Object.fromEntries(
|
||||||
|
Object.entries(UsageSourceMap).map(([key, config]) => [
|
||||||
|
key,
|
||||||
|
{
|
||||||
|
label: t(config.label as any)
|
||||||
|
}
|
||||||
|
])
|
||||||
|
);
|
||||||
|
const title = t('account_usage:export_title');
|
||||||
|
|
||||||
|
return {
|
||||||
dateStart: dateRange.from || new Date(),
|
dateStart: dateRange.from || new Date(),
|
||||||
dateEnd: addDays(dateRange.to || new Date(), 1),
|
dateEnd: addDays(dateRange.to || new Date(), 1),
|
||||||
sources: isSelectAllSource ? undefined : usageSources,
|
sources: isSelectAllSource ? undefined : usageSources,
|
||||||
|
sourcesMap,
|
||||||
|
appNameMap,
|
||||||
|
title,
|
||||||
teamMemberIds: isSelectAllTmb ? undefined : selectTmbIds,
|
teamMemberIds: isSelectAllTmb ? undefined : selectTmbIds,
|
||||||
projectName
|
projectName
|
||||||
}),
|
};
|
||||||
[
|
}, [
|
||||||
dateRange.from,
|
dateRange.from,
|
||||||
dateRange.to,
|
dateRange.to,
|
||||||
isSelectAllSource,
|
isSelectAllSource,
|
||||||
isSelectAllTmb,
|
isSelectAllTmb,
|
||||||
projectName,
|
projectName,
|
||||||
selectTmbIds,
|
selectTmbIds,
|
||||||
usageSources
|
usageSources,
|
||||||
]
|
t
|
||||||
);
|
]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: usages,
|
data: usages,
|
||||||
@ -69,8 +92,8 @@ const UsageTableList = ({
|
|||||||
total
|
total
|
||||||
} = usePagination(getUserUsages, {
|
} = usePagination(getUserUsages, {
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
params: requestParans,
|
params: requestParams,
|
||||||
refreshDeps: [requestParans]
|
refreshDeps: [requestParams]
|
||||||
});
|
});
|
||||||
|
|
||||||
const [usageDetail, setUsageDetail] = useState<UsageItemType>();
|
const [usageDetail, setUsageDetail] = useState<UsageItemType>();
|
||||||
@ -80,11 +103,11 @@ const UsageTableList = ({
|
|||||||
await downloadFetch({
|
await downloadFetch({
|
||||||
url: `/api/proApi/support/wallet/usage/exportUsage`,
|
url: `/api/proApi/support/wallet/usage/exportUsage`,
|
||||||
filename: `usage.csv`,
|
filename: `usage.csv`,
|
||||||
body: requestParans
|
body: requestParams
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
refreshDeps: [requestParans]
|
refreshDeps: [requestParams]
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user