feat: Redis cluster UI - SchemaSidebar 集群db0锁定 + InstanceItem cluster_mode 字段
This commit is contained in:
1 parent
3af65f2350
commit
c18fc9bd70
3 files changed
+13
-2
No files matched your search
@@ -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,
|
||||
<div className="h-full flex flex-col">
|
||||
{/* DB + Search */}
|
||||
<div className="px-2 py-2 border-b border-[var(--dg-border-light)] space-y-1.5">
|
||||
{clusterMode ? (
|
||||
<div className="px-2 py-1 text-[10px] text-amber-400 bg-amber-500/10 rounded text-center">
|
||||
集群模式 · DB0
|
||||
</div>
|
||||
) : (
|
||||
<select
|
||||
value={redisDb}
|
||||
onChange={(e) => { setRedisDb(Number(e.target.value)); }}
|
||||
@@ -626,6 +633,7 @@ export default function SchemaSidebar({ instanceId, database, dbType, onInsert,
|
||||
<option key={i} value={i}>DB{i}</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
<div className="relative">
|
||||
<Search className="absolute left-2 top-1/2 -translate-y-1/2 w-3 h-3 text-[var(--dg-text-muted)]" />
|
||||
<input
|
||||
|
||||
Reference in new issue
Block a user