Skip to content

Commit 25379f5

Browse files
ochanismlyingbug
authored andcommitted
fix(frontend): use storage_provider_config instead of legacy storage_config
The backend introduced storage_provider_config as the authoritative field in commit dbab7b0, but the frontend was never updated to use it. This caused the UI to always display "local" regardless of the actual storage provider, and saving KB settings could overwrite the correct storage_provider_config with an incorrect value. Changes: - KnowledgeBaseEditorModal.vue: read from storage_provider_config with storage_config fallback, dual-write both fields on save - KnowledgeBaseList.vue: update feature badge logic and add type def for storage_provider_config, exclude "local" from badge display - api/knowledge-base/index.ts: add storage_provider_config to API type - ko-KR.ts, ru-RU.ts: add missing i18n keys — multimodal section (sidebar.multimodal, multimodal.title/description), channel labels (channelLabel, channelWeb, channelApi, etc.), and agent.think
1 parent 258a786 commit 25379f5

File tree

5 files changed

+46
-6
lines changed

5 files changed

+46
-6
lines changed

frontend/src/api/knowledge-base/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export function createKnowledgeBase(data: {
1919
enabled: boolean;
2020
model_id?: string;
2121
};
22-
storage_config?: any;
22+
storage_provider_config?: { provider: string };
23+
storage_config?: any; // legacy, kept for backward compat (dual-write)
2324
extract_config?: any;
2425
faq_config?: { index_mode: string; question_index_mode?: string };
2526
}) {

frontend/src/i18n/locales/ko-KR.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ export default {
129129
typeURL: "웹페이지",
130130
typeManual: "수동 생성",
131131
typeFile: "파일",
132+
channelLabel: "출처 채널",
133+
channelWeb: "웹",
134+
channelApi: "API",
135+
channelBrowserExtension: "브라우저 확장",
136+
channelWechat: "WeChat",
137+
channelWecom: "WeCom",
138+
channelFeishu: "Feishu",
139+
channelDingtalk: "DingTalk",
140+
channelSlack: "Slack",
141+
channelIm: "IM 채널",
142+
channelUnknown: "알 수 없음",
132143
urlSource: "원본 URL",
133144
documentTitle: "문서 제목",
134145
webContent: "웹페이지 내용",
@@ -1016,6 +1027,7 @@ export default {
10161027
},
10171028
agent: {
10181029
taskLabel: "작업:",
1030+
think: "사고",
10191031
copy: "복사",
10201032
addToKnowledgeBase: "지식베이스에 추가",
10211033
updatePlan: "계획 업데이트",
@@ -1941,6 +1953,7 @@ export default {
19411953
advanced: "고급 설정",
19421954
faq: "FAQ 설정",
19431955
graph: "지식 그래프",
1956+
multimodal: "멀티모달",
19441957
share: "공유관리",
19451958
storage: "스토리지 엔진",
19461959
datasource: "데이터 소스",
@@ -2154,6 +2167,10 @@ export default {
21542167
childChunkSizeLabel: "자식 청크 크기",
21552168
childChunkSizeDescription: "임베딩 매칭에 사용되는 자식 청크의 문자 수 (64-1024)",
21562169
},
2170+
multimodal: {
2171+
title: "멀티모달 설정",
2172+
description: "멀티모달 콘텐츠 이해 기능을 설정합니다. 활성화하면 이미지 등 텍스트가 아닌 콘텐츠의 파싱 및 검색을 지원합니다.",
2173+
},
21572174
advanced: {
21582175
title: "고급 설정",
21592176
description: "질문 생성, 멀티모달 등 고급 기능 설정",

frontend/src/i18n/locales/ru-RU.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ export default {
110110
typeURL: 'URL',
111111
typeManual: 'Вручную',
112112
typeFile: 'Файл',
113+
channelLabel: 'Канал источника',
114+
channelWeb: 'Веб',
115+
channelApi: 'API',
116+
channelBrowserExtension: 'Расширение браузера',
117+
channelWechat: 'WeChat',
118+
channelWecom: 'WeCom',
119+
channelFeishu: 'Feishu',
120+
channelDingtalk: 'DingTalk',
121+
channelSlack: 'Slack',
122+
channelIm: 'IM канал',
123+
channelUnknown: 'Неизвестно',
113124
urlSource: 'Исходный URL',
114125
documentTitle: 'Название документа',
115126
webContent: 'Веб-содержимое',
@@ -272,6 +283,7 @@ export default {
272283
},
273284
agent: {
274285
taskLabel: 'Задача:',
286+
think: 'Размышление',
275287
copy: 'Копировать',
276288
addToKnowledgeBase: 'Добавить в базу знаний',
277289
updatePlan: 'Обновить план',
@@ -1627,6 +1639,7 @@ export default {
16271639
advanced: 'Дополнительные настройки',
16281640
faq: 'FAQ настройки',
16291641
graph: 'Граф знаний',
1642+
multimodal: 'Мультимодальность',
16301643
storage: 'Storage Engine',
16311644
datasource: 'Источники данных',
16321645
share: 'Sharing'
@@ -1820,6 +1833,10 @@ export default {
18201833
childChunkSizeLabel: 'Размер дочернего блока',
18211834
childChunkSizeDescription: 'Размер дочерних блоков для поиска по эмбеддингам (64-1024)'
18221835
},
1836+
multimodal: {
1837+
title: 'Мультимодальная конфигурация',
1838+
description: 'Настройка понимания мультимодального контента для парсинга и поиска нетекстового содержимого, такого как изображения',
1839+
},
18231840
advanced: {
18241841
title: 'Расширенные настройки',
18251842
description: 'Настройте генерацию вопросов и мультимодальные возможности',

frontend/src/views/knowledge/KnowledgeBaseEditorModal.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ const loadKBData = async () => {
438438
parentChunkSize: kb.chunking_config?.parent_chunk_size || 4096,
439439
childChunkSize: kb.chunking_config?.child_chunk_size || 384
440440
},
441-
storageProvider: (kb.storage_config?.provider || 'local') as string,
441+
storageProvider: (kb.storage_provider_config?.provider || kb.storage_config?.provider || 'local') as string,
442442
multimodalConfig: {
443443
enabled: !!kb.vlm_config?.enabled,
444444
vllmModelId: kb.vlm_config?.model_id || ''
@@ -594,6 +594,10 @@ const buildSubmitData = () => {
594594
}
595595
596596
// 存储引擎:仅传 provider,参数从全局设置读取
597+
// Write to storage_provider_config (authoritative) + storage_config (legacy dual-write)
598+
data.storage_provider_config = {
599+
provider: formData.value.storageProvider || 'local'
600+
}
597601
data.storage_config = {
598602
provider: formData.value.storageProvider || 'local'
599603
}
@@ -713,7 +717,7 @@ const doSubmit = async () => {
713717
multimodal: {
714718
enabled: !!data.vlm_config?.enabled
715719
},
716-
storageProvider: data.storage_config?.provider || 'local',
720+
storageProvider: data.storage_provider_config?.provider || data.storage_config?.provider || 'local',
717721
nodeExtract: {
718722
enabled: data.extract_config?.enabled || false,
719723
text: data.extract_config?.text || '',

frontend/src/views/knowledge/KnowledgeBaseList.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
<t-icon name="relation" size="14px" />
220220
</div>
221221
</t-tooltip>
222-
<t-tooltip v-if="kb.vlm_config?.enabled || (kb.storage_config?.provider && kb.storage_config?.bucket_name)" :content="$t('knowledgeList.features.multimodal')" placement="top">
222+
<t-tooltip v-if="kb.vlm_config?.enabled || (kb.storage_provider_config?.provider && kb.storage_provider_config.provider !== 'local')" :content="$t('knowledgeList.features.multimodal')" placement="top">
223223
<div class="feature-badge multimodal">
224224
<t-icon name="image" size="14px" />
225225
</div>
@@ -324,7 +324,7 @@
324324
<t-icon name="relation" size="14px" />
325325
</div>
326326
</t-tooltip>
327-
<t-tooltip v-if="kb.vlm_config?.enabled || (kb.storage_config?.provider && kb.storage_config?.bucket_name)" :content="$t('knowledgeList.features.multimodal')" placement="top">
327+
<t-tooltip v-if="kb.vlm_config?.enabled || (kb.storage_provider_config?.provider && kb.storage_provider_config.provider !== 'local')" :content="$t('knowledgeList.features.multimodal')" placement="top">
328328
<div class="feature-badge multimodal">
329329
<t-icon name="image" size="14px" />
330330
</div>
@@ -632,7 +632,8 @@ interface KB {
632632
showMore?: boolean;
633633
vlm_config?: { enabled?: boolean; model_id?: string };
634634
extract_config?: { enabled?: boolean };
635-
storage_config?: { provider?: string; bucket_name?: string };
635+
storage_provider_config?: { provider?: string };
636+
storage_config?: { provider?: string; bucket_name?: string }; // legacy
636637
question_generation_config?: { enabled?: boolean; question_count?: number };
637638
knowledge_count?: number;
638639
chunk_count?: number;

0 commit comments

Comments
 (0)