QOL Navigation

This commit is contained in:
Julian Krauser 2024-12-19 10:37:14 +01:00
parent 604ae30901
commit ce8157e6bf

View file

@ -57,7 +57,7 @@
</div>
<div
class="p-1"
:class="typeof value == 'object' ? 'bg-gray-200' : ''"
:class="typeof value == 'object' && queryMode != 'structure' ? 'bg-gray-200' : ''"
title="Visual Builder"
@click="queryMode = 'builder'"
>
@ -65,7 +65,7 @@
</div>
<div
class="p-1"
:class="typeof value == 'string' ? 'bg-gray-200' : ''"
:class="typeof value == 'string' && queryMode != 'structure' ? 'bg-gray-200' : ''"
title="SQL Editor"
@click="queryMode = 'editor'"
>
@ -136,10 +136,16 @@ export default defineComponent({
} else {
this.value = "";
}
this.activeQueryId = undefined;
},
activeQueryId() {
let query = this.queries.find((t) => t.id == this.activeQueryId)?.query;
if (query != undefined) {
if (typeof query == "string") {
this.queryMode = "editor";
} else {
this.queryMode = "builder";
}
this.value = query;
}
},