7676 placeholder =" 新建知识库描述"
7777 :auto-size =" { minRows: 5, maxRows: 10 }"
7878 />
79+
80+ <h3 style =" margin-top : 20px ;" >隐私设置</h3 >
81+ <div class =" privacy-config" >
82+ <a-switch
83+ v-model:checked =" newDatabase.is_private"
84+ checked-children =" 私有"
85+ un-checked-children =" 公开"
86+ size =" default"
87+ />
88+ <span style =" margin-left : 12px ;" >设置为私有知识库</span >
89+ <a-tooltip title =" 在部分智能体的设计中,可以根据隐私标志来决定启用什么模型和策略。例如,对于私有知识库,可以选择更严格的数据处理和访问控制策略,以保护敏感信息的安全性和隐私性。" >
90+ <InfoCircleOutlined style =" margin-left : 8px ; color : var (--gray-500 ); cursor : help ;" />
91+ </a-tooltip >
92+ </div >
7993 <template #footer >
8094 <a-button key =" back" @click =" cancelCreateDatabase" >取消</a-button >
8195 <a-button key =" submit" type =" primary" :loading =" state.creating" @click =" createDatabase" >创建</a-button >
104118 :key =" database.db_id"
105119 class =" database dbcard"
106120 @click =" navigateToDatabase(database.db_id)" >
121+ <!-- 私有知识库锁定图标 -->
122+ <LockOutlined
123+ v-if =" database.metadata?.is_private"
124+ class =" private-lock-icon"
125+ title =" 私有知识库"
126+ />
107127 <div class =" top" >
108128 <div class =" icon" >
109129 <component :is =" getKbTypeIcon(database.kb_type || 'lightrag')" />
132152 >
133153 {{ getKbTypeLabel(database.kb_type || 'lightrag') }}
134154 </a-tag >
135- </div >
155+ </div >
136156
137157 <!-- <button @click="deleteDatabase(database.collection_name)">删除</button> -->
138158 </div >
@@ -146,6 +166,7 @@ import { useRouter, useRoute } from 'vue-router';
146166import { useConfigStore } from ' @/stores/config' ;
147167import { message } from ' ant-design-vue'
148168import { BookPlus , Database , Zap , FileDigit , Waypoints , Building2 } from ' lucide-vue-next' ;
169+ import { LockOutlined , InfoCircleOutlined } from ' @ant-design/icons-vue' ;
149170import { databaseApi , typeApi } from ' @/apis/knowledge_api' ;
150171import HeaderComponent from ' @/components/HeaderComponent.vue' ;
151172import ModelSelectorComponent from ' @/components/ModelSelectorComponent.vue' ;
@@ -189,6 +210,7 @@ const emptyEmbedInfo = {
189210 description: '',
190211 embed_model_name: configStore.config?.embed_model,
191212 kb_type: 'chroma', // 默认为 Milvus
213+ is_private: false, // 默认为公开知识库
192214 // Vector 知识库特有配置
193215 storage: '', // 存储方式配置
194216 // LightRAG 特有配置
@@ -391,7 +413,9 @@ const createDatabase = () => {
391413 description: newDatabase.description?.trim() || '',
392414 embed_model_name: newDatabase.embed_model_name || configStore.config.embed_model,
393415 kb_type: newDatabase.kb_type,
394- additional_params: {}
416+ additional_params: {
417+ is_private: newDatabase.is_private || false
418+ }
395419 }
396420
397421 // 添加类型特有的配置
@@ -450,6 +474,12 @@ onMounted(() => {
450474 margin: 12px 0;
451475 }
452476
477+ .privacy-config {
478+ display: flex;
479+ align-items: center;
480+ margin-bottom: 12px;
481+ }
482+
453483 .kb-type-cards {
454484 display: grid;
455485 grid-template-columns: repeat(3, 1fr);
@@ -473,7 +503,6 @@ onMounted(() => {
473503
474504 &:hover {
475505 border-color: var(--main-color);
476- transform: translateY(-1px);
477506 }
478507
479508 // 为不同知识库类型设置不同的悬停颜色
@@ -577,7 +606,7 @@ onMounted(() => {
577606 color: var(--gray-600);
578607 line-height: 1.5;
579608 margin-bottom: 12px;
580- min-height: 40px;
609+ // min-height: 40px;
581610 }
582611
583612 .card-features {
@@ -687,6 +716,19 @@ onMounted(() => {
687716 cursor: pointer;
688717 display: flex;
689718 flex-direction: column;
719+ position: relative; // 为绝对定位的锁定图标提供参考
720+
721+ .private-lock-icon {
722+ position: absolute;
723+ top: 24px;
724+ right: 16px;
725+ color: var(--gray-700);
726+ background: var(--gray-100);
727+ font-size: 12px;
728+ border-radius: 6px;
729+ padding: 5px;
730+ z-index: 1;
731+ }
690732
691733 .top {
692734 display: flex;
0 commit comments