feat(toolbar): add Compare Databases and Compare Data buttons

Expose Schema Diff and Data Compare dialogs from the top toolbar
so they can be opened without pre-selecting a connection in the
sidebar. Connections are chosen inside the dialog.
This commit is contained in:
t8y2 2026-05-12 17:38:13 +08:00
parent bf58045a28
commit 1380cfe04e
2 changed files with 28 additions and 0 deletions

View File

@ -552,6 +552,8 @@ onUnmounted(() => {
@check-updates="checkUpdates()"
@open-transfer="dialogs.showTransferDialog.value = true"
@open-sql-file="dialogs.showSqlFileDialog.value = true"
@open-schema-diff="dialogs.showSchemaDiffDialog.value = true"
@open-data-compare="dialogs.showDataCompareDialog.value = true"
/>
<div

View File

@ -11,6 +11,8 @@ import {
Bot,
ArrowLeftRight,
FileCode,
GitCompareArrows,
TableProperties,
Settings,
CloudDownload,
} from "lucide-vue-next";
@ -52,6 +54,8 @@ const emit = defineEmits<{
"check-updates": [];
"open-transfer": [];
"open-sql-file": [];
"open-schema-diff": [];
"open-data-compare": [];
}>();
const { t } = useI18n();
@ -110,6 +114,28 @@ function onToolbarDblClick(e: MouseEvent) {
{{ t("sqlFile.title") }}
</Button>
<Button
variant="ghost"
size="sm"
class="h-8 px-2 text-xs gap-1"
@click="emit('open-schema-diff')"
:disabled="!hasConnections"
>
<GitCompareArrows class="h-3.5 w-3.5" />
{{ t("diff.title") }}
</Button>
<Button
variant="ghost"
size="sm"
class="h-8 px-2 text-xs gap-1"
@click="emit('open-data-compare')"
:disabled="!hasConnections"
>
<TableProperties class="h-3.5 w-3.5" />
{{ t("dataCompare.title") }}
</Button>
<div class="flex-1" data-tauri-drag-region />
<Tooltip>