fix: display of table structure cleared query builder request

This commit is contained in:
Julian Krauser 2025-01-19 12:35:21 +01:00
parent 9e50d95d7b
commit 8a85cc054d
2 changed files with 11 additions and 16 deletions

View file

@ -46,18 +46,13 @@
</div> </div>
</div> </div>
<div class="grow max-lg:hidden"></div> <div class="grow max-lg:hidden"></div>
<div class="p-1 border border-gray-400 bg-gray-100 rounded-md" title="Schema-Struktur" @click="showStructure">
<SparklesIcon class="text-gray-500 h-6 w-6 cursor-pointer" />
</div>
<div class="flex flex-row min-w-fit overflow-hidden border border-gray-400 rounded-md"> <div class="flex flex-row min-w-fit overflow-hidden border border-gray-400 rounded-md">
<div <div
class="p-1" class="p-1"
:class="queryMode == 'structure' ? 'bg-gray-200' : ''" :class="typeof value == 'object' ? 'bg-gray-200' : ''"
title="Schema-Struktur"
@click="queryMode = 'structure'"
>
<SparklesIcon class="text-gray-500 h-6 w-6 cursor-pointer" />
</div>
<div
class="p-1"
:class="typeof value == 'object' && queryMode != 'structure' ? 'bg-gray-200' : ''"
title="Visual Builder" title="Visual Builder"
@click="queryMode = 'builder'" @click="queryMode = 'builder'"
> >
@ -65,7 +60,7 @@
</div> </div>
<div <div
class="p-1" class="p-1"
:class="typeof value == 'string' && queryMode != 'structure' ? 'bg-gray-200' : ''" :class="typeof value == 'string' ? 'bg-gray-200' : ''"
title="SQL Editor" title="SQL Editor"
@click="queryMode = 'editor'" @click="queryMode = 'editor'"
> >
@ -74,10 +69,7 @@
</div> </div>
</div> </div>
<div class="p-2 h-44 md:h-60 w-full overflow-y-auto"> <div class="p-2 h-44 md:h-60 w-full overflow-y-auto">
<div v-if="queryMode == 'structure'"> <textarea v-if="typeof value == 'string'" v-model="value" placeholder="SQL Query" class="h-full w-full" />
<img src="/administration-db.png" class="h-full w-full cursor-pointer" @click="showStructure" />
</div>
<textarea v-else-if="typeof value == 'string'" v-model="value" placeholder="SQL Query" class="h-full w-full" />
<Table v-else v-model="value" /> <Table v-else v-model="value" />
</div> </div>
</div> </div>
@ -153,7 +145,7 @@ export default defineComponent({
data() { data() {
return { return {
autoChangeFlag: false as boolean, autoChangeFlag: false as boolean,
queryMode: "builder" as "builder" | "editor" | "structure", queryMode: "builder" as "builder" | "editor",
}; };
}, },
computed: { computed: {

View file

@ -11,7 +11,10 @@
<div class="flex flex-row justify-end"> <div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2"> <div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal">schnließen</button> <a href="/administration-db.png" button primary-outline download="Datenbank-Schema" class="!whitespace-nowrap"
>Bild herunterladen</a
>
<button primary-outline @click="closeModal">schließen</button>
</div> </div>
</div> </div>
</div> </div>