Skip to content

Commit bf5823d

Browse files
committed
feat(web-ui): add transform provider visual indicators
1 parent 3e1deb0 commit bf5823d

5 files changed

Lines changed: 48 additions & 3 deletions

File tree

tests/unit/web-ui-behavior-parity.test.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ test('captured bundled app skeleton only exposes expected data key drift versus
335335
'sessionsUsageLoadedLimit',
336336
'taskOrchestrationTabEnabled',
337337
'taskOrchestration',
338-
'_taskOrchestrationPollTimer'
338+
'_taskOrchestrationPollTimer',
339+
'displayProviderUrl',
340+
'isTransformProvider'
339341
] : [
340342
'__mainTabSwitchState',
341343
'openclawAuthProfilesByProvider',
@@ -629,7 +631,9 @@ test('captured bundled app skeleton only exposes expected data key drift versus
629631
'taskOrchestrationQueueStats',
630632
'taskOrchestrationDraftMetrics',
631633
'taskOrchestrationDraftChecklist',
632-
'taskOrchestrationDraftReadiness'
634+
'taskOrchestrationDraftReadiness',
635+
'displayProviderUrl',
636+
'isTransformProvider'
633637
];
634638
const allowedMissingCurrentComputedKeys = [
635639
'hasLocalAndProxy',

web-ui/modules/app.computed.dashboard.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { getProviderDisplayUrl, checkIsTransformProvider } from './provider-url-display.mjs';
12
export function createDashboardComputed() {
23
return {
34
agentsDiffHasChanges() {
@@ -39,6 +40,14 @@ export function createDashboardComputed() {
3940
const list = Array.isArray(this.providersList) ? this.providersList : [];
4041
return list;
4142
},
43+
44+
displayProviderUrl() {
45+
return (provider) => getProviderDisplayUrl(provider);
46+
},
47+
48+
isTransformProvider() {
49+
return (provider) => checkIsTransformProvider(provider);
50+
},
4251
installTargetCards() {
4352
const targets = Array.isArray(this.installStatusTargets) && this.installStatusTargets.length
4453
? this.installStatusTargets
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export function getProviderDisplayUrl(provider) {
2+
if (!provider) return '';
3+
const bridge = typeof provider.codexmate_bridge === 'string' ? provider.codexmate_bridge.trim() : '';
4+
if (bridge === 'openai') return provider.url || '';
5+
return provider.url || '';
6+
}
7+
8+
export function checkIsTransformProvider(provider) {
9+
if (!provider || typeof provider !== 'object') return false;
10+
const bridge = typeof provider.codexmate_bridge === 'string' ? provider.codexmate_bridge.trim() : '';
11+
if (bridge === 'openai') return true;
12+
const url = String(provider.url || '');
13+
return url.includes('/bridge/openai/');
14+
}

web-ui/partials/index/panel-config-codex.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,10 @@
209209
<div class="card-title">
210210
<span>{{ provider.name }}</span>
211211
<span v-if="provider.readOnly" class="provider-readonly-badge">{{ t('config.badge.system') }}</span>
212+
<span v-if="isTransformProvider(provider)" class="provider-transform-icon" title="通过内建转换适配">🔌</span>
212213
</div>
213214
<div class="card-subtitle">
214-
{{ provider.url || t('config.url.unset') }}
215+
{{ displayProviderUrl(provider) || t('config.url.unset') }}
215216
</div>
216217
</div>
217218
</div>

web-ui/styles/titles-cards.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,3 +410,20 @@
410410
color: var(--color-text-tertiary);
411411
opacity: 0.5;
412412
}
413+
414+
.provider-transform-icon {
415+
display: inline-flex;
416+
align-items: center;
417+
justify-content: center;
418+
margin-left: 6px;
419+
font-size: 14px;
420+
line-height: 1;
421+
opacity: 0.6;
422+
flex-shrink: 0;
423+
cursor: help;
424+
transition: opacity 0.2s ease;
425+
}
426+
427+
.provider-transform-icon:hover {
428+
opacity: 1;
429+
}

0 commit comments

Comments
 (0)