diff --git a/src/components/admin/IndexManagerTab.tsx b/src/components/admin/IndexManagerTab.tsx index 3e63682..6aae3b6 100644 --- a/src/components/admin/IndexManagerTab.tsx +++ b/src/components/admin/IndexManagerTab.tsx @@ -24,7 +24,7 @@ import { Typography, } from '@mui/material'; import { useState } from 'react'; -import { getFeatureById } from '@/utils/featureConfig'; +import { getFeatureById, getIndexTypes } from '@/utils/featureConfig'; import ConfirmDialog from './ConfirmDialog'; type IndexManagerTabProps = { @@ -32,14 +32,6 @@ type IndexManagerTabProps = { onRefresh: () => void; }; -const INDEX_TYPES = [ - { value: 'BTREE', label: 'B-Tree (Default)', description: 'General purpose, balanced tree index' }, - { value: 'HASH', label: 'Hash', description: 'Fast equality searches' }, - { value: 'GIN', label: 'GIN', description: 'Generalized Inverted Index for full-text search' }, - { value: 'GIST', label: 'GiST', description: 'Generalized Search Tree for geometric data' }, - { value: 'BRIN', label: 'BRIN', description: 'Block Range Index for very large tables' }, -]; - export default function IndexManagerTab({ tables, onRefresh, @@ -62,6 +54,7 @@ export default function IndexManagerTab({ const [deleteIndex, setDeleteIndex] = useState(null); const feature = getFeatureById('index-management'); + const INDEX_TYPES = getIndexTypes(); // Fetch indexes for selected table const fetchIndexes = async (tableName: string) => { diff --git a/src/components/admin/QueryBuilderTab.tsx b/src/components/admin/QueryBuilderTab.tsx index b875675..a2319ce 100644 --- a/src/components/admin/QueryBuilderTab.tsx +++ b/src/components/admin/QueryBuilderTab.tsx @@ -17,6 +17,7 @@ import { Typography, } from '@mui/material'; import { useState } from 'react'; +import { getQueryOperators } from '@/utils/featureConfig'; import DataGrid from './DataGrid'; type QueryBuilderTabProps = { @@ -30,19 +31,6 @@ type WhereCondition = { value: string; }; -const OPERATORS = [ - { value: '=', label: 'Equals' }, - { value: '!=', label: 'Not Equals' }, - { value: '>', label: 'Greater Than' }, - { value: '<', label: 'Less Than' }, - { value: '>=', label: 'Greater or Equal' }, - { value: '<=', label: 'Less or Equal' }, - { value: 'LIKE', label: 'Like (Pattern Match)' }, - { value: 'IN', label: 'In List' }, - { value: 'IS NULL', label: 'Is Null' }, - { value: 'IS NOT NULL', label: 'Is Not Null' }, -]; - export default function QueryBuilderTab({ tables, onExecuteQuery, @@ -60,6 +48,9 @@ export default function QueryBuilderTab({ const [loading, setLoading] = useState(false); const [error, setError] = useState(''); + // Get operators from configuration + const OPERATORS = getQueryOperators(); + // Fetch columns when table is selected const handleTableChange = async (tableName: string) => { setSelectedTable(tableName);