From ea5638f910e7b83115115e054568cde15f7960ee Mon Sep 17 00:00:00 2001 From: Anton Standrik Date: Wed, 10 Sep 2025 17:42:21 +0300 Subject: [PATCH] fix: vector index fixes --- .../InfoViewer/schemaInfo/TableIndexInfo.tsx | 22 ++++++++++--------- src/components/InfoViewer/schemaInfo/utils.ts | 1 + src/types/api/schema/tableIndex.ts | 4 ++-- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/InfoViewer/schemaInfo/TableIndexInfo.tsx b/src/components/InfoViewer/schemaInfo/TableIndexInfo.tsx index 8a2bf771ae..83ff559cfc 100644 --- a/src/components/InfoViewer/schemaInfo/TableIndexInfo.tsx +++ b/src/components/InfoViewer/schemaInfo/TableIndexInfo.tsx @@ -1,6 +1,7 @@ import type {InfoViewerItem} from '..'; import {InfoViewer} from '..'; import {getEntityName} from '../../../containers/Tenant/utils'; +import {EIndexType} from '../../../types/api/schema'; import type {TEvDescribeSchemeResult} from '../../../types/api/schema'; import i18n from './i18n'; @@ -22,16 +23,17 @@ export const TableIndexInfo = ({data}: TableIndexInfoProps) => { const vectorSettings = TableIndex?.VectorIndexKmeansTreeDescription?.Settings; - if (!vectorSettings) { - return ; - } + const isVectorIndex = TableIndex?.Type === EIndexType.EIndexTypeGlobalVectorKmeansTree; - const vectorInfo: Array = buildVectorIndexInfo(vectorSettings); + if (isVectorIndex) { + const vectorInfo: Array = buildVectorIndexInfo(vectorSettings); + return ( + <> + + + + ); + } - return ( - <> - - - - ); + return ; }; diff --git a/src/components/InfoViewer/schemaInfo/utils.ts b/src/components/InfoViewer/schemaInfo/utils.ts index b765e98912..8918b5ef95 100644 --- a/src/components/InfoViewer/schemaInfo/utils.ts +++ b/src/components/InfoViewer/schemaInfo/utils.ts @@ -61,6 +61,7 @@ export function buildVectorIndexInfo(vectorSettings?: VectorSettings): InfoViewe const settingsFormatter = createInfoFormatter({ values: { vector_dimension: (v) => (typeof v === 'number' ? formatNumber(v) : v), + vector_type: (v) => (typeof v === 'string' ? v.replace(/^VECTOR_TYPE_/, '') : v), }, labels: { vector_dimension: i18n('field_vector-dimension'), diff --git a/src/types/api/schema/tableIndex.ts b/src/types/api/schema/tableIndex.ts index 2a6f6b56b2..20cd3be8d6 100644 --- a/src/types/api/schema/tableIndex.ts +++ b/src/types/api/schema/tableIndex.ts @@ -26,14 +26,14 @@ export interface TIndexDescription { VectorIndexKmeansTreeDescription?: TVectorIndexKmeansTreeDescription; } -enum EIndexType { +export enum EIndexType { EIndexTypeInvalid = 'EIndexTypeInvalid', EIndexTypeGlobal = 'EIndexTypeGlobal', EIndexTypeGlobalAsync = 'EIndexTypeGlobalAsync', EIndexTypeGlobalVectorKmeansTree = 'EIndexTypeGlobalVectorKmeansTree', } -enum EIndexState { +export enum EIndexState { EIndexStateInvalid = 'EIndexStateInvalid', EIndexStateReady = 'EIndexStateReady', EIndexStateNotReady = 'EIndexStateNotReady',