Merge pull request #2703 from seefs001/feature/log-conversion-info

feat: log shows request conversion
This commit is contained in:
Calcium-Ion
2026-01-21 23:48:08 +08:00
committed by GitHub
15 changed files with 165 additions and 15 deletions

View File

@@ -306,6 +306,16 @@ export const useLogsData = () => {
// Format logs data
const setLogsFormat = (logs) => {
const requestConversionDisplayValue = (conversionChain) => {
const chain = Array.isArray(conversionChain)
? conversionChain.filter(Boolean)
: [];
if (chain.length <= 1) {
return t('原生格式');
}
return `${chain.join(' -> ')}`;
};
let expandDatesLocal = {};
for (let i = 0; i < logs.length; i++) {
logs[i].timestamp2string = timestamp2string(logs[i].created_at);
@@ -482,6 +492,12 @@ export const useLogsData = () => {
value: other.request_path,
});
}
if (isAdminUser) {
expandDataLocal.push({
key: t('请求转换'),
value: requestConversionDisplayValue(other?.request_conversion),
});
}
if (isAdminUser) {
let localCountMode = '';
if (other?.admin_info?.local_count_tokens) {

View File

@@ -2093,6 +2093,9 @@
"请求结束后多退少补": "Adjust after request completion",
"请求超时,请刷新页面后重新发起 GitHub 登录": "Request timed out, please refresh and restart GitHub login",
"请求路径": "Request path",
"请求转换": "Request conversion",
"原生格式": "Native format",
"转换": "Convert",
"请求预扣费额度": "Pre-deduction quota for requests",
"请点击我": "Please click me",
"请确认以下设置信息,点击\"初始化系统\"开始配置": "Please confirm the following settings information, click \"Initialize system\" to start configuration",

View File

@@ -2079,6 +2079,9 @@
"请求结束后多退少补": "请求结束后多退少补",
"请求超时,请刷新页面后重新发起 GitHub 登录": "请求超时,请刷新页面后重新发起 GitHub 登录",
"请求路径": "请求路径",
"请求转换": "请求转换",
"原生格式": "原生格式",
"转换": "转换",
"请求预扣费额度": "请求预扣费额度",
"请点击我": "请点击我",
"请确认以下设置信息,点击\"初始化系统\"开始配置": "请确认以下设置信息,点击\"初始化系统\"开始配置",