mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-06-16 21:03:58 +08:00
feat(dashboard): show routing strategy badge in current config
This commit is contained in:
@@ -131,6 +131,7 @@
|
||||
"no_usage_data": "No usage data available",
|
||||
"view_detailed_usage": "View Detailed Stats",
|
||||
"edit_settings": "Edit Settings",
|
||||
"routing_strategy": "Routing Strategy",
|
||||
"available_models": "Available Models",
|
||||
"available_models_desc": "Total models from all providers"
|
||||
},
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
"no_usage_data": "Данные об использовании отсутствуют",
|
||||
"view_detailed_usage": "Просмотреть детальную статистику",
|
||||
"edit_settings": "Изменить настройки",
|
||||
"routing_strategy": "Стратегия маршрутизации",
|
||||
"available_models": "Доступные модели",
|
||||
"available_models_desc": "Всего моделей от всех провайдеров"
|
||||
},
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
"no_usage_data": "暂无使用数据",
|
||||
"view_detailed_usage": "查看详细统计",
|
||||
"edit_settings": "编辑设置",
|
||||
"routing_strategy": "路由策略",
|
||||
"available_models": "可用模型",
|
||||
"available_models_desc": "所有提供商的模型总数"
|
||||
},
|
||||
|
||||
@@ -261,6 +261,39 @@
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.configBadge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 4px 10px;
|
||||
border-radius: $radius-full;
|
||||
border: 1px solid var(--border-color);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.configBadgeRoundRobin {
|
||||
color: var(--primary-color);
|
||||
border-color: rgba($primary-color, 0.24);
|
||||
background: rgba($primary-color, 0.12);
|
||||
}
|
||||
|
||||
.configBadgeFillFirst {
|
||||
color: $success-color;
|
||||
border-color: rgba($success-color, 0.3);
|
||||
background: rgba($success-color, 0.12);
|
||||
}
|
||||
|
||||
.configBadgeUnknown {
|
||||
color: var(--text-secondary);
|
||||
background: var(--bg-primary);
|
||||
}
|
||||
|
||||
.configItemFull {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
@@ -221,6 +221,22 @@ export function DashboardPage() {
|
||||
}
|
||||
];
|
||||
|
||||
const routingStrategyRaw = config?.routingStrategy?.trim() || '';
|
||||
const routingStrategyDisplay = !routingStrategyRaw
|
||||
? '-'
|
||||
: routingStrategyRaw === 'round-robin'
|
||||
? t('basic_settings.routing_strategy_round_robin')
|
||||
: routingStrategyRaw === 'fill-first'
|
||||
? t('basic_settings.routing_strategy_fill_first')
|
||||
: routingStrategyRaw;
|
||||
const routingStrategyBadgeClass = !routingStrategyRaw
|
||||
? styles.configBadgeUnknown
|
||||
: routingStrategyRaw === 'round-robin'
|
||||
? styles.configBadgeRoundRobin
|
||||
: routingStrategyRaw === 'fill-first'
|
||||
? styles.configBadgeFillFirst
|
||||
: styles.configBadgeUnknown;
|
||||
|
||||
return (
|
||||
<div className={styles.dashboard}>
|
||||
<div className={styles.header}>
|
||||
@@ -311,6 +327,12 @@ export function DashboardPage() {
|
||||
{config.wsAuth ? t('common.yes') : t('common.no')}
|
||||
</span>
|
||||
</div>
|
||||
<div className={styles.configItem}>
|
||||
<span className={styles.configLabel}>{t('dashboard.routing_strategy')}</span>
|
||||
<span className={`${styles.configBadge} ${routingStrategyBadgeClass}`}>
|
||||
{routingStrategyDisplay}
|
||||
</span>
|
||||
</div>
|
||||
{config.proxyUrl && (
|
||||
<div className={`${styles.configItem} ${styles.configItemFull}`}>
|
||||
<span className={styles.configLabel}>{t('basic_settings.proxy_url_label')}</span>
|
||||
|
||||
Reference in New Issue
Block a user