diff --git a/web/src/components/DatabaseHeader.vue b/web/src/components/DatabaseHeader.vue deleted file mode 100644 index 66090438..00000000 --- a/web/src/components/DatabaseHeader.vue +++ /dev/null @@ -1,156 +0,0 @@ - - - - - diff --git a/web/src/components/FileTable.vue b/web/src/components/FileTable.vue index 08c11bfa..ac262f2d 100644 --- a/web/src/components/FileTable.vue +++ b/web/src/components/FileTable.vue @@ -1,23 +1,8 @@ - - - @@ -264,7 +208,6 @@ row-key="file_id" class="my-table" size="small" - :show-header="false" :pagination="tablePagination" @change="handleTableChange" v-model:expandedRowKeys="expandedRowKeys" @@ -295,85 +238,56 @@ {{ record.filename }} - - - - - {{ record.displayName || text }} - - + + + {{ record.displayName || text }} + {{ text?.toUpperCase() }} -
+
+ + {{ record.is_folder ? '-' : formatStandardTime(text) }} + +
{ - sortField.value = e.key - // 排序变化时重置到第一页 - paginationConfig.value.current = 1 -} - const handleStatusMenuClick = (e) => { statusFilter.value = e.key // 状态筛选变化时重置到第一页 @@ -538,15 +436,6 @@ const getStatusText = (status) => { return map[status] || status } -const props = defineProps({ - rightPanelVisible: { - type: Boolean, - default: true - } -}) - -const emit = defineEmits(['showAddFilesModal', 'toggleRightPanel']) - const files = computed(() => Object.values(store.database.files || {})) const refreshing = computed(() => store.state.refrashing) const lock = computed(() => store.state.lock) @@ -561,11 +450,6 @@ const selectedRowKeys = computed({ const isSelectionMode = ref(false) const overflowMenuOpen = ref(false) -const currentSortLabel = computed(() => { - const opt = sortOptions.find((o) => o.value === sortField.value) - return opt ? opt.label : '' -}) - const currentStatusLabel = computed(() => { if (statusFilter.value === 'all') return '' const opt = statusOptions.find((o) => o.value === statusFilter.value) @@ -643,6 +527,10 @@ const showCreateFolderModal = (parentId = null) => { createFolderModalVisible.value = true } +defineExpose({ + showCreateFolderModal +}) + const toggleExpand = (record) => { if (!record.is_folder) return @@ -843,8 +731,7 @@ const columnsCompact = [ title: '状态', dataIndex: 'status', key: 'status', - width: 60, - align: 'right', + width: 90, sorter: (a, b) => { const statusOrder = { done: 1, @@ -863,7 +750,15 @@ const columnsCompact = [ }, sortDirections: ['ascend', 'descend'] }, - { title: '', key: 'action', dataIndex: 'file_id', width: 40, align: 'center' } + { + title: '时间', + dataIndex: 'created_at', + key: 'created_at', + width: 180, + sorter: (a, b) => new Date(b.created_at || 0) - new Date(a.created_at || 0), + sortDirections: ['ascend', 'descend'] + }, + { title: '操作', key: 'action', dataIndex: 'file_id', width: 64, align: 'center' } ] // 构建文件树 @@ -963,27 +858,7 @@ const buildFileTree = (fileList) => { if (a.is_folder && !b.is_folder) return -1 if (!a.is_folder && b.is_folder) return 1 - if (sortField.value === 'filename') { - return (a.filename || '').localeCompare(b.filename || '') - } else if (sortField.value === 'created_at') { - return new Date(b.created_at || 0) - new Date(a.created_at || 0) - } else if (sortField.value === 'status') { - const statusOrder = { - done: 1, - indexed: 1, - processing: 2, - indexing: 2, - parsing: 2, - waiting: 3, - uploaded: 3, - parsed: 3, - failed: 4, - error_indexing: 4, - error_parsing: 4 - } - return (statusOrder[a.status] || 5) - (statusOrder[b.status] || 5) - } - return 0 + return (a.filename || '').localeCompare(b.filename || '') }) nodes.forEach((node) => { if (node.children) sortNodes(node.children) @@ -1056,21 +931,12 @@ const canBatchIndex = computed(() => { }) }) -const showAddFilesModal = (options = {}) => { - emit('showAddFilesModal', options) -} - const handleRefresh = () => { // 刷新时重置分页 paginationConfig.value.current = 1 store.getDatabaseInfo(undefined, true) // Skip query params for manual refresh } -const toggleRightPanel = () => { - console.log(props.rightPanelVisible) - emit('toggleRightPanel') -} - const onSelectChange = (keys, selectedRows) => { // 只保留非文件夹的文件ID const fileKeys = selectedRows.filter((row) => !row.is_folder).map((row) => row.file_id) @@ -1304,7 +1170,7 @@ const handleIndexConfigCancel = () => { } // 导入工具函数 -import { getFileIcon, getFileIconColor, formatRelativeTime } from '@/utils/file_utils' +import { getFileIcon, getFileIconColor, formatStandardTime } from '@/utils/file_utils' import { buildChunkParamsPayload, isPlainObject } from '@/utils/chunk_presets' import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue' @@ -1328,22 +1194,25 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue' justify-content: space-between; align-items: center; flex-shrink: 0; - padding: 8px 8px; + padding: 12px; } .panel-actions { + width: 100%; display: flex; align-items: center; - gap: 6px; + gap: 8px; .panel-actions-default { display: flex; align-items: center; gap: 6px; + margin-left: auto; } .overflow-trigger { display: none; + margin-left: auto; } .action-searcher { @@ -1412,7 +1281,7 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue' background-color: transparent; min-height: 0; table-layout: fixed; - padding-left: 4px; + padding: 0 8px; } .my-table .main-btn { @@ -1461,6 +1330,44 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue' height: 16px; } +.file-status-cell { + display: inline-flex; + align-items: center; + gap: 6px; + color: var(--gray-700); + white-space: nowrap; +} + +.file-status-icon { + display: inline-flex; + align-items: center; +} + +.status-success { + color: var(--color-success-500); +} + +.status-error { + color: var(--color-error-500); +} + +.status-info { + color: var(--color-info-500); +} + +.status-warning { + color: var(--color-warning-500); +} + +.status-primary { + color: var(--color-primary-500); +} + +.file-time-cell { + color: var(--gray-600); + white-space: nowrap; +} + .my-table .rechunk-btn:hover { color: var(--color-warning-500); } @@ -1592,21 +1499,6 @@ import ChunkParamsConfig from '@/components/ChunkParamsConfig.vue' } } -.upload-btn-group { - display: flex; - align-items: center; - gap: 8px; - - .upload-btn { - height: 28px; - font-size: 13px; - display: flex; - padding: 0 12px; - align-items: center; - justify-content: center; - gap: 4px; - } -} diff --git a/web/src/components/QuerySection.vue b/web/src/components/QuerySection.vue index 06f6bbdb..24fc312d 100644 --- a/web/src/components/QuerySection.vue +++ b/web/src/components/QuerySection.vue @@ -384,11 +384,10 @@ defineExpose({ } .query-input-container { - padding: 16px; + padding-bottom: 16px; display: flex; flex-direction: column; gap: 12px; - background-color: var(--gray-0); } .search-input-wrapper { @@ -512,7 +511,7 @@ defineExpose({ } .result-list { - padding: 16px; + // padding: 16px; .no-results { text-align: center; diff --git a/web/src/views/DataBaseInfoView.vue b/web/src/views/DataBaseInfoView.vue index 1b178876..98fc05da 100644 --- a/web/src/views/DataBaseInfoView.vue +++ b/web/src/views/DataBaseInfoView.vue @@ -1,14 +1,7 @@