优化代码

This commit is contained in:
h88782481 2026-03-09 19:43:51 +08:00
parent 202731df74
commit 96fbc4da80
15 changed files with 2768 additions and 1383 deletions

View file

@ -124,8 +124,18 @@ async function loadMappings() {
el.innerHTML = '<div class="mapping-list">' + keys.map(name => {
const m = mappings[name];
const backend = m.backend || 'auto';
const tagClass = backend === 'anthropic' ? 'tag-anthropic' : backend === 'openai' ? 'tag-openai' : 'tag-auto';
const tagLabel = backend === 'auto' ? '自动' : backend;
const tagClass = backend === 'anthropic'
? 'tag-anthropic'
: backend === 'responses'
? 'tag-responses'
: backend === 'openai'
? 'tag-openai'
: 'tag-auto';
const tagLabel = backend === 'auto'
? '自动'
: backend === 'responses'
? 'responses'
: backend;
const hasOverride = m.target_url || m.api_key;
return `<div class="mapping-item">
<div class="mapping-top">