feat: optimized display

This commit is contained in:
Seefs
2026-01-21 00:01:36 +08:00
parent d4582ede98
commit 6582020c80
2 changed files with 22 additions and 11 deletions

View File

@@ -83,10 +83,18 @@ func appendRequestConversionChain(relayInfo *relaycommon.RelayInfo, other map[st
}
chain := make([]string, 0, len(relayInfo.RequestConversionChain))
for _, f := range relayInfo.RequestConversionChain {
if f == "" {
continue
switch f {
case types.RelayFormatOpenAI:
chain = append(chain, "OpenAI Compatible")
case types.RelayFormatClaude:
chain = append(chain, "Claude Messages")
case types.RelayFormatGemini:
chain = append(chain, "Google Gemini")
case types.RelayFormatOpenAIResponses:
chain = append(chain, "OpenAI Responses")
default:
chain = append(chain, string(f))
}
chain = append(chain, string(f))
}
if len(chain) == 0 {
return

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);
@@ -477,16 +487,9 @@ export const useLogsData = () => {
}
}
if (isAdminUser) {
const requestConversionChain = other?.request_conversion;
const chain = Array.isArray(requestConversionChain)
? requestConversionChain.filter(Boolean)
: [];
expandDataLocal.push({
key: t('请求转换'),
value:
chain.length > 1
? `${chain.join(' -> ')}`
: t('原生格式'),
value: requestConversionDisplayValue(other?.request_conversion),
});
}
if (isAdminUser) {