mirror of
https://github.com/t8y2/dbx.git
synced 2026-11-01 00:25:38 +00:00
feat: Redis browser overhaul — Navicat-style table, editing, and pagination
- Unified key table with columns: key, type, value preview, size, TTL - Top-bottom split layout: key table above, value detail below - Virtual scrolling via RecycleScroller for large key sets - ZSet editing: add/remove members with scores - TTL inline editing: click badge to modify expiration - Batch key deletion with checkbox selection - Paginated loading for Hash/Set/ZSet/List values (HSCAN/SSCAN/ZSCAN) - Debounced auto-search (400ms) for key filtering - Value previews fetched during key scan for instant display
This commit is contained in:
@@ -119,3 +119,61 @@ pub async fn redis_set_remove(
|
||||
) -> Result<(), String> {
|
||||
dbx_core::redis_ops::redis_set_remove_in_db_core(&state, &connection_id, db, &key_raw, &member).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn redis_zadd(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
db: u32,
|
||||
key_raw: String,
|
||||
member: String,
|
||||
score: f64,
|
||||
) -> Result<(), String> {
|
||||
dbx_core::redis_ops::redis_zadd_in_db_core(&state, &connection_id, db, &key_raw, &member, score).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn redis_zrem(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
db: u32,
|
||||
key_raw: String,
|
||||
member: String,
|
||||
) -> Result<(), String> {
|
||||
dbx_core::redis_ops::redis_zrem_in_db_core(&state, &connection_id, db, &key_raw, &member).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn redis_set_ttl(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
db: u32,
|
||||
key_raw: String,
|
||||
ttl: i64,
|
||||
) -> Result<(), String> {
|
||||
dbx_core::redis_ops::redis_set_ttl_in_db_core(&state, &connection_id, db, &key_raw, ttl).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn redis_delete_keys(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
db: u32,
|
||||
key_raws: Vec<String>,
|
||||
) -> Result<u64, String> {
|
||||
dbx_core::redis_ops::redis_delete_keys_in_db_core(&state, &connection_id, db, &key_raws).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn redis_load_more(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
db: u32,
|
||||
key_raw: String,
|
||||
key_type: String,
|
||||
cursor: u64,
|
||||
count: usize,
|
||||
) -> Result<RedisValue, String> {
|
||||
dbx_core::redis_ops::redis_load_more_in_db_core(&state, &connection_id, db, &key_raw, &key_type, cursor, count)
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -104,6 +104,11 @@ pub fn run() {
|
||||
commands::redis_cmd::redis_list_remove,
|
||||
commands::redis_cmd::redis_set_add,
|
||||
commands::redis_cmd::redis_set_remove,
|
||||
commands::redis_cmd::redis_zadd,
|
||||
commands::redis_cmd::redis_zrem,
|
||||
commands::redis_cmd::redis_set_ttl,
|
||||
commands::redis_cmd::redis_delete_keys,
|
||||
commands::redis_cmd::redis_load_more,
|
||||
commands::mongo_cmd::mongo_list_databases,
|
||||
commands::mongo_cmd::mongo_list_collections,
|
||||
commands::mongo_cmd::mongo_find_documents,
|
||||
|
||||
Reference in New Issue
Block a user