diff --git a/frontend/src/components/SchemaSidebar.tsx b/frontend/src/components/SchemaSidebar.tsx index b6fc431..9f9e41c 100644 --- a/frontend/src/components/SchemaSidebar.tsx +++ b/frontend/src/components/SchemaSidebar.tsx @@ -14,6 +14,8 @@ interface Props { instanceId: string; database: string; dbType: string; + /** Redis 集群模式为 true */ + clusterMode?: boolean; onInsert: (text: string) => void; onDatabaseChange?: (db: string) => void; /** 为 true 时只显示当前选中的库,不允许切换(数据变更场景防误操作) */ @@ -193,7 +195,7 @@ function formatTTL(ttl: number): string { /* COMPONENT */ /* ================================================================== */ -export default function SchemaSidebar({ instanceId, database, dbType, onInsert, onDatabaseChange, singleDb }: Props) { +export default function SchemaSidebar({ instanceId, database, dbType, clusterMode, onInsert, onDatabaseChange, singleDb }: Props) { const isMySQL = dbType === 'mysql' || dbType === 'postgres' || dbType === 'postgresql'; const isRedis = dbType === 'redis'; @@ -617,6 +619,11 @@ export default function SchemaSidebar({ instanceId, database, dbType, onInsert,
{/* DB + Search */}
+ {clusterMode ? ( +
+ 集群模式 · DB0 +
+ ) : ( + )}
([]); const [loadingDbs, setLoadingDbs] = useState(false); - const [instances, setInstances] = useState>([]); + const [instances, setInstances] = useState>([]); const [editorSchema, setEditorSchema] = useState>>({}); const [executing, setExecuting] = useState(false); const [error, setError] = useState(''); @@ -432,6 +432,7 @@ export default function QueriesPage() { {showSidebar && instanceId && (
{ const sep = dbType === 'redis' ? (sql.trim() ? '\n' : '') : (sql.trim() ? ' ' : ''); setSql(prev => prev + sep + text + (dbType === 'redis' ? '' : ' ')); diff --git a/frontend/src/pages/TicketCreatePage.tsx b/frontend/src/pages/TicketCreatePage.tsx index ebb620b..836de7f 100644 --- a/frontend/src/pages/TicketCreatePage.tsx +++ b/frontend/src/pages/TicketCreatePage.tsx @@ -19,6 +19,7 @@ interface InstanceItem { host: string; port: number; db_type: string; + cluster_mode?: boolean; } interface AuditFinding { @@ -350,6 +351,7 @@ export default function TicketCreatePage() { {showBrowser && instanceId && (
)}