2025-11-06 13:12:26 +00:00
|
|
|
|
<template>
|
|
|
|
|
|
<Teleport to="body">
|
|
|
|
|
|
<Transition name="modal">
|
|
|
|
|
|
<div v-if="visible" class="settings-overlay" @click.self="handleClose">
|
|
|
|
|
|
<div class="settings-modal">
|
|
|
|
|
|
<!-- 关闭按钮 -->
|
2025-11-13 11:34:33 +00:00
|
|
|
|
<button class="close-btn" @click="handleClose" :aria-label="$t('general.close')">
|
2025-11-06 13:12:26 +00:00
|
|
|
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
|
|
|
|
<path d="M15 5L5 15M5 5L15 15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
|
|
|
|
</svg>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="settings-container">
|
|
|
|
|
|
<!-- 左侧导航 -->
|
|
|
|
|
|
<div class="settings-sidebar">
|
|
|
|
|
|
<div class="sidebar-header">
|
2025-11-13 11:34:33 +00:00
|
|
|
|
<h2 class="sidebar-title">{{ mode === 'create' ? $t('knowledgeEditor.titleCreate') : $t('knowledgeEditor.titleEdit') }}</h2>
|
2025-11-06 13:12:26 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="settings-nav">
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-for="(item, index) in navItems"
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
:class="['nav-item', { 'active': currentSection === item.key }]"
|
|
|
|
|
|
@click="currentSection = item.key"
|
|
|
|
|
|
>
|
2025-11-06 15:13:13 +00:00
|
|
|
|
<t-icon :name="item.icon" class="nav-icon" />
|
2025-11-06 13:12:26 +00:00
|
|
|
|
<span class="nav-label">{{ item.label }}</span>
|
2026-03-30 05:32:39 +00:00
|
|
|
|
<span v-if="item.badge" class="nav-badge">{{ item.badge }}</span>
|
2025-11-06 13:12:26 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 右侧内容区域 -->
|
|
|
|
|
|
<div class="settings-content">
|
|
|
|
|
|
<div class="content-wrapper">
|
|
|
|
|
|
<!-- 基本信息 -->
|
|
|
|
|
|
<div v-show="currentSection === 'basic'" class="section">
|
|
|
|
|
|
<div v-if="formData" class="section-content">
|
|
|
|
|
|
<div class="section-header">
|
2025-11-13 11:34:33 +00:00
|
|
|
|
<h3 class="section-title">{{ $t('knowledgeEditor.basic.title') }}</h3>
|
|
|
|
|
|
<p class="section-desc">{{ $t('knowledgeEditor.basic.description') }}</p>
|
2025-11-06 13:12:26 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="section-body">
|
2025-11-14 17:30:17 +00:00
|
|
|
|
<div class="form-item">
|
|
|
|
|
|
<label class="form-label required">{{ $t('knowledgeEditor.basic.typeLabel') }}</label>
|
|
|
|
|
|
<t-radio-group
|
|
|
|
|
|
v-model="formData.type"
|
|
|
|
|
|
:disabled="mode === 'edit'"
|
|
|
|
|
|
>
|
|
|
|
|
|
<t-radio-button value="document">{{ $t('knowledgeEditor.basic.typeDocument') }}</t-radio-button>
|
|
|
|
|
|
<t-radio-button value="faq">{{ $t('knowledgeEditor.basic.typeFAQ') }}</t-radio-button>
|
|
|
|
|
|
</t-radio-group>
|
|
|
|
|
|
<p class="form-tip">{{ $t('knowledgeEditor.basic.typeDescription') }}</p>
|
|
|
|
|
|
</div>
|
2026-04-20 11:16:46 +00:00
|
|
|
|
|
|
|
|
|
|
<!-- 索引策略 (紧跟类型选择) -->
|
|
|
|
|
|
<div v-if="!isFAQ" class="form-item">
|
2026-04-20 13:54:54 +00:00
|
|
|
|
<label class="form-label required">{{ $t('knowledgeEditor.indexing.title') }}</label>
|
|
|
|
|
|
<p class="form-tip">{{ $t('knowledgeEditor.indexing.description') }}</p>
|
2026-04-21 06:46:41 +00:00
|
|
|
|
<div class="indexing-checks" :class="{ 'is-locked': isIndexingLocked }">
|
2026-04-20 13:54:54 +00:00
|
|
|
|
<div
|
|
|
|
|
|
class="indexing-check-item"
|
2026-04-21 06:46:41 +00:00
|
|
|
|
:class="{ 'is-checked': formData.indexingStrategy.vectorEnabled, 'is-disabled': isIndexingLocked }"
|
2026-04-20 13:54:54 +00:00
|
|
|
|
@click="toggleVectorIndexing"
|
|
|
|
|
|
>
|
|
|
|
|
|
<t-checkbox
|
|
|
|
|
|
:checked="formData.indexingStrategy.vectorEnabled"
|
2026-04-21 06:46:41 +00:00
|
|
|
|
:disabled="isIndexingLocked"
|
2026-04-20 13:54:54 +00:00
|
|
|
|
class="indexing-check-box"
|
|
|
|
|
|
>{{ $t('knowledgeEditor.indexing.searchTitle') }}</t-checkbox>
|
|
|
|
|
|
<p class="indexing-check-desc">{{ $t('knowledgeEditor.indexing.searchDesc') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="indexing-check-item"
|
2026-04-21 06:46:41 +00:00
|
|
|
|
:class="{ 'is-checked': formData.indexingStrategy.wikiEnabled, 'is-disabled': isIndexingLocked }"
|
|
|
|
|
|
@click="toggleWikiIndexing"
|
2026-04-20 13:54:54 +00:00
|
|
|
|
>
|
|
|
|
|
|
<t-checkbox
|
|
|
|
|
|
:checked="formData.indexingStrategy.wikiEnabled"
|
2026-04-21 06:46:41 +00:00
|
|
|
|
:disabled="isIndexingLocked"
|
2026-04-20 13:54:54 +00:00
|
|
|
|
class="indexing-check-box"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span class="indexing-check-title">
|
|
|
|
|
|
{{ $t('knowledgeEditor.indexing.wikiTitle') }}
|
|
|
|
|
|
<span class="indexing-new-badge">NEW</span>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</t-checkbox>
|
|
|
|
|
|
<p class="indexing-check-desc">{{ $t('knowledgeEditor.indexing.wikiDesc') }}</p>
|
|
|
|
|
|
</div>
|
2026-04-20 11:16:46 +00:00
|
|
|
|
</div>
|
2026-04-21 06:46:41 +00:00
|
|
|
|
<p v-if="isIndexingLocked" class="form-tip locked-tip">
|
|
|
|
|
|
{{ $t('knowledgeEditor.indexing.lockedTip') }}
|
|
|
|
|
|
</p>
|
2026-04-20 11:16:46 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-04-22 12:27:19 +00:00
|
|
|
|
<!-- Wiki 提取粒度 (仅当 Wiki 启用时显示) -->
|
|
|
|
|
|
<div v-if="!isFAQ && formData.indexingStrategy.wikiEnabled" class="form-item">
|
|
|
|
|
|
<label class="form-label">{{ $t('knowledgeEditor.wiki.extractionGranularityLabel') }}</label>
|
|
|
|
|
|
<p class="form-tip">{{ $t('knowledgeEditor.wiki.extractionGranularityTip') }}</p>
|
|
|
|
|
|
<t-radio-group
|
|
|
|
|
|
:value="resolvedGranularity"
|
|
|
|
|
|
class="granularity-radio-group"
|
|
|
|
|
|
@change="handleGranularityChange"
|
|
|
|
|
|
>
|
|
|
|
|
|
<t-radio-button value="focused">
|
|
|
|
|
|
{{ $t('knowledgeEditor.wiki.granularityFocused') }}
|
|
|
|
|
|
</t-radio-button>
|
|
|
|
|
|
<t-radio-button value="standard">
|
|
|
|
|
|
{{ $t('knowledgeEditor.wiki.granularityStandard') }}
|
|
|
|
|
|
</t-radio-button>
|
|
|
|
|
|
<t-radio-button value="exhaustive">
|
|
|
|
|
|
{{ $t('knowledgeEditor.wiki.granularityExhaustive') }}
|
|
|
|
|
|
</t-radio-button>
|
|
|
|
|
|
</t-radio-group>
|
|
|
|
|
|
<p class="form-tip granularity-hint">{{ granularityHint }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
<div class="form-item">
|
2025-11-13 11:34:33 +00:00
|
|
|
|
<label class="form-label required">{{ $t('knowledgeEditor.basic.nameLabel') }}</label>
|
2025-11-06 13:12:26 +00:00
|
|
|
|
<t-input
|
|
|
|
|
|
v-model="formData.name"
|
2025-11-13 11:34:33 +00:00
|
|
|
|
:placeholder="$t('knowledgeEditor.basic.namePlaceholder')"
|
2025-11-06 13:12:26 +00:00
|
|
|
|
:maxlength="50"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-item">
|
2025-11-13 11:34:33 +00:00
|
|
|
|
<label class="form-label">{{ $t('knowledgeEditor.basic.descriptionLabel') }}</label>
|
2026-04-20 11:16:46 +00:00
|
|
|
|
<t-textarea
|
|
|
|
|
|
v-model="formData.description"
|
2025-11-13 11:34:33 +00:00
|
|
|
|
:placeholder="$t('knowledgeEditor.basic.descriptionPlaceholder')"
|
2025-11-06 13:12:26 +00:00
|
|
|
|
:maxlength="200"
|
|
|
|
|
|
:autosize="{ minRows: 3, maxRows: 6 }"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
2026-04-20 11:16:46 +00:00
|
|
|
|
|
|
|
|
|
|
<!-- Wiki 合成模型移至模型配置页 -->
|
2025-11-06 13:12:26 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 模型配置 -->
|
|
|
|
|
|
<div v-show="currentSection === 'models'" class="section">
|
|
|
|
|
|
<KBModelConfig
|
|
|
|
|
|
ref="modelConfigRef"
|
|
|
|
|
|
v-if="formData"
|
|
|
|
|
|
:config="formData.modelConfig"
|
|
|
|
|
|
:has-files="hasFiles"
|
2026-04-20 11:16:46 +00:00
|
|
|
|
:wiki-enabled="formData.indexingStrategy?.wikiEnabled"
|
|
|
|
|
|
:rag-enabled="formData.indexingStrategy?.vectorEnabled || formData.indexingStrategy?.keywordEnabled"
|
2025-11-06 13:12:26 +00:00
|
|
|
|
:all-models="allModels"
|
|
|
|
|
|
@update:config="handleModelConfigUpdate"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-11-14 17:30:17 +00:00
|
|
|
|
<!-- FAQ 配置 -->
|
|
|
|
|
|
<div v-if="isFAQ && formData" v-show="currentSection === 'faq'" class="section">
|
|
|
|
|
|
<div class="section-content">
|
|
|
|
|
|
<div class="section-header">
|
|
|
|
|
|
<h3 class="section-title">{{ $t('knowledgeEditor.faq.title') }}</h3>
|
|
|
|
|
|
<p class="section-desc">{{ $t('knowledgeEditor.faq.description') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="section-body">
|
|
|
|
|
|
<div class="form-item">
|
|
|
|
|
|
<label class="form-label required">{{ $t('knowledgeEditor.faq.indexModeLabel') }}</label>
|
|
|
|
|
|
<t-radio-group
|
|
|
|
|
|
v-model="formData.faqConfig.indexMode"
|
|
|
|
|
|
>
|
|
|
|
|
|
<t-radio-button value="question_only">{{ $t('knowledgeEditor.faq.modes.questionOnly') }}</t-radio-button>
|
|
|
|
|
|
<t-radio-button value="question_answer">{{ $t('knowledgeEditor.faq.modes.questionAnswer') }}</t-radio-button>
|
|
|
|
|
|
</t-radio-group>
|
|
|
|
|
|
<p class="form-tip">{{ $t('knowledgeEditor.faq.indexModeDescription') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-item">
|
|
|
|
|
|
<label class="form-label required">{{ $t('knowledgeEditor.faq.questionIndexModeLabel') }}</label>
|
|
|
|
|
|
<t-radio-group
|
|
|
|
|
|
v-model="formData.faqConfig.questionIndexMode"
|
|
|
|
|
|
>
|
|
|
|
|
|
<t-radio-button value="combined">{{ $t('knowledgeEditor.faq.modes.combined') }}</t-radio-button>
|
|
|
|
|
|
<t-radio-button value="separate">{{ $t('knowledgeEditor.faq.modes.separate') }}</t-radio-button>
|
|
|
|
|
|
</t-radio-group>
|
|
|
|
|
|
<p class="form-tip">{{ $t('knowledgeEditor.faq.questionIndexModeDescription') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="faq-guide">
|
|
|
|
|
|
<p>{{ $t('knowledgeEditor.faq.entryGuide') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-28 05:22:07 +00:00
|
|
|
|
<!-- 解析引擎 -->
|
2026-04-07 11:36:06 +00:00
|
|
|
|
<div v-if="!isFAQ && formData" v-show="currentSection === 'parser'" class="section">
|
2026-02-28 05:22:07 +00:00
|
|
|
|
<KBParserSettings
|
|
|
|
|
|
:parser-engine-rules="formData.chunkingConfig.parserEngineRules"
|
|
|
|
|
|
@update:parser-engine-rules="handleParserEngineRulesUpdate"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 存储引擎 -->
|
2026-04-07 11:36:06 +00:00
|
|
|
|
<div v-if="!isFAQ && formData" v-show="currentSection === 'storage'" class="section">
|
2026-02-28 05:22:07 +00:00
|
|
|
|
<KBStorageSettings
|
|
|
|
|
|
:storage-provider="formData.storageProvider"
|
2026-02-28 09:39:59 +00:00
|
|
|
|
:has-files="mode === 'edit' && hasFiles"
|
2026-02-28 05:22:07 +00:00
|
|
|
|
@update:storage-provider="handleStorageProviderUpdate"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
<!-- 分块设置 -->
|
2026-04-07 11:36:06 +00:00
|
|
|
|
<div v-if="!isFAQ" v-show="currentSection === 'chunking'" class="section">
|
2025-11-06 13:12:26 +00:00
|
|
|
|
<KBChunkingSettings
|
|
|
|
|
|
v-if="formData"
|
|
|
|
|
|
:config="formData.chunkingConfig"
|
|
|
|
|
|
@update:config="handleChunkingConfigUpdate"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-03-11 13:16:23 +00:00
|
|
|
|
<!-- 多模态配置 -->
|
2026-04-07 11:36:06 +00:00
|
|
|
|
<div v-if="!isFAQ" v-show="currentSection === 'multimodal'" class="section">
|
2026-03-11 13:16:23 +00:00
|
|
|
|
<div v-if="formData" class="kb-multimodal-settings">
|
|
|
|
|
|
<div class="section-header">
|
|
|
|
|
|
<h2>{{ $t('knowledgeEditor.multimodal.title') }}</h2>
|
|
|
|
|
|
<p class="section-description">{{ $t('knowledgeEditor.multimodal.description') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="settings-group">
|
|
|
|
|
|
<!-- 多模态开关 -->
|
|
|
|
|
|
<div class="setting-row">
|
|
|
|
|
|
<div class="setting-info">
|
|
|
|
|
|
<label>{{ $t('knowledgeEditor.advanced.multimodal.label') }}</label>
|
|
|
|
|
|
<p class="desc">{{ $t('knowledgeEditor.advanced.multimodal.description') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="setting-control">
|
|
|
|
|
|
<t-switch
|
|
|
|
|
|
v-model="formData.multimodalConfig.enabled"
|
|
|
|
|
|
@change="handleMultimodalToggle"
|
|
|
|
|
|
size="medium"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- VLLM 模型选择(多模态启用时) -->
|
|
|
|
|
|
<div v-if="formData.multimodalConfig.enabled" class="setting-row">
|
|
|
|
|
|
<div class="setting-info">
|
|
|
|
|
|
<label>{{ $t('knowledgeEditor.advanced.multimodal.vllmLabel') }} <span class="required">*</span></label>
|
|
|
|
|
|
<p class="desc">{{ $t('knowledgeEditor.advanced.multimodal.vllmDescription') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="setting-control">
|
|
|
|
|
|
<ModelSelector
|
|
|
|
|
|
model-type="VLLM"
|
|
|
|
|
|
:selected-model-id="formData.multimodalConfig.vllmModelId"
|
|
|
|
|
|
:all-models="allModels"
|
|
|
|
|
|
@update:selected-model-id="handleMultimodalVLLMChange"
|
|
|
|
|
|
@add-model="handleAddVLLMModel"
|
|
|
|
|
|
:placeholder="$t('knowledgeEditor.advanced.multimodal.vllmPlaceholder')"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
<!-- 音频处理(ASR)设置 -->
|
2026-04-07 11:36:06 +00:00
|
|
|
|
<div v-if="!isFAQ" v-show="currentSection === 'asr'" class="section">
|
2026-04-02 08:43:37 +00:00
|
|
|
|
<div v-if="formData" class="kb-multimodal-settings">
|
|
|
|
|
|
<div class="section-header">
|
|
|
|
|
|
<h2>{{ $t('knowledgeEditor.asr.title') }}</h2>
|
|
|
|
|
|
<p class="section-description">{{ $t('knowledgeEditor.asr.description') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="settings-group">
|
|
|
|
|
|
<!-- ASR 开关 -->
|
|
|
|
|
|
<div class="setting-row">
|
|
|
|
|
|
<div class="setting-info">
|
|
|
|
|
|
<label>{{ $t('knowledgeEditor.asr.label') }}</label>
|
|
|
|
|
|
<p class="desc">{{ $t('knowledgeEditor.asr.desc') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="setting-control">
|
|
|
|
|
|
<t-switch
|
|
|
|
|
|
v-model="formData.asrConfig.enabled"
|
|
|
|
|
|
size="medium"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ASR 模型选择 -->
|
|
|
|
|
|
<div v-if="formData.asrConfig.enabled" class="setting-row">
|
|
|
|
|
|
<div class="setting-info">
|
|
|
|
|
|
<label>{{ $t('knowledgeEditor.asr.modelLabel') }} <span class="required">*</span></label>
|
|
|
|
|
|
<p class="desc">{{ $t('knowledgeEditor.asr.modelDescription') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="setting-control">
|
|
|
|
|
|
<ModelSelector
|
|
|
|
|
|
model-type="ASR"
|
|
|
|
|
|
:selected-model-id="formData.asrConfig.modelId"
|
|
|
|
|
|
:all-models="allModels"
|
|
|
|
|
|
@update:selected-model-id="(val: string) => { if (formData) formData.asrConfig.modelId = val }"
|
2026-04-03 04:14:33 +00:00
|
|
|
|
@add-model="handleAddASRModel"
|
2026-04-02 08:43:37 +00:00
|
|
|
|
:placeholder="$t('knowledgeEditor.asr.modelPlaceholder')"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-04-20 11:16:46 +00:00
|
|
|
|
<!-- 知识图谱 -->
|
|
|
|
|
|
<div v-if="!isFAQ" v-show="currentSection === 'graph'" class="section">
|
|
|
|
|
|
<GraphSettings
|
|
|
|
|
|
v-if="formData"
|
|
|
|
|
|
:graph-extract="formData.nodeExtractConfig"
|
|
|
|
|
|
:model-id="formData.modelConfig.llmModelId"
|
|
|
|
|
|
:all-models="allModels"
|
|
|
|
|
|
@update:graphExtract="handleNodeExtractUpdate"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
<!-- 高级设置 -->
|
2026-04-07 11:36:06 +00:00
|
|
|
|
<div v-if="!isFAQ" v-show="currentSection === 'advanced'" class="section">
|
2025-11-06 13:12:26 +00:00
|
|
|
|
<KBAdvancedSettings
|
|
|
|
|
|
ref="advancedSettingsRef"
|
|
|
|
|
|
v-if="formData"
|
2025-12-02 17:42:31 +00:00
|
|
|
|
:question-generation="formData.questionGenerationConfig"
|
2026-04-20 11:16:46 +00:00
|
|
|
|
:rag-enabled="formData.indexingStrategy?.vectorEnabled || formData.indexingStrategy?.keywordEnabled"
|
2025-11-06 13:12:26 +00:00
|
|
|
|
:all-models="allModels"
|
2025-12-02 17:42:31 +00:00
|
|
|
|
@update:question-generation="handleQuestionGenerationUpdate"
|
2025-11-06 13:12:26 +00:00
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
2026-01-30 08:28:01 +00:00
|
|
|
|
|
2026-03-27 07:02:40 +00:00
|
|
|
|
<!-- 数据源管理(仅编辑模式) -->
|
|
|
|
|
|
<div v-if="mode === 'edit' && kbId" v-show="currentSection === 'datasource'" class="section">
|
2026-03-30 05:32:39 +00:00
|
|
|
|
<DataSourceSettings :kb-id="kbId" @count="dsCount = $event" />
|
2026-03-27 07:02:40 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-01-30 08:28:01 +00:00
|
|
|
|
<!-- 共享设置(仅编辑模式) -->
|
|
|
|
|
|
<div v-if="mode === 'edit' && kbId" v-show="currentSection === 'share'" class="section">
|
2026-05-15 09:56:58 +00:00
|
|
|
|
<KBShareSettings :kb-id="kbId" :can-share="canShareKB" />
|
2026-01-30 08:28:01 +00:00
|
|
|
|
</div>
|
2025-11-06 13:12:26 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 保存按钮 -->
|
|
|
|
|
|
<div class="settings-footer">
|
|
|
|
|
|
<t-button theme="default" variant="outline" @click="handleClose">
|
2025-11-13 11:34:33 +00:00
|
|
|
|
{{ $t('common.cancel') }}
|
2025-11-06 13:12:26 +00:00
|
|
|
|
</t-button>
|
|
|
|
|
|
<t-button theme="primary" @click="handleSubmit" :loading="saving">
|
2025-11-13 11:34:33 +00:00
|
|
|
|
{{ mode === 'create' ? $t('knowledgeEditor.buttons.create') : $t('knowledgeEditor.buttons.save') }}
|
2025-11-06 13:12:26 +00:00
|
|
|
|
</t-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Transition>
|
|
|
|
|
|
</Teleport>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { ref, computed, watch } from 'vue'
|
2026-03-09 12:27:24 +00:00
|
|
|
|
import { MessagePlugin, DialogPlugin } from 'tdesign-vue-next'
|
2026-04-20 11:16:46 +00:00
|
|
|
|
import { createKnowledgeBase, getKnowledgeBaseById, listKnowledgeFiles, updateKnowledgeBase, rebuildKBIndex } from '@/api/knowledge-base'
|
2025-11-06 13:12:26 +00:00
|
|
|
|
import { updateKBConfig, type KBModelConfigRequest } from '@/api/initialization'
|
|
|
|
|
|
import { listModels } from '@/api/model'
|
2025-11-07 08:40:53 +00:00
|
|
|
|
import { useUIStore } from '@/stores/ui'
|
2026-04-11 06:05:56 +00:00
|
|
|
|
import { useAuthStore } from '@/stores/auth'
|
2025-11-06 13:12:26 +00:00
|
|
|
|
import KBModelConfig from './settings/KBModelConfig.vue'
|
2026-02-28 05:22:07 +00:00
|
|
|
|
import KBParserSettings from './settings/KBParserSettings.vue'
|
|
|
|
|
|
import KBStorageSettings from './settings/KBStorageSettings.vue'
|
2025-11-06 13:12:26 +00:00
|
|
|
|
import KBChunkingSettings from './settings/KBChunkingSettings.vue'
|
|
|
|
|
|
import KBAdvancedSettings from './settings/KBAdvancedSettings.vue'
|
2026-03-11 13:16:23 +00:00
|
|
|
|
import ModelSelector from '@/components/ModelSelector.vue'
|
2025-11-25 08:44:44 +00:00
|
|
|
|
import GraphSettings from './settings/GraphSettings.vue'
|
2026-01-30 08:28:01 +00:00
|
|
|
|
import KBShareSettings from './settings/KBShareSettings.vue'
|
2026-03-27 07:02:40 +00:00
|
|
|
|
import DataSourceSettings from './settings/DataSourceSettings.vue'
|
2025-11-13 11:34:33 +00:00
|
|
|
|
import { useI18n } from 'vue-i18n'
|
2025-11-06 13:12:26 +00:00
|
|
|
|
|
2025-11-07 08:40:53 +00:00
|
|
|
|
const uiStore = useUIStore()
|
2026-04-11 06:05:56 +00:00
|
|
|
|
const authStore = useAuthStore()
|
2025-11-13 11:34:33 +00:00
|
|
|
|
const { t } = useI18n()
|
2025-11-07 08:40:53 +00:00
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
// Props
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
|
|
visible: boolean
|
|
|
|
|
|
mode: 'create' | 'edit'
|
|
|
|
|
|
kbId?: string
|
2026-04-07 11:36:06 +00:00
|
|
|
|
initialType?: 'document' | 'faq'
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}>()
|
|
|
|
|
|
|
|
|
|
|
|
// Emits
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
|
|
(e: 'update:visible', value: boolean): void
|
|
|
|
|
|
(e: 'success', kbId: string): void
|
|
|
|
|
|
}>()
|
|
|
|
|
|
|
|
|
|
|
|
const currentSection = ref<string>('basic')
|
|
|
|
|
|
const saving = ref(false)
|
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
|
const allModels = ref<any[]>([])
|
|
|
|
|
|
const hasFiles = ref(false)
|
2026-03-09 12:27:24 +00:00
|
|
|
|
const initialStorageProvider = ref<string>('')
|
2026-04-20 11:16:46 +00:00
|
|
|
|
const initialIndexingStrategy = ref<any>(null)
|
2026-03-30 05:32:39 +00:00
|
|
|
|
const dsCount = ref(0)
|
2026-05-15 09:56:58 +00:00
|
|
|
|
// KB.creator_id (added in PR 5). Empty for legacy KBs — those fall back
|
|
|
|
|
|
// to "no owner", so only tenant Admin+ can mutate share settings.
|
|
|
|
|
|
const kbCreatorId = ref<string>('')
|
|
|
|
|
|
|
|
|
|
|
|
// Backend gate for /knowledge-bases/:id/shares (POST/PUT/DELETE) is
|
|
|
|
|
|
// g.OwnedKBOrAdmin(): only the KB creator or tenant Admin+ may mutate
|
|
|
|
|
|
// shares. Org-admins on a shared KB do NOT pass this guard, so they
|
|
|
|
|
|
// would only see 403s if we let them try. Mirror the matrix here so
|
|
|
|
|
|
// the buttons disappear instead of failing.
|
|
|
|
|
|
const canShareKB = computed(() => {
|
|
|
|
|
|
if (!props.kbId) return false
|
|
|
|
|
|
const userId = authStore.user?.id || ''
|
|
|
|
|
|
if (kbCreatorId.value && userId && kbCreatorId.value === userId) return true
|
|
|
|
|
|
return authStore.hasRole('admin')
|
|
|
|
|
|
})
|
2026-04-23 03:21:28 +00:00
|
|
|
|
// 用户是否在分块设置中手动改过任何值。一旦为 true,就不再根据索引策略自动调整默认分块参数。
|
|
|
|
|
|
const chunkingDirty = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
// 仅 Wiki 索引模式下的分块预设:更大 chunk、无 overlap、关闭父子分块。
|
|
|
|
|
|
// 该预设只在「创建模式」下、且用户尚未手动调整分块参数时生效,避免覆盖既有 KB 的配置。
|
|
|
|
|
|
const WIKI_ONLY_CHUNKING_PRESET = {
|
|
|
|
|
|
chunkSize: 2048,
|
|
|
|
|
|
chunkOverlap: 0,
|
|
|
|
|
|
enableParentChild: false,
|
|
|
|
|
|
} as const
|
|
|
|
|
|
|
docs(chunking): align overlap default + sharpen UI/source/repo docs
Three documentation passes around the adaptive chunking work:
UI
- Frontend ChunkOverlap default consolidated to 80 (was 100), matching
chunker.DefaultChunkOverlap on the backend. Both DEFAULT_CHUNKING_PRESET
and initFormData updated. The KB-load fallback also uses 80 when a
loaded KB has no chunk_overlap stored.
- All four locales (en-US, zh-CN, ko-KR, ru-RU) get rewritten chunking
setting descriptions: each now states the validated range, the default,
and the situations where you'd deviate (FAQ vs narrative, embedder
token limits, language-specific corpora).
Source code
- splitter.go: DefaultChunkSize / DefaultChunkOverlap constants get a
longer block-comment explaining the per-language token math and the
use-case sweet spots, plus the migration note on what the old
inconsistent defaults were.
- KBChunkingSettings.vue: new comment block above ChunkingConfig
documents the slider min/max for each setting, why those bounds
exist, and the recommended TokenLimit values per embedding model.
Repo docs
- New docs/CHUNKING.md: end-to-end guide covering why chunking matters,
the adaptive 3-tier architecture, per-setting reference with ranges
and sweet spots, parent-child explanation, the token-limit table per
embedder (OpenAI / Voyage / Cohere / BGE / MiniLM / Jina), 7 use-case
presets, the debug panel workflow, the API surface, and known
trade-offs (recursive strategy hidden from UI, no auto-reindex on
strategy switch, OCR limitations).
- CHANGELOG.md gets a new [Unreleased] section consolidating all the
adaptive-chunking work shipped on this branch: 5 features, 8
improvements, 6 fixes, 1 docs entry. The entry references
docs/CHUNKING.md for deeper explanation.
https://claude.ai/code/session_01XADhx6mtu2ZYW3DE9Lun6k
2026-05-03 11:57:03 +00:00
|
|
|
|
// Non-Wiki-only fallback. Mirrors chunker.DefaultChunkSize and
|
|
|
|
|
|
// DefaultChunkOverlap on the backend so a freshly created KB uses
|
|
|
|
|
|
// the same numbers whether the editor sets them or the splitter
|
|
|
|
|
|
// falls back to its package defaults.
|
2026-04-23 03:21:28 +00:00
|
|
|
|
const DEFAULT_CHUNKING_PRESET = {
|
|
|
|
|
|
chunkSize: 512,
|
docs(chunking): align overlap default + sharpen UI/source/repo docs
Three documentation passes around the adaptive chunking work:
UI
- Frontend ChunkOverlap default consolidated to 80 (was 100), matching
chunker.DefaultChunkOverlap on the backend. Both DEFAULT_CHUNKING_PRESET
and initFormData updated. The KB-load fallback also uses 80 when a
loaded KB has no chunk_overlap stored.
- All four locales (en-US, zh-CN, ko-KR, ru-RU) get rewritten chunking
setting descriptions: each now states the validated range, the default,
and the situations where you'd deviate (FAQ vs narrative, embedder
token limits, language-specific corpora).
Source code
- splitter.go: DefaultChunkSize / DefaultChunkOverlap constants get a
longer block-comment explaining the per-language token math and the
use-case sweet spots, plus the migration note on what the old
inconsistent defaults were.
- KBChunkingSettings.vue: new comment block above ChunkingConfig
documents the slider min/max for each setting, why those bounds
exist, and the recommended TokenLimit values per embedding model.
Repo docs
- New docs/CHUNKING.md: end-to-end guide covering why chunking matters,
the adaptive 3-tier architecture, per-setting reference with ranges
and sweet spots, parent-child explanation, the token-limit table per
embedder (OpenAI / Voyage / Cohere / BGE / MiniLM / Jina), 7 use-case
presets, the debug panel workflow, the API surface, and known
trade-offs (recursive strategy hidden from UI, no auto-reindex on
strategy switch, OCR limitations).
- CHANGELOG.md gets a new [Unreleased] section consolidating all the
adaptive-chunking work shipped on this branch: 5 features, 8
improvements, 6 fixes, 1 docs entry. The entry references
docs/CHUNKING.md for deeper explanation.
https://claude.ai/code/session_01XADhx6mtu2ZYW3DE9Lun6k
2026-05-03 11:57:03 +00:00
|
|
|
|
chunkOverlap: 80,
|
2026-04-23 03:21:28 +00:00
|
|
|
|
enableParentChild: true,
|
|
|
|
|
|
} as const
|
2025-11-06 13:12:26 +00:00
|
|
|
|
|
2025-11-14 17:30:17 +00:00
|
|
|
|
const navItems = computed(() => {
|
2026-03-30 05:32:39 +00:00
|
|
|
|
const items: { key: string; icon: string; label: string; badge?: number }[] = [
|
2025-11-14 17:30:17 +00:00
|
|
|
|
{ key: 'basic', icon: 'info-circle', label: t('knowledgeEditor.sidebar.basic') },
|
|
|
|
|
|
{ key: 'models', icon: 'control-platform', label: t('knowledgeEditor.sidebar.models') }
|
|
|
|
|
|
]
|
|
|
|
|
|
if (formData.value?.type === 'faq') {
|
|
|
|
|
|
items.push({ key: 'faq', icon: 'help-circle', label: t('knowledgeEditor.sidebar.faq') })
|
|
|
|
|
|
} else {
|
|
|
|
|
|
items.push(
|
2026-03-05 14:42:36 +00:00
|
|
|
|
{ key: 'parser', icon: 'file-search', label: t('settings.parserEngine') },
|
2026-04-02 12:53:44 +00:00
|
|
|
|
{ key: 'multimodal', icon: 'image', label: t('knowledgeEditor.sidebar.multimodal') },
|
|
|
|
|
|
{ key: 'asr', icon: 'sound', label: t('knowledgeEditor.sidebar.asr') },
|
2026-02-28 05:22:07 +00:00
|
|
|
|
{ key: 'storage', icon: 'cloud', label: t('knowledgeEditor.sidebar.storage') },
|
2025-11-14 17:30:17 +00:00
|
|
|
|
{ key: 'chunking', icon: 'file-copy', label: t('knowledgeEditor.sidebar.chunking') },
|
2025-11-25 08:44:44 +00:00
|
|
|
|
{ key: 'graph', icon: 'chart-bubble', label: t('knowledgeEditor.sidebar.graph') },
|
2025-11-14 17:30:17 +00:00
|
|
|
|
{ key: 'advanced', icon: 'setting', label: t('knowledgeEditor.sidebar.advanced') }
|
|
|
|
|
|
)
|
2026-03-27 07:02:40 +00:00
|
|
|
|
if (props.mode === 'edit' && props.kbId) {
|
2026-03-30 05:32:39 +00:00
|
|
|
|
items.push({ key: 'datasource', icon: 'cloud-download', label: t('knowledgeEditor.sidebar.datasource'), badge: dsCount.value || undefined })
|
2026-03-27 07:02:40 +00:00
|
|
|
|
}
|
2025-11-14 17:30:17 +00:00
|
|
|
|
}
|
2026-04-11 06:05:56 +00:00
|
|
|
|
if (props.mode === 'edit' && props.kbId && !authStore.isLiteMode) {
|
2026-01-30 08:28:01 +00:00
|
|
|
|
items.push({ key: 'share', icon: 'share', label: t('knowledgeEditor.sidebar.share') })
|
|
|
|
|
|
}
|
2025-11-14 17:30:17 +00:00
|
|
|
|
return items
|
|
|
|
|
|
})
|
2025-11-06 13:12:26 +00:00
|
|
|
|
|
|
|
|
|
|
// 模型配置引用
|
|
|
|
|
|
const modelConfigRef = ref<InstanceType<typeof KBModelConfig>>()
|
|
|
|
|
|
const advancedSettingsRef = ref<InstanceType<typeof KBAdvancedSettings>>()
|
|
|
|
|
|
|
|
|
|
|
|
// 表单数据
|
|
|
|
|
|
const formData = ref<any>(null)
|
2025-11-14 17:30:17 +00:00
|
|
|
|
const isFAQ = computed(() => formData.value?.type === 'faq')
|
|
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => formData.value?.type,
|
|
|
|
|
|
(newType, oldType) => {
|
|
|
|
|
|
if (!formData.value) return
|
|
|
|
|
|
if (newType === 'faq') {
|
|
|
|
|
|
if (!formData.value.faqConfig) {
|
2025-11-16 15:35:54 +00:00
|
|
|
|
formData.value.faqConfig = { indexMode: 'question_only', questionIndexMode: 'separate' }
|
2025-11-14 17:30:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
if (!['basic', 'models', 'faq'].includes(currentSection.value)) {
|
|
|
|
|
|
currentSection.value = 'faq'
|
|
|
|
|
|
}
|
2026-04-07 11:36:06 +00:00
|
|
|
|
} else if (oldType === 'faq' && currentSection.value === 'faq') {
|
2025-11-14 17:30:17 +00:00
|
|
|
|
currentSection.value = 'basic'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
2025-11-06 13:12:26 +00:00
|
|
|
|
|
|
|
|
|
|
// 初始化表单数据
|
2026-04-07 11:36:06 +00:00
|
|
|
|
const initFormData = (type: 'document' | 'faq' = 'document') => {
|
2025-11-06 13:12:26 +00:00
|
|
|
|
return {
|
2025-11-14 17:30:17 +00:00
|
|
|
|
type,
|
2025-11-06 13:12:26 +00:00
|
|
|
|
name: '',
|
|
|
|
|
|
description: '',
|
2025-11-14 17:30:17 +00:00
|
|
|
|
faqConfig: {
|
2025-11-16 15:35:54 +00:00
|
|
|
|
indexMode: 'question_only',
|
|
|
|
|
|
questionIndexMode: 'separate'
|
2025-11-14 17:30:17 +00:00
|
|
|
|
},
|
2025-11-06 13:12:26 +00:00
|
|
|
|
modelConfig: {
|
|
|
|
|
|
llmModelId: '',
|
2026-04-20 11:16:46 +00:00
|
|
|
|
embeddingModelId: '',
|
|
|
|
|
|
wikiSynthesisModelId: '',
|
2025-11-06 13:12:26 +00:00
|
|
|
|
},
|
|
|
|
|
|
chunkingConfig: {
|
|
|
|
|
|
chunkSize: 512,
|
docs(chunking): align overlap default + sharpen UI/source/repo docs
Three documentation passes around the adaptive chunking work:
UI
- Frontend ChunkOverlap default consolidated to 80 (was 100), matching
chunker.DefaultChunkOverlap on the backend. Both DEFAULT_CHUNKING_PRESET
and initFormData updated. The KB-load fallback also uses 80 when a
loaded KB has no chunk_overlap stored.
- All four locales (en-US, zh-CN, ko-KR, ru-RU) get rewritten chunking
setting descriptions: each now states the validated range, the default,
and the situations where you'd deviate (FAQ vs narrative, embedder
token limits, language-specific corpora).
Source code
- splitter.go: DefaultChunkSize / DefaultChunkOverlap constants get a
longer block-comment explaining the per-language token math and the
use-case sweet spots, plus the migration note on what the old
inconsistent defaults were.
- KBChunkingSettings.vue: new comment block above ChunkingConfig
documents the slider min/max for each setting, why those bounds
exist, and the recommended TokenLimit values per embedding model.
Repo docs
- New docs/CHUNKING.md: end-to-end guide covering why chunking matters,
the adaptive 3-tier architecture, per-setting reference with ranges
and sweet spots, parent-child explanation, the token-limit table per
embedder (OpenAI / Voyage / Cohere / BGE / MiniLM / Jina), 7 use-case
presets, the debug panel workflow, the API surface, and known
trade-offs (recursive strategy hidden from UI, no auto-reindex on
strategy switch, OCR limitations).
- CHANGELOG.md gets a new [Unreleased] section consolidating all the
adaptive-chunking work shipped on this branch: 5 features, 8
improvements, 6 fixes, 1 docs entry. The entry references
docs/CHUNKING.md for deeper explanation.
https://claude.ai/code/session_01XADhx6mtu2ZYW3DE9Lun6k
2026-05-03 11:57:03 +00:00
|
|
|
|
// 80 ≈ 15% of chunkSize — community-recommended sweet spot.
|
|
|
|
|
|
// Aligned with chunker.DefaultChunkOverlap on the backend.
|
|
|
|
|
|
chunkOverlap: 80,
|
2026-02-28 05:22:07 +00:00
|
|
|
|
separators: ['\n\n', '\n', '。', '!', '?', ';', ';'],
|
2026-03-04 12:35:10 +00:00
|
|
|
|
parserEngineRules: undefined as any,
|
2026-03-13 09:22:02 +00:00
|
|
|
|
enableParentChild: true,
|
2026-03-05 07:04:08 +00:00
|
|
|
|
parentChunkSize: 4096,
|
2026-05-02 20:40:07 +00:00
|
|
|
|
childChunkSize: 384,
|
|
|
|
|
|
// New KBs default to the adaptive auto-strategy. User can change in the UI.
|
|
|
|
|
|
strategy: 'auto' as string,
|
|
|
|
|
|
tokenLimit: 0,
|
|
|
|
|
|
languages: [] as string[]
|
2025-11-06 13:12:26 +00:00
|
|
|
|
},
|
2026-03-20 22:18:34 +00:00
|
|
|
|
storageProvider: '' as string,
|
2025-11-06 13:12:26 +00:00
|
|
|
|
multimodalConfig: {
|
|
|
|
|
|
enabled: false,
|
2026-02-28 05:22:07 +00:00
|
|
|
|
vllmModelId: ''
|
2025-11-06 13:12:26 +00:00
|
|
|
|
},
|
2026-04-02 08:43:37 +00:00
|
|
|
|
asrConfig: {
|
|
|
|
|
|
enabled: false,
|
|
|
|
|
|
modelId: '',
|
|
|
|
|
|
language: ''
|
|
|
|
|
|
},
|
2025-11-25 08:51:14 +00:00
|
|
|
|
nodeExtractConfig: {
|
2025-11-06 13:12:26 +00:00
|
|
|
|
enabled: false,
|
|
|
|
|
|
text: '',
|
2025-11-20 12:08:24 +00:00
|
|
|
|
tags: [] as string[],
|
|
|
|
|
|
nodes: [] as Array<{
|
|
|
|
|
|
name: string
|
|
|
|
|
|
attributes: string[]
|
|
|
|
|
|
}>,
|
|
|
|
|
|
relations: [] as Array<{
|
|
|
|
|
|
node1: string
|
|
|
|
|
|
node2: string
|
|
|
|
|
|
type: string
|
|
|
|
|
|
}>
|
2025-11-25 08:44:44 +00:00
|
|
|
|
},
|
2025-12-02 17:42:31 +00:00
|
|
|
|
questionGenerationConfig: {
|
2026-03-13 09:22:02 +00:00
|
|
|
|
enabled: true,
|
2025-12-02 17:42:31 +00:00
|
|
|
|
questionCount: 3
|
|
|
|
|
|
},
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
wikiConfig: {
|
|
|
|
|
|
synthesisModelId: '',
|
|
|
|
|
|
maxPagesPerIngest: 0,
|
2026-04-22 12:27:19 +00:00
|
|
|
|
extractionGranularity: 'standard' as 'focused' | 'standard' | 'exhaustive',
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
},
|
2026-04-20 11:16:46 +00:00
|
|
|
|
indexingStrategy: {
|
|
|
|
|
|
vectorEnabled: true,
|
|
|
|
|
|
keywordEnabled: true,
|
|
|
|
|
|
wikiEnabled: false,
|
|
|
|
|
|
graphEnabled: false,
|
|
|
|
|
|
},
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 加载所有模型
|
|
|
|
|
|
const loadAllModels = async () => {
|
|
|
|
|
|
try {
|
|
|
|
|
|
const models = await listModels()
|
|
|
|
|
|
allModels.value = models || []
|
|
|
|
|
|
} catch (error) {
|
2025-11-13 11:34:33 +00:00
|
|
|
|
console.error('Failed to load model list:', error)
|
|
|
|
|
|
MessagePlugin.error(t('knowledgeEditor.messages.loadModelsFailed'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
allModels.value = []
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 加载知识库数据(编辑模式)
|
|
|
|
|
|
const loadKBData = async () => {
|
|
|
|
|
|
if (props.mode !== 'edit' || !props.kbId) return
|
|
|
|
|
|
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
const [kbInfo, models, filesResult] = await Promise.all([
|
|
|
|
|
|
getKnowledgeBaseById(props.kbId),
|
|
|
|
|
|
loadAllModels(),
|
|
|
|
|
|
listKnowledgeFiles(props.kbId, { page: 1, page_size: 1 })
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
if (!kbInfo || !kbInfo.data) {
|
2025-11-13 11:34:33 +00:00
|
|
|
|
throw new Error(t('knowledgeEditor.messages.notFound'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const kb = kbInfo.data
|
|
|
|
|
|
hasFiles.value = (filesResult as any)?.total > 0
|
2026-05-15 09:56:58 +00:00
|
|
|
|
kbCreatorId.value = (kb as any).creator_id || ''
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
// 设置表单数据
|
2026-04-07 11:36:06 +00:00
|
|
|
|
const kbType = (kb.type as 'document' | 'faq') || 'document'
|
2025-11-06 13:12:26 +00:00
|
|
|
|
formData.value = {
|
2025-11-14 17:30:17 +00:00
|
|
|
|
type: kbType,
|
2025-11-06 13:12:26 +00:00
|
|
|
|
name: kb.name || '',
|
|
|
|
|
|
description: kb.description || '',
|
2025-11-14 17:30:17 +00:00
|
|
|
|
faqConfig: {
|
2025-11-16 15:35:54 +00:00
|
|
|
|
indexMode: kb.faq_config?.index_mode || 'question_only',
|
|
|
|
|
|
questionIndexMode: kb.faq_config?.question_index_mode || 'separate'
|
2025-11-14 17:30:17 +00:00
|
|
|
|
},
|
2025-11-06 13:12:26 +00:00
|
|
|
|
modelConfig: {
|
|
|
|
|
|
llmModelId: kb.summary_model_id || '',
|
2026-04-20 11:16:46 +00:00
|
|
|
|
embeddingModelId: kb.embedding_model_id || '',
|
|
|
|
|
|
wikiSynthesisModelId: kb.wiki_config?.synthesis_model_id || ''
|
2025-11-06 13:12:26 +00:00
|
|
|
|
},
|
|
|
|
|
|
chunkingConfig: {
|
|
|
|
|
|
chunkSize: kb.chunking_config?.chunk_size || 512,
|
docs(chunking): align overlap default + sharpen UI/source/repo docs
Three documentation passes around the adaptive chunking work:
UI
- Frontend ChunkOverlap default consolidated to 80 (was 100), matching
chunker.DefaultChunkOverlap on the backend. Both DEFAULT_CHUNKING_PRESET
and initFormData updated. The KB-load fallback also uses 80 when a
loaded KB has no chunk_overlap stored.
- All four locales (en-US, zh-CN, ko-KR, ru-RU) get rewritten chunking
setting descriptions: each now states the validated range, the default,
and the situations where you'd deviate (FAQ vs narrative, embedder
token limits, language-specific corpora).
Source code
- splitter.go: DefaultChunkSize / DefaultChunkOverlap constants get a
longer block-comment explaining the per-language token math and the
use-case sweet spots, plus the migration note on what the old
inconsistent defaults were.
- KBChunkingSettings.vue: new comment block above ChunkingConfig
documents the slider min/max for each setting, why those bounds
exist, and the recommended TokenLimit values per embedding model.
Repo docs
- New docs/CHUNKING.md: end-to-end guide covering why chunking matters,
the adaptive 3-tier architecture, per-setting reference with ranges
and sweet spots, parent-child explanation, the token-limit table per
embedder (OpenAI / Voyage / Cohere / BGE / MiniLM / Jina), 7 use-case
presets, the debug panel workflow, the API surface, and known
trade-offs (recursive strategy hidden from UI, no auto-reindex on
strategy switch, OCR limitations).
- CHANGELOG.md gets a new [Unreleased] section consolidating all the
adaptive-chunking work shipped on this branch: 5 features, 8
improvements, 6 fixes, 1 docs entry. The entry references
docs/CHUNKING.md for deeper explanation.
https://claude.ai/code/session_01XADhx6mtu2ZYW3DE9Lun6k
2026-05-03 11:57:03 +00:00
|
|
|
|
// Fallback only used when the loaded KB has no chunk_overlap stored.
|
|
|
|
|
|
// Aligned with chunker.DefaultChunkOverlap on the backend.
|
|
|
|
|
|
chunkOverlap: kb.chunking_config?.chunk_overlap || 80,
|
2026-02-28 05:22:07 +00:00
|
|
|
|
separators: kb.chunking_config?.separators || ['\n\n', '\n', '。', '!', '?', ';', ';'],
|
2026-03-04 12:35:10 +00:00
|
|
|
|
parserEngineRules: kb.chunking_config?.parser_engine_rules || undefined,
|
|
|
|
|
|
enableParentChild: kb.chunking_config?.enable_parent_child || false,
|
2026-03-05 07:04:08 +00:00
|
|
|
|
parentChunkSize: kb.chunking_config?.parent_chunk_size || 4096,
|
2026-05-02 20:40:07 +00:00
|
|
|
|
childChunkSize: kb.chunking_config?.child_chunk_size || 384,
|
|
|
|
|
|
// Existing KBs without strategy field render as empty (= legacy behavior).
|
|
|
|
|
|
// The user has to actively pick a value to opt in to the new tiers.
|
|
|
|
|
|
strategy: kb.chunking_config?.strategy || '',
|
|
|
|
|
|
tokenLimit: kb.chunking_config?.token_limit || 0,
|
|
|
|
|
|
languages: kb.chunking_config?.languages || []
|
2025-11-06 13:12:26 +00:00
|
|
|
|
},
|
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
2026-04-01 07:37:13 +00:00
|
|
|
|
storageProvider: (kb.storage_provider_config?.provider || kb.storage_config?.provider || 'local') as string,
|
2025-11-06 13:12:26 +00:00
|
|
|
|
multimodalConfig: {
|
2026-02-28 05:22:07 +00:00
|
|
|
|
enabled: !!kb.vlm_config?.enabled,
|
|
|
|
|
|
vllmModelId: kb.vlm_config?.model_id || ''
|
2025-11-06 13:12:26 +00:00
|
|
|
|
},
|
2026-04-02 08:43:37 +00:00
|
|
|
|
asrConfig: {
|
|
|
|
|
|
enabled: !!kb.asr_config?.enabled,
|
|
|
|
|
|
modelId: kb.asr_config?.model_id || '',
|
|
|
|
|
|
language: kb.asr_config?.language || ''
|
|
|
|
|
|
},
|
2025-11-25 08:51:14 +00:00
|
|
|
|
nodeExtractConfig: {
|
2025-11-06 13:12:26 +00:00
|
|
|
|
enabled: kb.extract_config?.enabled || false,
|
|
|
|
|
|
text: kb.extract_config?.text || '',
|
2025-11-20 12:08:24 +00:00
|
|
|
|
tags: kb.extract_config?.tags || [],
|
2025-11-25 08:44:44 +00:00
|
|
|
|
nodes: (kb.extract_config?.nodes || []).map((node: any) => ({
|
|
|
|
|
|
name: node.name,
|
|
|
|
|
|
attributes: node.attributes || []
|
|
|
|
|
|
})),
|
2025-11-20 12:08:24 +00:00
|
|
|
|
relations: kb.extract_config?.relations || []
|
2025-11-25 08:44:44 +00:00
|
|
|
|
},
|
2025-12-02 17:42:31 +00:00
|
|
|
|
questionGenerationConfig: {
|
|
|
|
|
|
enabled: kb.question_generation_config?.enabled || false,
|
|
|
|
|
|
questionCount: kb.question_generation_config?.question_count || 3
|
|
|
|
|
|
},
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
wikiConfig: {
|
|
|
|
|
|
synthesisModelId: kb.wiki_config?.synthesis_model_id || '',
|
|
|
|
|
|
maxPagesPerIngest: kb.wiki_config?.max_pages_per_ingest || 0,
|
2026-04-22 12:27:19 +00:00
|
|
|
|
extractionGranularity: (
|
|
|
|
|
|
kb.wiki_config?.extraction_granularity === 'focused' ||
|
|
|
|
|
|
kb.wiki_config?.extraction_granularity === 'exhaustive'
|
|
|
|
|
|
? kb.wiki_config.extraction_granularity
|
|
|
|
|
|
: 'standard'
|
|
|
|
|
|
) as 'focused' | 'standard' | 'exhaustive',
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
},
|
2026-04-20 11:16:46 +00:00
|
|
|
|
indexingStrategy: {
|
|
|
|
|
|
vectorEnabled: kb.indexing_strategy?.vector_enabled ?? true,
|
|
|
|
|
|
keywordEnabled: kb.indexing_strategy?.keyword_enabled ?? true,
|
|
|
|
|
|
wikiEnabled: kb.indexing_strategy?.wiki_enabled ?? false,
|
|
|
|
|
|
graphEnabled: kb.indexing_strategy?.graph_enabled ?? false,
|
|
|
|
|
|
},
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
2026-03-09 12:27:24 +00:00
|
|
|
|
initialStorageProvider.value = formData.value.storageProvider
|
2026-04-20 11:16:46 +00:00
|
|
|
|
initialIndexingStrategy.value = { ...formData.value.indexingStrategy }
|
2025-11-06 13:12:26 +00:00
|
|
|
|
} catch (error) {
|
2025-11-13 11:34:33 +00:00
|
|
|
|
console.error('Failed to load knowledge base data:', error)
|
|
|
|
|
|
MessagePlugin.error(t('knowledgeEditor.messages.loadDataFailed'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
handleClose()
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 处理配置更新
|
|
|
|
|
|
const handleModelConfigUpdate = (config: any) => {
|
|
|
|
|
|
if (formData.value) {
|
|
|
|
|
|
formData.value.modelConfig = { ...config }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-22 12:27:19 +00:00
|
|
|
|
// 粒度选择器:从 formData.wikiConfig 读出并规范化,未知值回退到 'standard',
|
|
|
|
|
|
// 与后端 WikiExtractionGranularity.Normalize() 的契约保持一致。
|
|
|
|
|
|
const resolvedGranularity = computed<'focused' | 'standard' | 'exhaustive'>(() => {
|
|
|
|
|
|
const g = formData.value?.wikiConfig?.extractionGranularity
|
|
|
|
|
|
if (g === 'focused' || g === 'standard' || g === 'exhaustive') {
|
|
|
|
|
|
return g
|
|
|
|
|
|
}
|
|
|
|
|
|
return 'standard'
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const granularityHint = computed<string>(() => {
|
|
|
|
|
|
switch (resolvedGranularity.value) {
|
|
|
|
|
|
case 'focused':
|
|
|
|
|
|
return t('knowledgeEditor.wiki.granularityFocusedHint')
|
|
|
|
|
|
case 'exhaustive':
|
|
|
|
|
|
return t('knowledgeEditor.wiki.granularityExhaustiveHint')
|
|
|
|
|
|
default:
|
|
|
|
|
|
return t('knowledgeEditor.wiki.granularityStandardHint')
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const handleGranularityChange = (value: string | number | boolean) => {
|
|
|
|
|
|
if (!formData.value) return
|
|
|
|
|
|
const next: 'focused' | 'standard' | 'exhaustive' =
|
|
|
|
|
|
value === 'focused' || value === 'exhaustive'
|
|
|
|
|
|
? (value as 'focused' | 'exhaustive')
|
|
|
|
|
|
: 'standard'
|
|
|
|
|
|
formData.value.wikiConfig = {
|
|
|
|
|
|
...formData.value.wikiConfig,
|
|
|
|
|
|
extractionGranularity: next,
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-21 06:46:41 +00:00
|
|
|
|
const isIndexingLocked = computed(() => props.mode === 'edit' && hasFiles.value)
|
|
|
|
|
|
|
2026-04-20 13:54:54 +00:00
|
|
|
|
const toggleVectorIndexing = () => {
|
|
|
|
|
|
if (!formData.value) return
|
2026-04-21 06:46:41 +00:00
|
|
|
|
if (isIndexingLocked.value) return
|
2026-04-20 13:54:54 +00:00
|
|
|
|
const next = !formData.value.indexingStrategy.vectorEnabled
|
|
|
|
|
|
formData.value.indexingStrategy.vectorEnabled = next
|
|
|
|
|
|
formData.value.indexingStrategy.keywordEnabled = next
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-21 06:46:41 +00:00
|
|
|
|
const toggleWikiIndexing = () => {
|
|
|
|
|
|
if (!formData.value) return
|
|
|
|
|
|
if (isIndexingLocked.value) return
|
|
|
|
|
|
formData.value.indexingStrategy.wikiEnabled = !formData.value.indexingStrategy.wikiEnabled
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
const handleChunkingConfigUpdate = (config: any) => {
|
|
|
|
|
|
if (formData.value) {
|
|
|
|
|
|
formData.value.chunkingConfig = { ...config }
|
2026-04-23 03:21:28 +00:00
|
|
|
|
// 用户已经手动触达分块设置,后续索引策略切换不再覆盖这些值
|
|
|
|
|
|
chunkingDirty.value = true
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-23 03:21:28 +00:00
|
|
|
|
// 判断当前是否为「仅 Wiki 索引」:只开了 Wiki,关了向量/关键词检索
|
|
|
|
|
|
const isWikiOnlyStrategy = computed(() => {
|
|
|
|
|
|
const s = formData.value?.indexingStrategy
|
|
|
|
|
|
if (!s) return false
|
|
|
|
|
|
return !!s.wikiEnabled && !s.vectorEnabled && !s.keywordEnabled
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// 仅在创建模式、用户未改过分块设置时,随索引策略自动应用/撤销 Wiki-only 预设。
|
|
|
|
|
|
// 编辑模式严格保持后端已有配置不变,避免误改。
|
|
|
|
|
|
watch(isWikiOnlyStrategy, (wikiOnly) => {
|
|
|
|
|
|
if (props.mode !== 'create') return
|
|
|
|
|
|
if (!formData.value) return
|
|
|
|
|
|
if (chunkingDirty.value) return
|
|
|
|
|
|
const preset = wikiOnly ? WIKI_ONLY_CHUNKING_PRESET : DEFAULT_CHUNKING_PRESET
|
|
|
|
|
|
formData.value.chunkingConfig = {
|
|
|
|
|
|
...formData.value.chunkingConfig,
|
|
|
|
|
|
...preset,
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2026-02-28 05:22:07 +00:00
|
|
|
|
const handleParserEngineRulesUpdate = (rules: any[]) => {
|
|
|
|
|
|
if (formData.value) {
|
|
|
|
|
|
formData.value.chunkingConfig.parserEngineRules = rules?.length ? rules : undefined
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-11 13:16:23 +00:00
|
|
|
|
const handleMultimodalToggle = () => {
|
|
|
|
|
|
if (formData.value && !formData.value.multimodalConfig.enabled) {
|
|
|
|
|
|
formData.value.multimodalConfig.vllmModelId = ''
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleMultimodalVLLMChange = (modelId: string) => {
|
2025-11-06 13:12:26 +00:00
|
|
|
|
if (formData.value) {
|
2026-03-11 13:16:23 +00:00
|
|
|
|
formData.value.multimodalConfig.vllmModelId = modelId
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-11 13:16:23 +00:00
|
|
|
|
const handleAddVLLMModel = () => {
|
|
|
|
|
|
uiStore.openSettings('models', 'vllm')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-03 04:14:33 +00:00
|
|
|
|
const handleAddASRModel = () => {
|
|
|
|
|
|
uiStore.openSettings('models', 'asr')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-07 11:36:06 +00:00
|
|
|
|
const handleAddWikiModel = () => {
|
|
|
|
|
|
uiStore.openSettings('models', 'knowledgeqa')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-28 05:22:07 +00:00
|
|
|
|
const handleStorageProviderUpdate = (value: string) => {
|
|
|
|
|
|
if (formData.value) {
|
|
|
|
|
|
formData.value.storageProvider = value || 'local'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-02 17:42:31 +00:00
|
|
|
|
const handleQuestionGenerationUpdate = (config: any) => {
|
|
|
|
|
|
if (formData.value) {
|
|
|
|
|
|
formData.value.questionGenerationConfig = { ...config }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
const handleNodeExtractUpdate = (config: any) => {
|
|
|
|
|
|
if (formData.value) {
|
2025-11-25 08:51:14 +00:00
|
|
|
|
formData.value.nodeExtractConfig = { ...config }
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 验证表单
|
|
|
|
|
|
const validateForm = (): boolean => {
|
|
|
|
|
|
if (!formData.value) return false
|
|
|
|
|
|
|
|
|
|
|
|
// 验证基本信息
|
|
|
|
|
|
if (!formData.value.name || !formData.value.name.trim()) {
|
2025-11-13 11:34:33 +00:00
|
|
|
|
MessagePlugin.warning(t('knowledgeEditor.messages.nameRequired'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
currentSection.value = 'basic'
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-20 11:16:46 +00:00
|
|
|
|
// 验证索引策略 — 文档类型至少需要开启一种
|
|
|
|
|
|
if (formData.value.type !== 'faq') {
|
|
|
|
|
|
const s = formData.value.indexingStrategy
|
|
|
|
|
|
if (s && !s.vectorEnabled && !s.keywordEnabled && !s.wikiEnabled && !s.graphEnabled) {
|
|
|
|
|
|
MessagePlugin.warning(t('knowledgeEditor.indexing.atLeastOne'))
|
|
|
|
|
|
currentSection.value = 'basic'
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 验证模型配置 - embedding 模型仅在检索索引启用时必须
|
|
|
|
|
|
const needsEmbedding = formData.value.indexingStrategy?.vectorEnabled || formData.value.indexingStrategy?.keywordEnabled
|
|
|
|
|
|
if (needsEmbedding && !formData.value.modelConfig.embeddingModelId) {
|
|
|
|
|
|
MessagePlugin.warning(t('knowledgeEditor.indexing.embeddingRequired'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
currentSection.value = 'models'
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!formData.value.modelConfig.llmModelId) {
|
2025-11-13 11:34:33 +00:00
|
|
|
|
MessagePlugin.warning(t('knowledgeEditor.messages.summaryRequired'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
currentSection.value = 'models'
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 验证多模态配置(如果启用)
|
2026-03-11 13:16:23 +00:00
|
|
|
|
if (formData.value.multimodalConfig.enabled && !formData.value.multimodalConfig.vllmModelId) {
|
|
|
|
|
|
MessagePlugin.warning(t('knowledgeEditor.messages.multimodalInvalid'))
|
|
|
|
|
|
currentSection.value = 'multimodal'
|
|
|
|
|
|
return false
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-14 17:30:17 +00:00
|
|
|
|
if (formData.value.type === 'faq' && !formData.value.faqConfig?.indexMode) {
|
|
|
|
|
|
MessagePlugin.warning(t('knowledgeEditor.messages.indexModeRequired'))
|
|
|
|
|
|
currentSection.value = 'faq'
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
return true
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 构建提交数据
|
|
|
|
|
|
const buildSubmitData = () => {
|
|
|
|
|
|
if (!formData.value) return null
|
|
|
|
|
|
|
|
|
|
|
|
const data: any = {
|
|
|
|
|
|
name: formData.value.name,
|
|
|
|
|
|
description: formData.value.description,
|
2025-11-14 17:30:17 +00:00
|
|
|
|
type: formData.value.type,
|
2025-11-06 13:12:26 +00:00
|
|
|
|
chunking_config: {
|
|
|
|
|
|
chunk_size: formData.value.chunkingConfig.chunkSize,
|
|
|
|
|
|
chunk_overlap: formData.value.chunkingConfig.chunkOverlap,
|
|
|
|
|
|
separators: formData.value.chunkingConfig.separators,
|
2026-02-28 05:22:07 +00:00
|
|
|
|
enable_multimodal: formData.value.multimodalConfig.enabled,
|
2026-03-04 12:35:10 +00:00
|
|
|
|
enable_parent_child: formData.value.chunkingConfig.enableParentChild,
|
|
|
|
|
|
parent_chunk_size: formData.value.chunkingConfig.parentChunkSize,
|
|
|
|
|
|
child_chunk_size: formData.value.chunkingConfig.childChunkSize,
|
2026-05-03 07:01:20 +00:00
|
|
|
|
// Adaptive chunking fields are always sent (empty/zero values
|
|
|
|
|
|
// included) so the user can clear them — backend uses pointer DTOs
|
|
|
|
|
|
// to distinguish "not in payload" from "explicitly empty".
|
|
|
|
|
|
strategy: formData.value.chunkingConfig.strategy ?? '',
|
|
|
|
|
|
token_limit: formData.value.chunkingConfig.tokenLimit ?? 0,
|
|
|
|
|
|
languages: formData.value.chunkingConfig.languages ?? [],
|
2026-02-28 05:22:07 +00:00
|
|
|
|
...(formData.value.chunkingConfig.parserEngineRules?.length
|
|
|
|
|
|
? { parser_engine_rules: formData.value.chunkingConfig.parserEngineRules }
|
|
|
|
|
|
: {})
|
2025-11-06 13:12:26 +00:00
|
|
|
|
},
|
|
|
|
|
|
embedding_model_id: formData.value.modelConfig.embeddingModelId,
|
|
|
|
|
|
summary_model_id: formData.value.modelConfig.llmModelId
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加多模态配置
|
2025-11-20 12:08:24 +00:00
|
|
|
|
data.vlm_config = {
|
|
|
|
|
|
enabled: formData.value.multimodalConfig.enabled,
|
|
|
|
|
|
model_id: formData.value.multimodalConfig.enabled
|
|
|
|
|
|
? (formData.value.multimodalConfig.vllmModelId || '')
|
|
|
|
|
|
: ''
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-02 08:43:37 +00:00
|
|
|
|
// 添加ASR语音识别配置
|
|
|
|
|
|
data.asr_config = {
|
|
|
|
|
|
enabled: formData.value.asrConfig?.enabled || false,
|
|
|
|
|
|
model_id: formData.value.asrConfig?.enabled
|
|
|
|
|
|
? (formData.value.asrConfig?.modelId || '')
|
|
|
|
|
|
: '',
|
|
|
|
|
|
language: formData.value.asrConfig?.language || ''
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-28 05:22:07 +00:00
|
|
|
|
// 存储引擎:仅传 provider,参数从全局设置读取
|
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
2026-04-01 07:37:13 +00:00
|
|
|
|
// Write to storage_provider_config (authoritative) + storage_config (legacy dual-write)
|
|
|
|
|
|
data.storage_provider_config = {
|
|
|
|
|
|
provider: formData.value.storageProvider || 'local'
|
|
|
|
|
|
}
|
2026-02-28 09:39:59 +00:00
|
|
|
|
data.storage_config = {
|
2026-02-28 05:22:07 +00:00
|
|
|
|
provider: formData.value.storageProvider || 'local'
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-20 11:16:46 +00:00
|
|
|
|
// 添加知识图谱配置 — now synced via indexingStrategy.graphEnabled
|
|
|
|
|
|
// extract_config is sent below along with indexing_strategy
|
2025-11-06 13:12:26 +00:00
|
|
|
|
|
2025-12-02 17:42:31 +00:00
|
|
|
|
// 添加问题生成配置
|
|
|
|
|
|
if (formData.value.questionGenerationConfig?.enabled) {
|
|
|
|
|
|
data.question_generation_config = {
|
|
|
|
|
|
enabled: true,
|
|
|
|
|
|
question_count: formData.value.questionGenerationConfig.questionCount || 3
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-14 17:30:17 +00:00
|
|
|
|
if (formData.value.type === 'faq') {
|
|
|
|
|
|
data.faq_config = {
|
2025-11-16 15:35:54 +00:00
|
|
|
|
index_mode: formData.value.faqConfig?.indexMode || 'question_only',
|
|
|
|
|
|
question_index_mode: formData.value.faqConfig?.questionIndexMode || 'separate'
|
2025-11-14 17:30:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-22 12:27:19 +00:00
|
|
|
|
// Wiki enablement is carried solely by indexing_strategy.wiki_enabled.
|
|
|
|
|
|
// wiki_config only holds wiki-specific tunables.
|
2026-04-07 11:36:06 +00:00
|
|
|
|
if (formData.value.type !== 'faq') {
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
data.wiki_config = {
|
2026-04-20 11:16:46 +00:00
|
|
|
|
synthesis_model_id: formData.value.modelConfig?.wikiSynthesisModelId || '',
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
max_pages_per_ingest: formData.value.wikiConfig?.maxPagesPerIngest || 0,
|
2026-04-22 12:27:19 +00:00
|
|
|
|
extraction_granularity: formData.value.wikiConfig?.extractionGranularity || 'standard',
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-20 11:16:46 +00:00
|
|
|
|
// Send indexing strategy
|
|
|
|
|
|
if (formData.value.type !== 'faq') {
|
|
|
|
|
|
data.indexing_strategy = {
|
|
|
|
|
|
vector_enabled: formData.value.indexingStrategy?.vectorEnabled ?? true,
|
|
|
|
|
|
keyword_enabled: formData.value.indexingStrategy?.keywordEnabled ?? true,
|
|
|
|
|
|
wiki_enabled: formData.value.indexingStrategy?.wikiEnabled ?? false,
|
|
|
|
|
|
graph_enabled: formData.value.indexingStrategy?.graphEnabled ?? false,
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-12 16:33:51 +00:00
|
|
|
|
// Always persist extract_config so the toggle state from GraphSettings is saved,
|
|
|
|
|
|
// regardless of whether the graph indexing strategy is currently enabled.
|
|
|
|
|
|
if (formData.value.nodeExtractConfig) {
|
2026-04-20 11:16:46 +00:00
|
|
|
|
data.extract_config = {
|
2026-05-12 16:33:51 +00:00
|
|
|
|
enabled: !!formData.value.nodeExtractConfig.enabled,
|
|
|
|
|
|
text: formData.value.nodeExtractConfig.text || '',
|
|
|
|
|
|
tags: formData.value.nodeExtractConfig.tags || [],
|
|
|
|
|
|
nodes: formData.value.nodeExtractConfig.nodes || [],
|
|
|
|
|
|
relations: formData.value.nodeExtractConfig.relations || []
|
2026-04-20 11:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
return data
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 提交表单
|
|
|
|
|
|
const handleSubmit = async () => {
|
|
|
|
|
|
if (!validateForm()) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-09 12:27:24 +00:00
|
|
|
|
// 编辑模式下,若已有文件且存储引擎发生了变化,弹窗确认
|
|
|
|
|
|
if (
|
|
|
|
|
|
props.mode === 'edit' &&
|
|
|
|
|
|
hasFiles.value &&
|
|
|
|
|
|
formData.value &&
|
|
|
|
|
|
initialStorageProvider.value &&
|
|
|
|
|
|
formData.value.storageProvider !== initialStorageProvider.value
|
|
|
|
|
|
) {
|
|
|
|
|
|
const dialog = DialogPlugin.confirm({
|
|
|
|
|
|
header: t('common.confirm'),
|
|
|
|
|
|
body: t('knowledgeEditor.messages.storageChangeConfirm'),
|
|
|
|
|
|
confirmBtn: t('common.confirm'),
|
|
|
|
|
|
cancelBtn: t('common.cancel'),
|
|
|
|
|
|
onConfirm: () => {
|
|
|
|
|
|
dialog.destroy()
|
|
|
|
|
|
doSubmit()
|
|
|
|
|
|
},
|
|
|
|
|
|
onCancel: () => {
|
|
|
|
|
|
dialog.destroy()
|
|
|
|
|
|
},
|
|
|
|
|
|
})
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
doSubmit()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const doSubmit = async () => {
|
2025-11-06 13:12:26 +00:00
|
|
|
|
saving.value = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
const data = buildSubmitData()
|
|
|
|
|
|
if (!data) {
|
2025-11-13 11:34:33 +00:00
|
|
|
|
throw new Error(t('knowledgeEditor.messages.buildDataFailed'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (props.mode === 'create') {
|
|
|
|
|
|
// 创建模式:一次性创建知识库及所有配置
|
2025-11-13 11:34:33 +00:00
|
|
|
|
const result: any = await createKnowledgeBase(data)
|
2025-11-06 13:12:26 +00:00
|
|
|
|
if (!result.success || !result.data?.id) {
|
2025-11-13 11:34:33 +00:00
|
|
|
|
throw new Error(result.message || t('knowledgeEditor.messages.createFailed'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
2025-11-13 11:34:33 +00:00
|
|
|
|
MessagePlugin.success(t('knowledgeEditor.messages.createSuccess'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
emit('success', result.data.id)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// 编辑模式:分别更新基本信息和配置
|
|
|
|
|
|
if (!props.kbId) {
|
2025-11-13 11:34:33 +00:00
|
|
|
|
throw new Error(t('knowledgeEditor.messages.missingId'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
// 1. 更新基本信息(名称、描述)和 FAQ/Wiki 配置
|
2025-11-14 17:30:17 +00:00
|
|
|
|
const updateConfig: any = {}
|
|
|
|
|
|
if (formData.value.type === 'faq' && formData.value.faqConfig) {
|
|
|
|
|
|
updateConfig.faq_config = {
|
2025-11-16 15:35:54 +00:00
|
|
|
|
index_mode: formData.value.faqConfig.indexMode || 'question_only',
|
|
|
|
|
|
question_index_mode: formData.value.faqConfig.questionIndexMode || 'separate'
|
2025-11-14 17:30:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-04-07 11:36:06 +00:00
|
|
|
|
if (formData.value.wikiConfig && formData.value.type !== 'faq') {
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
updateConfig.wiki_config = {
|
2026-04-20 11:16:46 +00:00
|
|
|
|
synthesis_model_id: formData.value.modelConfig?.wikiSynthesisModelId || '',
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
max_pages_per_ingest: formData.value.wikiConfig.maxPagesPerIngest || 0,
|
2026-04-22 12:27:19 +00:00
|
|
|
|
extraction_granularity: formData.value.wikiConfig.extractionGranularity || 'standard',
|
feat: Implement comprehensive wiki feature for knowledge bases
This commit introduces the complete wiki feature for WeKnora, enabling AI-powered wiki page generation and management. The implementation includes:
**Backend Changes:**
- Wiki data model: WikiPage type with support for multiple page types (Summary, Entity, Concept, Index, Log)
- Database schema: wiki_pages table with full migration support
- WikiPageService: CRUD operations and page management
- WikiPageRepository: GORM-based persistence layer
- Wiki ingest pipeline: Automated generation of wiki pages from knowledge documents
* Summary page generation using LLM
* Entity and concept extraction in a single LLM call
* Synthesis opportunity detection
* Index page rebuilding
* Log page maintenance
- Wiki boost feature: Enhance chat retrieval with wiki context
- Wiki linting: Maintenance and validation utilities
- Agent wiki tools: Enable agents to query and interact with wiki pages
- Wiki prompts: Comprehensive LLM prompt templates for all wiki generation tasks
- Language support: Reuse existing middleware language infrastructure for LLM prompts
**Frontend Changes:**
- Wiki browser UI: View all wiki pages with filtering and search
- Wiki API client: Knowledge base wiki management endpoints
- Knowledge base editor: Configure wiki settings (language, auto-ingest, synthesis model)
- i18n updates: Support for English, Korean, Russian, and Chinese interfaces
**Configuration:**
- Container DI: Wire up all wiki services
- Router: Register wiki API endpoints
- Task handling: Support async wiki ingest tasks
**Testing:**
- Unit tests for wiki page types
- Service layer tests
- Endpoint tests for wiki operations
- Integration tests with LLM mocking
**Documentation:**
- Language refactoring analysis and guides
- Implementation completion reports
- Quick reference guides for developers
**Key Features:**
✅ LLM-powered wiki page generation from documents
✅ Multi-language support (9+ languages)
✅ Automatic extraction of entities and concepts
✅ Synthesis opportunity detection
✅ Index and log page maintenance
✅ Progressive wiki building across multiple documents
✅ Agent-based wiki interaction
✅ Chat retrieval enhancement with wiki context
✅ Full frontend UI for wiki browsing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 05:56:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-04-20 11:16:46 +00:00
|
|
|
|
if (formData.value.type !== 'faq') {
|
|
|
|
|
|
updateConfig.indexing_strategy = {
|
|
|
|
|
|
vector_enabled: formData.value.indexingStrategy?.vectorEnabled ?? true,
|
|
|
|
|
|
keyword_enabled: formData.value.indexingStrategy?.keywordEnabled ?? true,
|
|
|
|
|
|
wiki_enabled: formData.value.indexingStrategy?.wikiEnabled ?? false,
|
|
|
|
|
|
graph_enabled: formData.value.indexingStrategy?.graphEnabled ?? false,
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-11-06 13:12:26 +00:00
|
|
|
|
await updateKnowledgeBase(props.kbId, {
|
|
|
|
|
|
name: data.name,
|
|
|
|
|
|
description: data.description,
|
2025-11-14 17:30:17 +00:00
|
|
|
|
config: updateConfig
|
2025-11-06 13:12:26 +00:00
|
|
|
|
})
|
|
|
|
|
|
|
2026-02-28 05:22:07 +00:00
|
|
|
|
// 2. 更新完整配置(模型、分块、多模态、存储引擎、知识图谱等)
|
2025-11-06 13:12:26 +00:00
|
|
|
|
const config: KBModelConfigRequest = {
|
|
|
|
|
|
llmModelId: data.summary_model_id,
|
|
|
|
|
|
embeddingModelId: data.embedding_model_id,
|
2025-11-20 12:08:24 +00:00
|
|
|
|
vlm_config: data.vlm_config,
|
2026-04-02 08:43:37 +00:00
|
|
|
|
asr_config: data.asr_config,
|
2025-11-06 13:12:26 +00:00
|
|
|
|
documentSplitting: {
|
|
|
|
|
|
chunkSize: data.chunking_config.chunk_size,
|
|
|
|
|
|
chunkOverlap: data.chunking_config.chunk_overlap,
|
2026-02-28 05:22:07 +00:00
|
|
|
|
separators: data.chunking_config.separators,
|
2026-03-04 12:35:10 +00:00
|
|
|
|
parserEngineRules: data.chunking_config.parser_engine_rules || undefined,
|
|
|
|
|
|
enableParentChild: data.chunking_config.enable_parent_child || false,
|
2026-03-05 07:04:08 +00:00
|
|
|
|
parentChunkSize: data.chunking_config.parent_chunk_size || 4096,
|
2026-05-02 20:40:07 +00:00
|
|
|
|
childChunkSize: data.chunking_config.child_chunk_size || 384,
|
2026-05-03 07:01:20 +00:00
|
|
|
|
// Always send strategy / tokenLimit / languages — backend treats
|
|
|
|
|
|
// empty/0/[] as a valid clear, so we must include them in the
|
|
|
|
|
|
// payload to let users reset back to defaults.
|
|
|
|
|
|
strategy: formData.value?.chunkingConfig.strategy ?? '',
|
|
|
|
|
|
tokenLimit: formData.value?.chunkingConfig.tokenLimit ?? 0,
|
|
|
|
|
|
languages: formData.value?.chunkingConfig.languages ?? []
|
2025-11-06 13:12:26 +00:00
|
|
|
|
},
|
|
|
|
|
|
multimodal: {
|
2026-02-28 05:22:07 +00:00
|
|
|
|
enabled: !!data.vlm_config?.enabled
|
2025-11-06 13:12:26 +00:00
|
|
|
|
},
|
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
2026-04-01 07:37:13 +00:00
|
|
|
|
storageProvider: data.storage_provider_config?.provider || data.storage_config?.provider || 'local',
|
2025-11-06 13:12:26 +00:00
|
|
|
|
nodeExtract: {
|
|
|
|
|
|
enabled: data.extract_config?.enabled || false,
|
|
|
|
|
|
text: data.extract_config?.text || '',
|
|
|
|
|
|
tags: data.extract_config?.tags || [],
|
2025-11-25 08:44:44 +00:00
|
|
|
|
nodes: data.extract_config?.nodes || [],
|
|
|
|
|
|
relations: data.extract_config?.relations || []
|
2025-12-02 17:42:31 +00:00
|
|
|
|
},
|
|
|
|
|
|
questionGeneration: {
|
|
|
|
|
|
enabled: data.question_generation_config?.enabled || false,
|
|
|
|
|
|
questionCount: data.question_generation_config?.question_count || 3
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await updateKBConfig(props.kbId, config)
|
2025-11-13 11:34:33 +00:00
|
|
|
|
MessagePlugin.success(t('knowledgeEditor.messages.updateSuccess'))
|
2026-04-20 11:16:46 +00:00
|
|
|
|
|
|
|
|
|
|
// Check if indexing strategy changed and offer rebuild
|
|
|
|
|
|
if (hasFiles.value && initialIndexingStrategy.value && formData.value) {
|
|
|
|
|
|
const curr = formData.value.indexingStrategy
|
|
|
|
|
|
const prev = initialIndexingStrategy.value
|
|
|
|
|
|
const strategyChanged = (
|
|
|
|
|
|
curr.vectorEnabled !== prev.vectorEnabled ||
|
|
|
|
|
|
curr.keywordEnabled !== prev.keywordEnabled ||
|
|
|
|
|
|
curr.wikiEnabled !== prev.wikiEnabled ||
|
|
|
|
|
|
curr.graphEnabled !== prev.graphEnabled
|
|
|
|
|
|
)
|
|
|
|
|
|
if (strategyChanged) {
|
|
|
|
|
|
const dialog = DialogPlugin.confirm({
|
|
|
|
|
|
header: t('knowledgeEditor.indexing.rebuildConfirmTitle'),
|
|
|
|
|
|
body: t('knowledgeEditor.indexing.rebuildConfirmBody', { count: '...' }),
|
|
|
|
|
|
confirmBtn: t('common.confirm'),
|
|
|
|
|
|
cancelBtn: t('common.cancel'),
|
|
|
|
|
|
onConfirm: async () => {
|
|
|
|
|
|
dialog.destroy()
|
|
|
|
|
|
try {
|
|
|
|
|
|
const result: any = await rebuildKBIndex(props.kbId!)
|
|
|
|
|
|
const count = result?.data?.document_count ?? 0
|
|
|
|
|
|
MessagePlugin.success(t('knowledgeEditor.indexing.rebuildSuccess', { count }))
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
console.error('Rebuild index failed:', e)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
onCancel: () => {
|
|
|
|
|
|
dialog.destroy()
|
|
|
|
|
|
MessagePlugin.info(t('knowledgeEditor.indexing.rebuildSkip'))
|
|
|
|
|
|
},
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
emit('success', props.kbId)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
handleClose()
|
|
|
|
|
|
} catch (error: any) {
|
2025-11-13 11:34:33 +00:00
|
|
|
|
console.error('Knowledge base operation failed:', error)
|
|
|
|
|
|
MessagePlugin.error(error?.message || t('common.operationFailed'))
|
2025-11-06 13:12:26 +00:00
|
|
|
|
} finally {
|
|
|
|
|
|
saving.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 重置所有状态
|
|
|
|
|
|
const resetState = () => {
|
|
|
|
|
|
currentSection.value = 'basic'
|
|
|
|
|
|
formData.value = null
|
|
|
|
|
|
hasFiles.value = false
|
2026-03-09 12:27:24 +00:00
|
|
|
|
initialStorageProvider.value = ''
|
2026-04-20 11:16:46 +00:00
|
|
|
|
initialIndexingStrategy.value = null
|
2025-11-06 13:12:26 +00:00
|
|
|
|
saving.value = false
|
|
|
|
|
|
loading.value = false
|
2026-04-23 03:21:28 +00:00
|
|
|
|
chunkingDirty.value = false
|
2026-05-15 09:56:58 +00:00
|
|
|
|
kbCreatorId.value = ''
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 关闭弹窗
|
|
|
|
|
|
const handleClose = () => {
|
|
|
|
|
|
emit('update:visible', false)
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
resetState()
|
|
|
|
|
|
}, 300)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 监听弹窗打开/关闭
|
|
|
|
|
|
watch(() => props.visible, async (newVal) => {
|
|
|
|
|
|
if (newVal) {
|
|
|
|
|
|
// 打开弹窗时,先重置状态
|
|
|
|
|
|
resetState()
|
|
|
|
|
|
|
2025-11-07 08:40:53 +00:00
|
|
|
|
// 检查是否有初始 section,如果有则跳转
|
|
|
|
|
|
if (uiStore.kbEditorInitialSection) {
|
|
|
|
|
|
currentSection.value = uiStore.kbEditorInitialSection
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
// 加载模型列表
|
|
|
|
|
|
await loadAllModels()
|
|
|
|
|
|
|
|
|
|
|
|
// 根据模式加载数据
|
|
|
|
|
|
if (props.mode === 'edit' && props.kbId) {
|
|
|
|
|
|
await loadKBData()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// 创建模式:初始化空表单
|
2025-11-14 17:30:17 +00:00
|
|
|
|
formData.value = initFormData(props.initialType || 'document')
|
2025-11-06 13:12:26 +00:00
|
|
|
|
hasFiles.value = false
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// 关闭弹窗时,延迟重置状态(等待动画结束)
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
resetState()
|
2025-11-07 08:40:53 +00:00
|
|
|
|
currentSection.value = 'basic' // 重置为默认 section
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}, 300)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2025-11-14 04:09:52 +00:00
|
|
|
|
|
|
|
|
|
|
// 监听全局设置弹窗关闭后刷新模型列表
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => uiStore.showSettingsModal,
|
|
|
|
|
|
async (visible, previous) => {
|
|
|
|
|
|
if (!visible && previous && props.visible) {
|
|
|
|
|
|
await loadAllModels()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
2025-11-06 13:12:26 +00:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
|
|
|
// 复用创建知识库的样式
|
|
|
|
|
|
.settings-overlay {
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
background: rgba(0, 0, 0, 0.5);
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
z-index: 1000;
|
|
|
|
|
|
backdrop-filter: blur(4px);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.settings-modal {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
width: 90vw;
|
2026-03-27 07:02:40 +00:00
|
|
|
|
max-width: 1000px;
|
2025-11-06 13:12:26 +00:00
|
|
|
|
height: 85vh;
|
|
|
|
|
|
max-height: 750px;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
background: var(--td-bg-color-container);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
border-radius: 12px;
|
|
|
|
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.close-btn {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 20px;
|
|
|
|
|
|
right: 20px;
|
|
|
|
|
|
width: 32px;
|
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
border: none;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
background: var(--td-bg-color-secondarycontainer);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
color: var(--td-text-color-secondary);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
transition: all 0.2s ease;
|
|
|
|
|
|
z-index: 10;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2026-03-05 03:19:36 +00:00
|
|
|
|
background: var(--td-bg-color-secondarycontainer);
|
|
|
|
|
|
color: var(--td-text-color-primary);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.settings-container {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.settings-sidebar {
|
|
|
|
|
|
width: 200px;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
background: var(--td-bg-color-settings-modal);
|
|
|
|
|
|
border-right: 1px solid var(--td-component-stroke);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sidebar-header {
|
|
|
|
|
|
padding: 24px 20px;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
border-bottom: 1px solid var(--td-component-stroke);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sidebar-title {
|
|
|
|
|
|
margin: 0;
|
2026-05-02 08:06:56 +00:00
|
|
|
|
font-family: var(--app-font-family);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
font-weight: 600;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
color: var(--td-text-color-primary);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.settings-nav {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
padding: 12px 8px;
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.nav-item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
padding: 10px 12px;
|
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: all 0.2s ease;
|
2026-05-02 08:06:56 +00:00
|
|
|
|
font-family: var(--app-font-family);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
font-size: 14px;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
color: var(--td-text-color-secondary);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2026-03-05 03:19:36 +00:00
|
|
|
|
background: var(--td-bg-color-secondarycontainer-hover);
|
|
|
|
|
|
color: var(--td-text-color-primary);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.active {
|
2026-03-05 03:19:36 +00:00
|
|
|
|
background: var(--td-brand-color-light);
|
|
|
|
|
|
color: var(--td-brand-color);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.nav-icon {
|
|
|
|
|
|
margin-right: 8px;
|
2025-11-06 15:13:13 +00:00
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.nav-label {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-30 05:32:39 +00:00
|
|
|
|
.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;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
.settings-content {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.content-wrapper {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
padding: 24px 32px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.section {
|
|
|
|
|
|
margin-bottom: 32px;
|
|
|
|
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.section-content {
|
|
|
|
|
|
.section-header {
|
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.section-title {
|
|
|
|
|
|
margin: 0 0 8px 0;
|
2026-05-02 08:06:56 +00:00
|
|
|
|
font-family: var(--app-font-family);
|
2026-03-27 07:02:40 +00:00
|
|
|
|
font-size: 20px;
|
2025-11-06 13:12:26 +00:00
|
|
|
|
font-weight: 600;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
color: var(--td-text-color-primary);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.section-desc {
|
|
|
|
|
|
margin: 0;
|
2026-05-02 08:06:56 +00:00
|
|
|
|
font-family: var(--app-font-family);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
font-size: 14px;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
color: var(--td-text-color-placeholder);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
line-height: 22px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.section-body {
|
2026-03-05 03:19:36 +00:00
|
|
|
|
background: var(--td-bg-color-container);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-item {
|
2026-04-20 11:16:46 +00:00
|
|
|
|
margin-bottom: 16px;
|
2025-11-06 13:12:26 +00:00
|
|
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.form-label {
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
margin-bottom: 8px;
|
2026-05-02 08:06:56 +00:00
|
|
|
|
font-family: var(--app-font-family);
|
2026-03-27 07:02:40 +00:00
|
|
|
|
font-size: 15px;
|
2025-11-06 13:12:26 +00:00
|
|
|
|
font-weight: 500;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
color: var(--td-text-color-primary);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
|
|
|
|
|
|
&.required::after {
|
|
|
|
|
|
content: '*';
|
2026-03-05 03:19:36 +00:00
|
|
|
|
color: var(--td-error-color);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
margin-left: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-14 17:30:17 +00:00
|
|
|
|
.form-tip {
|
|
|
|
|
|
margin-top: 6px;
|
|
|
|
|
|
font-size: 12px;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
color: var(--td-text-color-placeholder);
|
2025-11-14 17:30:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-22 12:27:19 +00:00
|
|
|
|
.granularity-radio-group {
|
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.granularity-hint {
|
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
|
line-height: 1.6;
|
|
|
|
|
|
color: var(--td-text-color-secondary);
|
|
|
|
|
|
white-space: normal;
|
|
|
|
|
|
word-break: break-word;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-20 11:16:46 +00:00
|
|
|
|
.indexing-checks {
|
2026-04-20 13:54:54 +00:00
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.indexing-check-item {
|
2026-04-20 11:16:46 +00:00
|
|
|
|
display: flex;
|
2026-04-20 13:54:54 +00:00
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 6px;
|
|
|
|
|
|
padding: 12px 14px;
|
|
|
|
|
|
border: 1px solid var(--td-component-stroke);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
background: var(--td-bg-color-container);
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
user-select: none;
|
|
|
|
|
|
transition: border-color 0.2s ease, background 0.2s ease;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--td-brand-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.is-checked {
|
|
|
|
|
|
border-color: var(--td-brand-color);
|
|
|
|
|
|
background: var(--td-brand-color-light);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-21 06:46:41 +00:00
|
|
|
|
&.is-disabled {
|
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: var(--td-component-stroke);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.is-checked:hover {
|
|
|
|
|
|
border-color: var(--td-brand-color);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-20 13:54:54 +00:00
|
|
|
|
:deep(.t-checkbox__label) {
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
color: var(--td-text-color-primary);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-21 06:46:41 +00:00
|
|
|
|
.locked-tip {
|
|
|
|
|
|
color: var(--td-warning-color);
|
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-20 13:54:54 +00:00
|
|
|
|
// 禁用内部 checkbox 自身的点击事件,统一由卡片处理
|
|
|
|
|
|
.indexing-check-box {
|
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.indexing-check-title {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 6px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.indexing-new-badge {
|
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
padding: 0 6px;
|
|
|
|
|
|
height: 16px;
|
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
line-height: 1;
|
|
|
|
|
|
letter-spacing: 0.4px;
|
|
|
|
|
|
color: var(--td-brand-color);
|
|
|
|
|
|
background: var(--td-brand-color-light);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.indexing-check-desc {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding-left: 24px;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
line-height: 18px;
|
|
|
|
|
|
color: var(--td-text-color-placeholder);
|
2026-04-20 11:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-14 17:30:17 +00:00
|
|
|
|
.faq-guide {
|
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
|
padding: 12px 16px;
|
|
|
|
|
|
border-radius: 8px;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
background: var(--td-bg-color-secondarycontainer);
|
|
|
|
|
|
color: var(--td-text-color-secondary);
|
2025-11-14 17:30:17 +00:00
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
line-height: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 13:12:26 +00:00
|
|
|
|
.settings-footer {
|
|
|
|
|
|
padding: 16px 32px;
|
2026-03-05 03:19:36 +00:00
|
|
|
|
border-top: 1px solid var(--td-component-stroke);
|
2025-11-06 13:12:26 +00:00
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 过渡动画
|
|
|
|
|
|
.modal-enter-active,
|
|
|
|
|
|
.modal-leave-active {
|
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.modal-enter-from,
|
|
|
|
|
|
.modal-leave-to {
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
|
|
|
|
|
|
.settings-modal {
|
|
|
|
|
|
transform: scale(0.95);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-11-14 17:30:17 +00:00
|
|
|
|
|
2026-03-11 13:16:23 +00:00
|
|
|
|
// 多模态配置内联样式(与子组件 KBStorageSettings/KBAdvancedSettings 一致)
|
|
|
|
|
|
.kb-multimodal-settings {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
.section-header {
|
|
|
|
|
|
margin-bottom: 32px;
|
|
|
|
|
|
|
|
|
|
|
|
h2 {
|
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: var(--td-text-color-primary);
|
|
|
|
|
|
margin: 0 0 8px 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.section-description {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: var(--td-text-color-secondary);
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.settings-group {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.setting-row {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
padding: 20px 0;
|
|
|
|
|
|
border-bottom: 1px solid var(--td-component-stroke);
|
|
|
|
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.setting-info {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
max-width: 65%;
|
|
|
|
|
|
padding-right: 24px;
|
|
|
|
|
|
|
|
|
|
|
|
label {
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
color: var(--td-text-color-primary);
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.desc {
|
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
color: var(--td-text-color-secondary);
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.setting-control {
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
min-width: 280px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.required {
|
|
|
|
|
|
color: var(--td-error-color);
|
|
|
|
|
|
margin-left: 2px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-11-06 13:12:26 +00:00
|
|
|
|
</style>
|
|
|
|
|
|
|