fix: swap upload and download icons in various components for consistency
This commit is contained in:
parent
adb8da3ad3
commit
c60b23ffe7
|
|
@ -146,15 +146,15 @@ const activeConfig = computed(() => props.configs.find((c) => c.id === props.act
|
|||
</Button>
|
||||
|
||||
<Button variant="outline" size="icon" class="h-8 w-8" :title="t('schemaDiff.exportConfig')" @click="onExport">
|
||||
<Download class="h-4 w-4" />
|
||||
</Button>
|
||||
|
||||
<Button variant="outline" size="icon" class="h-8 w-8" :title="t('schemaDiff.importConfig')" @click="importDialogOpen = true">
|
||||
<Upload class="h-4 w-4" />
|
||||
</Button>
|
||||
|
||||
<Button variant="outline" size="icon" class="h-8 w-8" :title="t('schemaDiff.importConfig')" @click="importDialogOpen = true">
|
||||
<Download class="h-4 w-4" />
|
||||
</Button>
|
||||
|
||||
<Button variant="outline" size="icon" class="h-8 w-8" :title="t('schemaDiff.exportAllConfigs')" @click="onExportAll">
|
||||
<FileDown class="h-4 w-4" />
|
||||
<Upload class="h-4 w-4" />
|
||||
</Button>
|
||||
|
||||
<!-- Rename Dialog -->
|
||||
|
|
|
|||
|
|
@ -478,11 +478,11 @@ onBeforeUnmount(() => {
|
|||
<div class="flex flex-wrap items-center gap-2">
|
||||
<input ref="fileInputRef" type="file" accept="application/json,.json" class="hidden" @change="onImportFile" />
|
||||
<Button type="button" variant="outline" size="sm" @click="importConfig">
|
||||
<Upload class="mr-2 h-4 w-4" />
|
||||
<Download class="mr-2 h-4 w-4" />
|
||||
{{ t("settings.sqlFormatterImport") }}
|
||||
</Button>
|
||||
<Button type="button" variant="outline" size="sm" @click="exportConfig">
|
||||
<Download class="mr-2 h-4 w-4" />
|
||||
<Upload class="mr-2 h-4 w-4" />
|
||||
{{ t("settings.sqlFormatterExport") }}
|
||||
</Button>
|
||||
<Button type="button" variant="outline" size="sm" @click="restoreDefaults">
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import {
|
|||
ArrowUp,
|
||||
ArrowDown,
|
||||
ArrowUpDown,
|
||||
Download,
|
||||
Upload,
|
||||
Plus,
|
||||
Trash2,
|
||||
Save,
|
||||
|
|
@ -49,7 +49,6 @@ import {
|
|||
RotateCcw,
|
||||
Pencil,
|
||||
Filter,
|
||||
FileDown,
|
||||
SquareDashed,
|
||||
Check,
|
||||
CopyPlus,
|
||||
|
|
@ -6671,7 +6670,7 @@ function binaryDownloadSubmenu(detail: DataGridCellDetail | null): ContextMenuIt
|
|||
if (!canDownloadDetailBinaryValue(detail)) return null;
|
||||
return {
|
||||
label: t("grid.downloadBinaryValue"),
|
||||
icon: Download,
|
||||
icon: Upload,
|
||||
children: BINARY_CELL_DOWNLOAD_MODES.map((mode) => ({
|
||||
label: t(`grid.binaryDownload.${mode}`),
|
||||
action: () => {
|
||||
|
|
@ -7999,7 +7998,7 @@ function exportSubmenu(): ContextMenuItem {
|
|||
{ label: t("grid.exportSelectedRowsSql"), action: exportSelectedRowsSql },
|
||||
);
|
||||
}
|
||||
return { label: t("grid.export"), icon: FileDown, children: items };
|
||||
return { label: t("grid.export"), icon: Upload, children: items };
|
||||
}
|
||||
|
||||
const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
|
||||
|
|
@ -8910,7 +8909,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
|
|||
>
|
||||
<template #trigger="{ open, toggle }">
|
||||
<button class="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground" :title="t('grid.downloadBinaryValue')" :aria-expanded="open" @mousedown.stop @click.stop="toggle">
|
||||
<Download class="h-3 w-3" />
|
||||
<Upload class="h-3 w-3" />
|
||||
</button>
|
||||
</template>
|
||||
</LightDropdownMenu>
|
||||
|
|
@ -9386,7 +9385,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
|
|||
>
|
||||
<template #trigger="{ open, toggle }">
|
||||
<button class="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground" :title="t('grid.downloadBinaryValue')" :aria-expanded="open" @mousedown.stop @click.stop="toggle">
|
||||
<Download class="h-3 w-3" />
|
||||
<Upload class="h-3 w-3" />
|
||||
</button>
|
||||
</template>
|
||||
</LightDropdownMenu>
|
||||
|
|
@ -9527,7 +9526,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
|
|||
>
|
||||
<template #trigger="{ open, toggle }">
|
||||
<button class="flex h-5 w-5 items-center justify-center rounded bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border hover:text-foreground" :title="t('grid.downloadBinaryValue')" :aria-expanded="open" @mousedown.stop @click.stop="toggle">
|
||||
<Download class="h-3 w-3" />
|
||||
<Upload class="h-3 w-3" />
|
||||
</button>
|
||||
</template>
|
||||
</LightDropdownMenu>
|
||||
|
|
@ -9868,7 +9867,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
|
|||
<DropdownMenu v-if="!isEditingDetail && canDownloadDetailBinaryValue(activeCellDetail)">
|
||||
<DropdownMenuTrigger as-child>
|
||||
<Button variant="ghost" size="icon" class="h-5 w-5" :title="t('grid.downloadBinaryValue')">
|
||||
<Download class="h-3 w-3" />
|
||||
<Upload class="h-3 w-3" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" class="w-44">
|
||||
|
|
@ -10106,7 +10105,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
|
|||
model-value=""
|
||||
:items="exportMenuItems"
|
||||
:aria-label="t('grid.export')"
|
||||
:trigger-icon="Download"
|
||||
:trigger-icon="Upload"
|
||||
:trigger-label="t('grid.export')"
|
||||
trigger-class="inline-flex h-6 shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-md px-2 text-foreground/80 hover:bg-accent hover:text-accent-foreground"
|
||||
trigger-icon-class="h-3.5 w-3.5"
|
||||
|
|
@ -10175,7 +10174,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
|
|||
<DropdownMenu v-if="canDownloadDetailBinaryValue(dialogCellDetail)">
|
||||
<DropdownMenuTrigger as-child>
|
||||
<Button variant="ghost" size="icon" class="h-6 w-6" :title="t('grid.downloadBinaryValue')">
|
||||
<Download class="h-3 w-3" />
|
||||
<Upload class="h-3 w-3" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" class="w-44">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { computed, ref, defineAsyncComponent, watch, nextTick, onMounted, onUnmo
|
|||
import { safeLocalStorageGet, safeLocalStorageSet } from "@/lib/backend/safeStorage";
|
||||
import type { CSSProperties } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { Check, Columns3, EyeOff, Loader2, Search, Bot, GitBranch, BarChart3, TableProperties, ChevronDown, ChevronUp, Inbox, RefreshCcw, Timer, Wrench, Toolbox, ListChecks, Database, FileUp, Download, X, Pin, Rows3, SquareDashed, Minus, Plus } from "@lucide/vue";
|
||||
import { Check, Columns3, EyeOff, Loader2, Search, Bot, GitBranch, BarChart3, TableProperties, ChevronDown, ChevronUp, Inbox, RefreshCcw, Timer, Wrench, Toolbox, ListChecks, Database, Download, Upload, X, Pin, Rows3, SquareDashed, Minus, Plus } from "@lucide/vue";
|
||||
import { Splitpanes, Pane } from "splitpanes";
|
||||
import "splitpanes/dist/splitpanes.css";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
|
@ -863,7 +863,7 @@ defineExpose({ focusSearch, refreshData, handleModRTarget, requestQueryEditorExe
|
|||
</Button>
|
||||
<Button v-if="canExportResultArchive" variant="ghost" size="sm" class="h-6 shrink-0 gap-1 px-2 text-xs text-muted-foreground hover:text-foreground" :disabled="resultArchiveExporting" @click="exportResultArchive">
|
||||
<Loader2 v-if="resultArchiveExporting" class="h-3.5 w-3.5 animate-spin" />
|
||||
<Download v-else class="h-3.5 w-3.5" />
|
||||
<Upload v-else class="h-3.5 w-3.5" />
|
||||
{{ t("tabs.exportResultArchive") }}
|
||||
</Button>
|
||||
<Popover v-if="activeOutputView === 'result' && activeTab.result">
|
||||
|
|
@ -1216,12 +1216,12 @@ defineExpose({ focusSearch, refreshData, handleModRTarget, requestQueryEditorExe
|
|||
{{ t("tableToolbox.generateData") }}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem class="gap-2" @click="handleTableImport">
|
||||
<FileUp class="h-4 w-4" />
|
||||
<Download class="h-4 w-4" />
|
||||
{{ t("tableToolbox.importData") }}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSub>
|
||||
<DropdownMenuSubTrigger class="gap-2">
|
||||
<Download class="h-4 w-4" />
|
||||
<Upload class="h-4 w-4" />
|
||||
{{ t("tableToolbox.exportData") }}
|
||||
</DropdownMenuSubTrigger>
|
||||
<DropdownMenuPortal>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, ref, watch, watchEffect } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { Play, Loader2, Square, Database, Check, Table2, AlignLeft, GitBranch, Save, FolderOpen, Layers, X, Shield, Upload, RotateCcw, AlertTriangle, ClipboardPaste } from "@lucide/vue";
|
||||
import { Play, Loader2, Square, Database, Check, Table2, AlignLeft, GitBranch, Save, FolderOpen, Layers, X, Shield, Download, RotateCcw, AlertTriangle, ClipboardPaste } from "@lucide/vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { SearchableSelect } from "@/components/ui/searchable-select";
|
||||
import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip";
|
||||
|
|
@ -285,7 +285,7 @@ function connectionById(connectionId: string): ConnectionConfig | undefined {
|
|||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<Button variant="ghost" size="icon" class="h-6 w-6 text-cyan-600 hover:bg-cyan-500/10 hover:text-cyan-700 dark:text-cyan-300 dark:hover:text-cyan-200" @click="emit('importResultArchive')">
|
||||
<Upload class="h-3.5 w-3.5" />
|
||||
<Download class="h-3.5 w-3.5" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{{ t("tabs.importResultArchive") }}</TooltipContent>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { computed, nextTick, onBeforeUnmount, reactive, ref } from "vue";
|
||||
import type { CSSProperties } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { ArrowDownWideNarrow, Download, FileInput, FilePlus, FileText, FolderCog, FolderClosed, FolderOpen, FolderPlus, Library, LocateFixed, Pencil, Search, Trash2, Upload, X } from "@lucide/vue";
|
||||
import { ArrowDownWideNarrow, Download, FilePlus, FileText, FolderCog, FolderClosed, FolderOpen, FolderPlus, Library, LocateFixed, Pencil, Search, Trash2, Upload, X } from "@lucide/vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||
import CustomContextMenu, { type ContextMenuItem as CtxMenuItem } from "@/components/ui/CustomContextMenu.vue";
|
||||
|
|
@ -853,7 +853,7 @@ const contextMenuItems = computed<CtxMenuItem[]>(() => {
|
|||
if ("sql" in target) {
|
||||
return [
|
||||
{ label: t("savedSql.open"), action: () => openFile(target), icon: FileText },
|
||||
{ label: t("sqlLibrary.exportFile"), action: () => exportSingleFile(target), icon: FileInput },
|
||||
{ label: t("sqlLibrary.exportFile"), action: () => exportSingleFile(target), icon: Upload },
|
||||
{ label: t("sqlLibrary.moveToFolder"), icon: FolderClosed, children: folderMoveMenuItems([target.id]) },
|
||||
{ label: "", separator: true },
|
||||
{ label: t("savedSql.renameFile"), action: () => startRenameFile(target), icon: Pencil },
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { FilePlus2, Plus, History, Upload, Database, Search, ShieldCheck, Sparkles } from "@lucide/vue";
|
||||
import { FilePlus2, Plus, History, Download, Database, Search, ShieldCheck, Sparkles } from "@lucide/vue";
|
||||
import DatabaseIcon from "@/components/icons/DatabaseIcon.vue";
|
||||
import { connectionDriverLabel, connectionIconType, connectionRedactedNameLabel, connectionRedactedOptionSubtitle } from "@/lib/connection/connectionPresentation";
|
||||
import type { ConnectionConfig } from "@/types/database";
|
||||
|
|
@ -85,7 +85,7 @@ const { t } = useI18n();
|
|||
<button class="flex items-center gap-2 rounded-md px-3 py-2 text-left text-sm hover:bg-muted/50" @click="emit('new-connection')"><Plus class="h-4 w-4" /> {{ t("toolbar.newConnection") }}</button>
|
||||
<button class="flex items-center gap-2 rounded-md px-3 py-2 text-left text-sm hover:bg-muted/50" :disabled="!hasConnections" @click="emit('new-query')"><FilePlus2 class="h-4 w-4" /> {{ t("toolbar.newQuery") }}</button>
|
||||
<button class="flex items-center gap-2 rounded-md px-3 py-2 text-left text-sm hover:bg-muted/50" @click="emit('show-history')"><History class="h-4 w-4" /> {{ t("history.title") }}</button>
|
||||
<button class="flex items-center gap-2 rounded-md px-3 py-2 text-left text-sm hover:bg-muted/50" @click="emit('import-config')"><Upload class="h-4 w-4" /> {{ t("sidebar.import") }}</button>
|
||||
<button class="flex items-center gap-2 rounded-md px-3 py-2 text-left text-sm hover:bg-muted/50" @click="emit('import-config')"><Download class="h-4 w-4" /> {{ t("sidebar.import") }}</button>
|
||||
<div class="mt-2 rounded-md bg-muted/30 px-3 py-2 text-xs leading-5 text-muted-foreground">
|
||||
<Search class="mr-1 inline h-3.5 w-3.5" />
|
||||
{{ t("welcome.tip") }}
|
||||
|
|
|
|||
|
|
@ -1470,7 +1470,7 @@ watch(
|
|||
function exportDataSubmenu(item: ObjectBrowserRow): ContextMenuItem {
|
||||
return {
|
||||
label: t("contextMenu.exportData"),
|
||||
icon: Download,
|
||||
icon: Upload,
|
||||
children: [
|
||||
{ label: "CSV", action: () => exportData(item, "csv") },
|
||||
{ label: "JSON", action: () => exportData(item, "json") },
|
||||
|
|
@ -1495,11 +1495,11 @@ function getTableMenuItems(item: ObjectBrowserRow): ContextMenuItem[] {
|
|||
...(canRename(item) ? [{ label: t("contextMenu.renameObject"), action: () => requestRename(item), icon: Pencil }] : []),
|
||||
{ label: t("contextMenu.newQuery"), action: () => openNewQuery(item), icon: TerminalSquare },
|
||||
...(canOpenDiagram.value ? [{ label: t("diagram.open"), action: () => openDiagram(item), icon: Network }] : []),
|
||||
...(canOpenTableImport.value ? [{ label: t("contextMenu.importData"), action: () => openTableImport(item), icon: Upload }] : []),
|
||||
...(canOpenTableImport.value ? [{ label: t("contextMenu.importData"), action: () => openTableImport(item), icon: Download }] : []),
|
||||
{ label: t("dataCompare.title"), action: () => openDataCompare(item), icon: ArrowRightLeft },
|
||||
{ label: "", separator: true },
|
||||
exportDataSubmenu(item),
|
||||
{ label: t("contextMenu.exportDatabase"), action: () => openDatabaseExport(item), icon: Download },
|
||||
{ label: t("contextMenu.exportDatabase"), action: () => openDatabaseExport(item), icon: Upload },
|
||||
{ label: t("contextMenu.exportStructure"), action: () => exportStructure(item), icon: FileCode },
|
||||
{ label: "", separator: true },
|
||||
{ label: t("contextMenu.duplicateStructure"), action: () => requestDuplicateStructure(item), icon: CopyPlus },
|
||||
|
|
@ -1550,7 +1550,7 @@ function getViewMenuItems(item: ObjectBrowserRow): ContextMenuItem[] {
|
|||
...(canOpenDiagram.value ? [{ label: t("diagram.open"), action: () => openDiagram(item), icon: Network }] : []),
|
||||
{ label: "", separator: true },
|
||||
exportDataSubmenu(item),
|
||||
{ label: t("contextMenu.exportDatabase"), action: () => openDatabaseExport(item), icon: Download },
|
||||
{ label: t("contextMenu.exportDatabase"), action: () => openDatabaseExport(item), icon: Upload },
|
||||
{ label: t("contextMenu.exportStructure"), action: () => exportStructure(item), icon: FileCode },
|
||||
{ label: "", separator: true },
|
||||
{
|
||||
|
|
@ -1658,7 +1658,7 @@ function getObjectBrowserMenuItems(item: ObjectBrowserRow): ContextMenuItem[] {
|
|||
{{ t("objects.selectedTables", { count: selectedTableCount }) }}
|
||||
</div>
|
||||
<Button variant="ghost" size="sm" class="h-7 px-2 text-xs" @click="openBatchDatabaseExport">
|
||||
<Download class="mr-1.5 h-3.5 w-3.5" />
|
||||
<Upload class="mr-1.5 h-3.5 w-3.5" />
|
||||
{{ t("objects.exportSelected") }}
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" class="h-7 px-2 text-xs" @click="copySelectedTablesToClipboard">
|
||||
|
|
|
|||
|
|
@ -4341,7 +4341,7 @@ const shortcutDelete = "Delete";
|
|||
function exportDataSubmenu(): ContextMenuItem {
|
||||
return {
|
||||
label: t("contextMenu.exportData"),
|
||||
icon: Download,
|
||||
icon: Upload,
|
||||
children: [
|
||||
{ label: "CSV", action: () => exportData("csv") },
|
||||
{ label: "JSON", action: () => exportData("json") },
|
||||
|
|
@ -4608,7 +4608,7 @@ function treeItemMenuItems(): ContextMenuItem[] {
|
|||
items.push({ label: t("contextMenu.createTable"), action: createTable, icon: Plus });
|
||||
}
|
||||
if (canOpenTableImport.value) {
|
||||
items.push({ label: t("contextMenu.importData"), action: openTableImport, icon: Upload });
|
||||
items.push({ label: t("contextMenu.importData"), action: openTableImport, icon: Download });
|
||||
}
|
||||
if (canCreateSchema.value) {
|
||||
items.push({ label: t("contextMenu.createSchema"), action: openCreateSchemaDialog, icon: Plus });
|
||||
|
|
@ -4642,7 +4642,7 @@ function treeItemMenuItems(): ContextMenuItem[] {
|
|||
items.push({ label: t("transfer.dataTransfer"), action: openTransfer, icon: ArrowRightLeft });
|
||||
items.push({ label: t("diff.title"), action: openSchemaDiff, icon: ArrowRightLeft });
|
||||
items.push({ label: t("dataCompare.title"), action: openDataCompare, icon: ArrowRightLeft });
|
||||
items.push({ label: t("contextMenu.exportDatabase"), action: openDatabaseExport, icon: Download });
|
||||
items.push({ label: t("contextMenu.exportDatabase"), action: openDatabaseExport, icon: Upload });
|
||||
const destructiveActions: ContextMenuItem[] = [];
|
||||
if (canDropDatabase.value) {
|
||||
destructiveActions.push({
|
||||
|
|
@ -4826,14 +4826,14 @@ function treeItemMenuItems(): ContextMenuItem[] {
|
|||
items.push({ label: t("diagram.open"), action: openDiagram, icon: Network });
|
||||
}
|
||||
if (canOpenTableImport.value) {
|
||||
items.push({ label: t("contextMenu.importData"), action: openTableImport, icon: Upload });
|
||||
items.push({ label: t("contextMenu.importData"), action: openTableImport, icon: Download });
|
||||
}
|
||||
if (isTableNotView.value) {
|
||||
items.push({ label: t("dataCompare.title"), action: openDataCompare, icon: ArrowRightLeft });
|
||||
}
|
||||
items.push({ label: "", separator: true });
|
||||
items.push(exportDataSubmenu());
|
||||
items.push({ label: t("contextMenu.exportDatabase"), action: openDatabaseExport, icon: Download });
|
||||
items.push({ label: t("contextMenu.exportDatabase"), action: openDatabaseExport, icon: Upload });
|
||||
items.push({ label: t("contextMenu.exportStructure"), action: exportStructure, icon: FileCode });
|
||||
items.push(copyStructureAsSubmenu());
|
||||
if (isTableNotView.value) {
|
||||
|
|
@ -5263,7 +5263,7 @@ function treeItemMenuItems(): ContextMenuItem[] {
|
|||
{{ t("contextMenu.copyStructure") }}
|
||||
</Button>
|
||||
<Button :disabled="isLoadingStructurePreview || !structurePreviewSql" @click="saveStructurePreview">
|
||||
<Download class="h-4 w-4" />
|
||||
<Upload class="h-4 w-4" />
|
||||
{{ t("contextMenu.saveStructure") }}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
|
|
|
|||
Loading…
Reference in New Issue