feat: update connection URL parameters handling for Doris and StarRocks databases; improve UI element heights and add localization for edit action

This commit is contained in:
t8y2 2026-05-01 09:22:11 +08:00
parent 4c4f5de6d8
commit f5ef4fe6ce
5 changed files with 12 additions and 6 deletions

View File

@ -186,7 +186,7 @@ impl ConnectionConfig {
fn normalized_url_params(&self) -> String {
let value = self.url_params.as_deref().unwrap_or("").trim();
match self.db_type {
DatabaseType::Mysql | DatabaseType::Doris | DatabaseType::StarRocks => {
DatabaseType::Mysql => {
let base = "ssl-mode=preferred&charset=utf8mb4";
if value.is_empty() {
base.to_string()
@ -198,6 +198,10 @@ impl ConnectionConfig {
if v.contains("charset=") { format!("ssl-mode=preferred&{v}") } else { format!("{base}&{v}") }
}
}
DatabaseType::Doris | DatabaseType::StarRocks => {
let v = value.trim_start_matches('?');
if v.is_empty() { "ssl-mode=disabled".to_string() } else { v.to_string() }
}
DatabaseType::Postgres | DatabaseType::Redshift => value.trim_start_matches('?').to_string(),
_ => value.trim_start_matches('?').to_string(),
}

View File

@ -322,7 +322,7 @@ onMounted(load);
<!-- Document list (left) -->
<Pane :size="30" :min-size="15" :max-size="50">
<div class="h-full flex flex-col overflow-hidden">
<div class="flex items-center gap-1 px-3 py-1.5 border-b shrink-0 text-xs text-muted-foreground">
<div class="h-9 flex items-center gap-1 px-3 border-b shrink-0 text-xs text-muted-foreground">
<span>{{ t('mongo.documents', { count: total }) }}</span>
<span class="flex-1" />
<Button variant="ghost" size="icon" class="h-5 w-5" @click="startNew"><Plus class="h-3 w-3" /></Button>
@ -364,10 +364,10 @@ onMounted(load);
<Pane :size="70">
<div class="h-full flex flex-col min-w-0 overflow-hidden">
<template v-if="selectedIdx !== null || isNew">
<div class="flex items-center gap-2 px-4 py-2 border-b bg-muted/30 shrink-0">
<div class="h-9 flex items-center gap-2 px-4 border-b bg-muted/30 shrink-0">
<Badge variant="secondary" class="text-xs">{{ isNew ? 'New' : selectedDoc?._id }}</Badge>
<span class="flex-1" />
<Button v-if="!isEditing" variant="ghost" size="sm" class="h-6 text-xs" @click="startEdit">Edit</Button>
<Button v-if="!isEditing" variant="ghost" size="sm" class="h-6 text-xs" @click="startEdit">{{ t('mongo.edit') }}</Button>
<template v-if="isEditing">
<Button variant="ghost" size="sm" class="h-6 text-xs" @click="addField">
<Plus class="w-3 h-3 mr-1" /> {{ t('mongo.addField') }}

View File

@ -87,7 +87,7 @@ onMounted(loadKeys);
<Pane :size="30" :min-size="15" :max-size="50">
<div class="h-full flex flex-col overflow-hidden">
<!-- Search bar -->
<div class="flex items-center gap-1 px-2 py-1.5 border-b shrink-0">
<div class="h-9 flex items-center gap-1 px-2 border-b shrink-0">
<Search class="w-3.5 h-3.5 text-muted-foreground shrink-0" />
<Input
v-model="searchPattern"
@ -102,7 +102,7 @@ onMounted(loadKeys);
</div>
<!-- Key count -->
<div class="px-3 py-1 text-xs text-muted-foreground border-b shrink-0">
<div class="h-9 flex items-center px-3 text-xs text-muted-foreground border-b shrink-0">
{{ loading && keys.length === 0 ? t('redis.loadingKeys') : t('redis.keys', { count: keys.length }) }}
</div>

View File

@ -213,6 +213,7 @@ export default {
readonlyId: "_id is read-only",
invalidJsonValue: "This cell is not a valid JSON value",
duplicateField: "Duplicate field name: {field}",
edit: "Edit",
},
history: {
title: "History",

View File

@ -218,6 +218,7 @@ export default {
readonlyId: "_id 只读",
invalidJsonValue: "当前单元格不是合法 JSON 值",
duplicateField: "字段名重复:{field}",
edit: "编辑",
},
history: {
title: "查询历史",