1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat: open saved queries in a tab

This commit is contained in:
2023-12-25 10:54:41 +01:00
parent a52fc3fd92
commit 9a732ea197
5 changed files with 85 additions and 10 deletions

View File

@ -345,6 +345,7 @@ watch(query, (val) => {
schema: selectedSchema.value,
content: val
});
isQuerySaved.value = false;
}, 200);
});
@ -368,6 +369,14 @@ watch(databaseSchemas, () => {
selectedSchema.value = null;
}, { deep: true });
watch(() => props.tab.content, () => {
query.value = props.tab.content;
const editorValue = queryEditor.value.editor.session.getValue();
if (editorValue !== query.value)// If change not rendered in editor
queryEditor.value.editor.session.setValue(query.value);
});
const runQuery = async (query: string) => {
if (!query || isQuering.value) return;
isQuering.value = true;