mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 02:05:21 +00:00
feat: optimized display
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user