feat(i18n): update localization files for new UI elements and actions

- Added translations for "Refresh logs" in English, Korean, Russian, and Chinese.
- Enhanced the knowledge base editor modal to include a badge for data source count.
- Improved data source settings UI with a confirmation dialog for deletion and a refresh button in sync logs.
- Updated the data source sync logs component to fetch logs on visibility change and added a refresh option in the header.
This commit is contained in:
wizardchen
2026-03-30 13:32:39 +08:00
committed by lyingbug
parent 11cabd5952
commit d5ec5dc0ea
8 changed files with 245 additions and 158 deletions
@@ -25,6 +25,7 @@
>
<t-icon :name="item.icon" class="nav-icon" />
<span class="nav-label">{{ item.label }}</span>
<span v-if="item.badge" class="nav-badge">{{ item.badge }}</span>
</div>
</div>
</div>
@@ -214,7 +215,7 @@
<!-- 数据源管理(仅编辑模式) -->
<div v-if="mode === 'edit' && kbId" v-show="currentSection === 'datasource'" class="section">
<DataSourceSettings :kb-id="kbId" />
<DataSourceSettings :kb-id="kbId" @count="dsCount = $event" />
</div>
<!-- 共享设置(仅编辑模式) -->
@@ -281,9 +282,10 @@ const loading = ref(false)
const allModels = ref<any[]>([])
const hasFiles = ref(false)
const initialStorageProvider = ref<string>('')
const dsCount = ref(0)
const navItems = computed(() => {
const items = [
const items: { key: string; icon: string; label: string; badge?: number }[] = [
{ key: 'basic', icon: 'info-circle', label: t('knowledgeEditor.sidebar.basic') },
{ key: 'models', icon: 'control-platform', label: t('knowledgeEditor.sidebar.models') }
]
@@ -298,12 +300,10 @@ const navItems = computed(() => {
{ key: 'multimodal', icon: 'image', label: t('knowledgeEditor.sidebar.multimodal') },
{ key: 'advanced', icon: 'setting', label: t('knowledgeEditor.sidebar.advanced') }
)
// 数据源管理:仅文档类型知识库 + 编辑模式
if (props.mode === 'edit' && props.kbId) {
items.push({ key: 'datasource', icon: 'cloud-download', label: t('knowledgeEditor.sidebar.datasource') })
items.push({ key: 'datasource', icon: 'cloud-download', label: t('knowledgeEditor.sidebar.datasource'), badge: dsCount.value || undefined })
}
}
// 共享设置:编辑模式下所有类型都可用
if (props.mode === 'edit' && props.kbId) {
items.push({ key: 'share', icon: 'share', label: t('knowledgeEditor.sidebar.share') })
}
@@ -925,6 +925,27 @@ watch(
flex: 1;
}
.nav-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 18px;
height: 18px;
padding: 0 5px;
border-radius: 9px;
font-size: 11px;
font-weight: 600;
background: var(--td-bg-color-component);
color: var(--td-text-color-secondary);
line-height: 1;
flex-shrink: 0;
}
.nav-item.active .nav-badge {
background: var(--td-brand-color);
color: #fff;
}
.settings-content {
flex: 1;
display: flex;