mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-06-16 21:03:58 +08:00
fix(openai): address provider UI review feedback
This commit is contained in:
@@ -325,7 +325,7 @@ export function OpenAISection({
|
||||
onClick={toggleSortDirection}
|
||||
className={styles.sortDirectionButton}
|
||||
disabled={actionsDisabled}
|
||||
title={sortDirection === 'asc' ? t('common.sort_ascending') : t('common.sort_descending')}
|
||||
title={sortDirection === 'asc' ? t('ai_providers.sort_ascending') : t('ai_providers.sort_descending')}
|
||||
>
|
||||
{sortDirection === 'asc' ? '↑' : '↓'}
|
||||
</button>
|
||||
@@ -356,7 +356,7 @@ export function OpenAISection({
|
||||
) : (
|
||||
<>
|
||||
{Array.from(selectedModels).map((name) => (
|
||||
<span key={`top-${name}`} className={styles.modelTag}>
|
||||
<span key={`top-${name}`} className={styles.modelFilterTag}>
|
||||
<span className={styles.modelTagName}>{name}</span>
|
||||
<span
|
||||
role="button"
|
||||
@@ -416,6 +416,17 @@ export function OpenAISection({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{selectedModels.size > 0 && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={clearAllModels}
|
||||
disabled={actionsDisabled}
|
||||
className={styles.modelFilterClearButton}
|
||||
>
|
||||
{t('ai_providers.model_search_clear')}
|
||||
</Button>
|
||||
)}
|
||||
{renderSortControls()}
|
||||
<Button size="sm" onClick={onAdd} disabled={actionsDisabled}>
|
||||
{t('ai_providers.openai_add_button')}
|
||||
@@ -567,6 +578,16 @@ export function OpenAISection({
|
||||
>
|
||||
{loading && sortedConfigs.length === 0 ? (
|
||||
<div className="hint">{t('common.loading')}</div>
|
||||
) : configs.length > 0 && sortedConfigs.length === 0 ? (
|
||||
<EmptyState
|
||||
title={t('ai_providers.openai_filtered_empty_title')}
|
||||
description={t('ai_providers.openai_filtered_empty_desc')}
|
||||
action={(
|
||||
<Button variant="secondary" size="sm" onClick={clearAllModels} disabled={actionsDisabled}>
|
||||
{t('ai_providers.model_search_clear')}
|
||||
</Button>
|
||||
)}
|
||||
/>
|
||||
) : sortedConfigs.length === 0 ? (
|
||||
<EmptyState
|
||||
title={t('ai_providers.openai_empty_title')}
|
||||
|
||||
@@ -402,25 +402,11 @@
|
||||
"openai_add_button": "Add Provider",
|
||||
"openai_empty_title": "No OpenAI Compatible Providers",
|
||||
"openai_empty_desc": "Click the button above to add the first provider",
|
||||
"openai_filtered_empty_title": "No matching providers",
|
||||
"openai_filtered_empty_desc": "No providers match the current model filter. Clear the filter and try again.",
|
||||
"sort_by_name": "Sort by Name",
|
||||
"sort_by_priority": "Sort by Priority",
|
||||
"sort_by_recent_success": "Sort by Recent Success",
|
||||
"sort_ascending": "Ascending",
|
||||
"sort_descending": "Descending",
|
||||
"model_search.title": "Model Search",
|
||||
"model_search.search_card_title": "Search All Models",
|
||||
"model_search.refresh": "Refresh",
|
||||
"model_search.search_label": "Search Models",
|
||||
"model_search.search_placeholder": "Filter by name, alias, description, or provider",
|
||||
"model_search.select_all": "Select All",
|
||||
"model_search.clear_selection": "Clear",
|
||||
"model_search.selected_count": "{{count}} selected",
|
||||
"model_search.loading": "Fetching models from all providers...",
|
||||
"model_search.empty_title": "No Models Found",
|
||||
"model_search.empty_desc": "No models could be fetched from the configured providers",
|
||||
"model_search.no_results": "No models match your search. Try a different keyword.",
|
||||
"model_search.fetch_failed": "Failed to fetch models",
|
||||
"model_search.models_count": "{{count}} models",
|
||||
"openai_add_modal_title": "Add OpenAI Compatible Provider",
|
||||
"openai_add_modal_name_label": "Provider Name:",
|
||||
"openai_add_modal_name_placeholder": "e.g.: openrouter",
|
||||
@@ -477,8 +463,7 @@
|
||||
"openai_test_all_partial": "Test completed: {{success}} passed, {{failed}} failed",
|
||||
"model_search_placeholder": "Filter by models...",
|
||||
"model_search_clear": "Clear",
|
||||
"model_select_all": "Select All",
|
||||
"model_selected_count": "{{count}} selected"
|
||||
"model_select_all": "Select All"
|
||||
},
|
||||
"auth_files": {
|
||||
"title": "Auth Files Management",
|
||||
|
||||
@@ -402,11 +402,11 @@
|
||||
"openai_add_button": "Добавить провайдера",
|
||||
"openai_empty_title": "Провайдеры OpenAI отсутствуют",
|
||||
"openai_empty_desc": "Нажмите кнопку выше, чтобы добавить первого провайдера",
|
||||
"openai_filtered_empty_title": "Нет подходящих провайдеров",
|
||||
"openai_filtered_empty_desc": "Ни один провайдер не соответствует текущему фильтру моделей. Очистите фильтр и попробуйте снова.",
|
||||
"sort_by_name": "Сортировать по имени",
|
||||
"sort_by_priority": "Сортировать по приоритету",
|
||||
"sort_by_recent_success": "Сортировать по недавним успехам",
|
||||
"sort_ascending": "По возрастанию",
|
||||
"sort_descending": "По убыванию",
|
||||
"openai_add_modal_title": "Добавление совместимого с OpenAI провайдера",
|
||||
"openai_add_modal_name_label": "Имя провайдера:",
|
||||
"openai_add_modal_name_placeholder": "например: openrouter",
|
||||
@@ -463,8 +463,7 @@
|
||||
"openai_test_all_partial": "Тест завершен: {{success}} прошло, {{failed}} не прошло",
|
||||
"model_search_placeholder": "Фильтр по моделям...",
|
||||
"model_search_clear": "Очистить",
|
||||
"model_select_all": "Выбрать все",
|
||||
"model_selected_count": "Выбрано: {{count}}"
|
||||
"model_select_all": "Выбрать все"
|
||||
},
|
||||
"auth_files": {
|
||||
"title": "Управление файлами авторизации",
|
||||
|
||||
@@ -402,25 +402,11 @@
|
||||
"openai_add_button": "添加提供商",
|
||||
"openai_empty_title": "暂无OpenAI兼容提供商",
|
||||
"openai_empty_desc": "点击上方按钮添加第一个提供商",
|
||||
"openai_filtered_empty_title": "没有匹配的提供商",
|
||||
"openai_filtered_empty_desc": "当前模型筛选下没有匹配的提供商,请清除筛选后重试。",
|
||||
"sort_by_name": "按名称排序",
|
||||
"sort_by_priority": "按优先级排序",
|
||||
"sort_by_recent_success": "按最近成功数排序",
|
||||
"sort_ascending": "正序",
|
||||
"sort_descending": "倒序",
|
||||
"model_search.title": "模型搜索",
|
||||
"model_search.search_card_title": "搜索所有模型",
|
||||
"model_search.refresh": "刷新",
|
||||
"model_search.search_label": "搜索模型",
|
||||
"model_search.search_placeholder": "按名称、别名、描述或提供商筛选",
|
||||
"model_search.select_all": "全选",
|
||||
"model_search.clear_selection": "清除",
|
||||
"model_search.selected_count": "已选择 {{count}} 个",
|
||||
"model_search.loading": "正在从所有提供商获取模型...",
|
||||
"model_search.empty_title": "未找到模型",
|
||||
"model_search.empty_desc": "无法从配置的提供商获取模型",
|
||||
"model_search.no_results": "没有匹配的模型,请尝试其他关键词。",
|
||||
"model_search.fetch_failed": "获取模型失败",
|
||||
"model_search.models_count": "{{count}} 个模型",
|
||||
"openai_add_modal_title": "添加OpenAI兼容提供商",
|
||||
"openai_add_modal_name_label": "提供商名称:",
|
||||
"openai_add_modal_name_placeholder": "例如: openrouter",
|
||||
@@ -477,8 +463,7 @@
|
||||
"openai_test_all_partial": "测试完成:{{success}} 个通过,{{failed}} 个失败",
|
||||
"model_search_placeholder": "按模型筛选...",
|
||||
"model_search_clear": "清除",
|
||||
"model_select_all": "全选",
|
||||
"model_selected_count": "已选择 {{count}} 个"
|
||||
"model_select_all": "全选"
|
||||
},
|
||||
"auth_files": {
|
||||
"title": "认证文件管理",
|
||||
|
||||
@@ -226,14 +226,14 @@
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.modelTag {
|
||||
.modelFilterTag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 3px;
|
||||
padding: 4px 8px 4px 8px;
|
||||
background: var(--primary-color);
|
||||
color: white;
|
||||
background: var(--primary-color-alpha, rgba(59, 130, 246, 0.15));
|
||||
color: var(--primary-color);
|
||||
border-radius: 4px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
@@ -320,6 +320,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
.modelFilterClearButton:global(.btn.btn-secondary) {
|
||||
background: var(--primary-color-alpha, rgba(59, 130, 246, 0.15));
|
||||
border-color: rgba(59, 130, 246, 0.24);
|
||||
color: var(--primary-color);
|
||||
|
||||
&:hover {
|
||||
background: rgba(59, 130, 246, 0.22);
|
||||
border-color: rgba(59, 130, 246, 0.32);
|
||||
color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.modelDropdownItem {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user