Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

refactor(grid): show pending count on commit button

t8y2be8cc640e46b
diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue
index 18fcb80071..683d135315 100644
--- a/apps/desktop/src/components/grid/DataGrid.vue
+++ b/apps/desktop/src/components/grid/DataGrid.vue
@@ -5537,13 +5537,6 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
>
<Plus class="w-3 h-3 mr-1" /> {{ t("grid.addRow") }}
</Button>
- <span
- v-if="transactionActive"
- class="flex shrink-0 items-center gap-1 px-1 text-xs text-emerald-600 dark:text-emerald-400"
- >
- <span class="h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse" />
- {{ t("grid.transactionActive") }}
- </span>
<template v-if="saveToolbarState.showActions">
<Tooltip>
<TooltipTrigger as-child>
@@ -5555,6 +5548,12 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
@click="onToolbarCommit"
>
<Loader2 v-if="isSaving" class="w-3 h-3 mr-1 animate-spin" />
+ <span
+ v-else-if="pendingChangeCount > 0"
+ class="mr-1 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-amber-300 px-1 text-[9px] font-semibold leading-none text-amber-950 shadow-[0_0_0_1px_rgba(120,53,15,0.16)] dark:bg-amber-400 dark:text-amber-950"
+ >
+ {{ pendingChangeCount }}
+ </span>
<Save v-else class="w-3 h-3 mr-1" />
{{ t(saveActionMode.labelKey, { count: pendingChangeCount }) }}
</Button>
diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts
index b9f94e0250..6c18ff5b9d 100644
--- a/apps/desktop/src/i18n/locales/en.ts
+++ b/apps/desktop/src/i18n/locales/en.ts
@@ -627,7 +627,6 @@ export default {
transactionSaveHint: "Commit {count} pending change(s) in a transaction.",
nonTransactionalSaveHint:
"Save {count} pending change(s) one by one. If one fails, earlier successful changes will not be rolled back.",
- transactionActive: "Editing",
keylessEditWarning: "No primary key",
keylessEditWarningHint:
"This table has no primary key. Updates and deletes use all original row values in the WHERE clause; exact duplicate rows may be affected together.",
diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.ts
index 0336271e65..b11a288dbc 100644
--- a/apps/desktop/src/i18n/locales/es.ts
+++ b/apps/desktop/src/i18n/locales/es.ts
@@ -581,7 +581,6 @@ export default {
transactionSaveHint: "Confirma {count} cambio(s) pendiente(s) en una transacción.",
nonTransactionalSaveHint:
"Guarda {count} cambio(s) pendiente(s) uno por uno. Si uno falla, los cambios anteriores correctos no se revierten.",
- transactionActive: "Editando",
keylessEditWarning: "Sin clave primaria",
keylessEditWarningHint:
"Esta tabla no tiene clave primaria. Las actualizaciones y eliminaciones usan todos los valores originales de la fila en WHERE; filas duplicadas exactas pueden verse afectadas juntas.",
diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts
index e243022d94..be448aa8e5 100644
--- a/apps/desktop/src/i18n/locales/zh-CN.ts
+++ b/apps/desktop/src/i18n/locales/zh-CN.ts
@@ -621,7 +621,6 @@ export default {
rollback: "回滚",
transactionSaveHint: "在事务中提交 {count} 项待保存更改。",
nonTransactionalSaveHint: "逐条保存 {count} 项更改;如果中途失败,前面已成功的更改不会回滚。",
- transactionActive: "编辑中",
keylessEditWarning: "无主键定位",
keylessEditWarningHint:
"这张表没有主键。保存更新或删除时会使用整行原始值作为 WHERE 条件;如果存在完全重复的行,可能会影响多行。",
diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts
index 84abed0d39..dfe3e9777d 100644
--- a/apps/desktop/src/i18n/locales/zh-TW.ts
+++ b/apps/desktop/src/i18n/locales/zh-TW.ts
@@ -620,7 +620,6 @@ export default {
rollback: "回溯",
transactionSaveHint: "在事務中提交 {count} 項待儲存更改。",
nonTransactionalSaveHint: "逐條儲存 {count} 項更改;如果中途失敗,前面已成功的更改不會回溯。",
- transactionActive: "編輯中",
keylessEditWarning: "無主鍵定位",
keylessEditWarningHint:
"此資料表沒有主鍵。更新與刪除會在 WHERE 子句中使用所有原始資料列值;完全重複的資料列可能會一起受到影響。",