fix(FileTable): 修复自动刷新失效问题并优化按钮样式
修改数据库存储逻辑以支持后台自动刷新时跳过加载状态 更新FileTable组件按钮样式和布局,增加可读性和交互性
This commit is contained in:
parent
c6ddb70909
commit
32f6b5e6e9
@ -18,6 +18,9 @@
|
||||
- 将工具与知识库解耦,在 context 中就完成解耦,虽然最终都是在 Agent 中的 get_tools 中获取
|
||||
- 系统层面添加 apikey,在智能体、知识库调用中支持 apikey 以支持外部调用
|
||||
- 支持更多类型的文档源的导入功能
|
||||
- 支持 markitdown 或者 docling 的功能
|
||||
- 支持设置上传后自动入库(indexing)
|
||||
- 添加对于 lightrag 的结果解析
|
||||
|
||||
### Bugs
|
||||
- 部分异常状态下,智能体的模型名称出现重叠[#279](https://github.com/xerrors/Yuxi-Know/issues/279)
|
||||
@ -28,6 +31,7 @@
|
||||
- 工具传递给模型的时候,使用英文,但部分模型不支持中文函数名(如gpt-4o-mini)
|
||||
- 首页加载的问题
|
||||
- 当前的 upload 图谱查询为同步操作,可能会导致页面卡顿
|
||||
- FileTable 的自动刷新失效
|
||||
|
||||
## v0.5
|
||||
|
||||
|
||||
@ -114,23 +114,25 @@
|
||||
/>
|
||||
<span>{{ selectedRowKeys.length }} 项</span>
|
||||
</div>
|
||||
<div style="display: flex; gap: 4px;">
|
||||
<div style="display: flex; gap: 8px;">
|
||||
<a-button
|
||||
type="link"
|
||||
@click="handleBatchParse"
|
||||
:loading="batchParsing"
|
||||
:disabled="!canBatchParse"
|
||||
:icon="h(FileText, { size: 16 })"
|
||||
title="批量解析"
|
||||
/>
|
||||
>
|
||||
批量解析
|
||||
</a-button>
|
||||
<a-button
|
||||
type="link"
|
||||
@click="handleBatchIndex"
|
||||
:loading="batchIndexing"
|
||||
:disabled="!canBatchIndex"
|
||||
:icon="h(Database, { size: 16 })"
|
||||
title="批量入库"
|
||||
/>
|
||||
>
|
||||
批量入库
|
||||
</a-button>
|
||||
<a-button
|
||||
type="link"
|
||||
danger
|
||||
@ -138,8 +140,9 @@
|
||||
:loading="batchDeleting"
|
||||
:disabled="!canBatchDelete"
|
||||
:icon="h(Trash2, { size: 16 })"
|
||||
title="批量删除"
|
||||
/>
|
||||
>
|
||||
批量删除
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1082,7 +1085,7 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue';
|
||||
.panel-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0px;
|
||||
gap: 4px;
|
||||
|
||||
.action-searcher {
|
||||
width: 120px;
|
||||
@ -1097,7 +1100,7 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue';
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 2px 12px;
|
||||
padding: 4px 12px;
|
||||
background-color: var(--main-10);
|
||||
border-radius: 4px;
|
||||
margin-bottom: 4px;
|
||||
@ -1118,9 +1121,12 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue';
|
||||
|
||||
.batch-actions .ant-btn {
|
||||
font-size: 12px;
|
||||
padding: 0 6px;
|
||||
height: 22px;
|
||||
border-radius: 3px;
|
||||
padding: 4px 8px;
|
||||
height: auto;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
|
||||
svg {
|
||||
width: 14px;
|
||||
@ -1218,8 +1224,7 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue';
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 6px;
|
||||
/* border: 1px solid var(--gray-300); */
|
||||
/* background-color: var(--gray-50); */
|
||||
padding: 0 4px;
|
||||
color: var(--gray-700);
|
||||
transition: all 0.1s ease;
|
||||
font-size: 12px;
|
||||
@ -1251,7 +1256,8 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue';
|
||||
|
||||
.panel-action-btn.active {
|
||||
color: var(--main-color);
|
||||
background-color: var(--main-10);
|
||||
background-color: var(--gray-100);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.action-trigger-btn {
|
||||
|
||||
@ -100,12 +100,14 @@ export const useDatabaseStore = defineStore('database', () => {
|
||||
}
|
||||
}
|
||||
|
||||
async function getDatabaseInfo(id, skipQueryParams = false) {
|
||||
async function getDatabaseInfo(id, skipQueryParams = false, isBackground = false) {
|
||||
const db_id = id || databaseId.value;
|
||||
if (!db_id) return;
|
||||
|
||||
state.lock = true;
|
||||
state.databaseLoading = true;
|
||||
if (!isBackground) {
|
||||
state.lock = true;
|
||||
state.databaseLoading = true;
|
||||
}
|
||||
try {
|
||||
const data = await databaseApi.getDatabaseInfo(db_id);
|
||||
database.value = data;
|
||||
@ -119,8 +121,10 @@ export const useDatabaseStore = defineStore('database', () => {
|
||||
console.error(error);
|
||||
message.error(error.message || '获取数据库信息失败');
|
||||
} finally {
|
||||
state.lock = false;
|
||||
state.databaseLoading = false;
|
||||
if (!isBackground) {
|
||||
state.lock = false;
|
||||
state.databaseLoading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,7 +247,7 @@ export const useDatabaseStore = defineStore('database', () => {
|
||||
});
|
||||
}
|
||||
|
||||
const processingStatuses = new Set(['processing', 'waiting']);
|
||||
const processingStatuses = new Set(['processing', 'waiting', 'parsing', 'indexing']);
|
||||
|
||||
function enableAutoRefresh(source = 'auto') {
|
||||
if (autoRefreshManualOverride && source === 'auto') {
|
||||
@ -469,7 +473,7 @@ export const useDatabaseStore = defineStore('database', () => {
|
||||
function startAutoRefresh() {
|
||||
if (state.autoRefresh && !refreshInterval) {
|
||||
refreshInterval = setInterval(() => {
|
||||
getDatabaseInfo(undefined, true); // Skip loading query params during auto-refresh
|
||||
getDatabaseInfo(undefined, true, true); // Skip loading query params during auto-refresh
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user