mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-23 04:55:21 +00:00
fix: move AI fix action near query errors
This commit is contained in:
@@ -5645,6 +5645,7 @@ const gridContextMenuItems = computed<ContextMenuItem[]>(() => {
|
||||
<div class="text-sm font-medium">{{ t("grid.queryError") }}</div>
|
||||
<div class="text-xs max-w-lg break-all text-destructive/80">{{ errorMessage }}</div>
|
||||
</div>
|
||||
<slot name="error-actions" :error-message="errorMessage" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
|
||||
@@ -445,19 +445,19 @@ defineExpose({ focusSearch, refreshData, handleModRTarget });
|
||||
(column: string, columnIndex: number, direction: 'asc' | 'desc' | null, whereInput?: string) =>
|
||||
emit('sort', column, columnIndex, direction, whereInput)
|
||||
"
|
||||
/>
|
||||
<div
|
||||
v-if="activeTab.result?.columns.includes('Error')"
|
||||
class="flex items-center gap-2 px-3 py-1.5 border-t bg-destructive/5"
|
||||
>
|
||||
<Bot class="h-3.5 w-3.5 text-destructive" />
|
||||
<button
|
||||
class="text-xs text-destructive hover:underline"
|
||||
@click="emit('fixWithAi', String(activeTab.result?.rows?.[0]?.[0] ?? ''))"
|
||||
>
|
||||
{{ t("ai.fixWithAi") }}
|
||||
</button>
|
||||
</div>
|
||||
<template v-if="activeTab.result?.columns.includes('Error')" #error-actions="{ errorMessage }">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
class="mt-2 h-7 gap-1.5 border-destructive/30 bg-background px-2.5 text-xs text-destructive hover:bg-destructive/10 hover:text-destructive"
|
||||
@click="emit('fixWithAi', String(errorMessage))"
|
||||
>
|
||||
<Bot class="h-3.5 w-3.5" />
|
||||
{{ t("ai.fixWithAi") }}
|
||||
</Button>
|
||||
</template>
|
||||
</DataGrid>
|
||||
<div
|
||||
v-else-if="!activeTab.result && activeTab.isExecuting"
|
||||
class="flex-1 min-h-0 flex flex-col items-center justify-center gap-3 text-muted-foreground text-sm"
|
||||
|
||||
Reference in New Issue
Block a user