mirror of
https://github.com/Fabio286/antares.git
synced 2025-04-24 06:57:19 +02:00
perf: improved resize of text editor resizing console height
This commit is contained in:
parent
6a6f43a718
commit
3f9e6d85ca
@ -151,10 +151,10 @@ onMounted(() => {
|
|||||||
.connection-panel-wrapper {
|
.connection-panel-wrapper {
|
||||||
height: calc(100vh - #{$excluding-size});
|
height: calc(100vh - #{$excluding-size});
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-top: 2rem;
|
padding-top: 10vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<div class="footer-right-elements">
|
<div class="footer-right-elements">
|
||||||
<ul class="footer-elements">
|
<ul class="footer-elements">
|
||||||
<li
|
<li
|
||||||
v-if="workspace !== 'NEW'"
|
v-if="workspace.connectionStatus === 'connected' "
|
||||||
class="footer-element footer-link"
|
class="footer-element footer-link"
|
||||||
@click="toggleConsole"
|
@click="toggleConsole"
|
||||||
>
|
>
|
||||||
@ -63,14 +63,15 @@ interface DatabaseInfos {// TODO: temp
|
|||||||
const applicationStore = useApplicationStore();
|
const applicationStore = useApplicationStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
|
||||||
const { getSelected: workspace } = storeToRefs(workspacesStore);
|
const { getSelected: workspaceUid } = storeToRefs(workspacesStore);
|
||||||
const { toggleConsole } = useConsoleStore();
|
const { toggleConsole } = useConsoleStore();
|
||||||
|
|
||||||
const { showSettingModal } = applicationStore;
|
const { showSettingModal } = applicationStore;
|
||||||
const { getWorkspace } = workspacesStore;
|
const { getWorkspace } = workspacesStore;
|
||||||
|
|
||||||
|
const workspace = computed(() => getWorkspace(workspaceUid.value));
|
||||||
const version: ComputedRef<DatabaseInfos> = computed(() => {
|
const version: ComputedRef<DatabaseInfos> = computed(() => {
|
||||||
return getWorkspace(workspace.value) ? getWorkspace(workspace.value).version : null;
|
return getWorkspace(workspaceUid.value) ? workspace.value.version : null;
|
||||||
});
|
});
|
||||||
|
|
||||||
const versionString = computed(() => {
|
const versionString = computed(() => {
|
||||||
|
@ -279,6 +279,12 @@
|
|||||||
<span>{{ $t('message.processesList') }}</span>
|
<span>{{ $t('message.processesList') }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a class="c-hand p-vcentered" @click="toggleConsole">
|
||||||
|
<i class="mdi mdi-console-line mr-1 tool-icon" />
|
||||||
|
<span>{{ $t('word.console') }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li
|
<li
|
||||||
v-if="workspace.customizations.variables"
|
v-if="workspace.customizations.variables"
|
||||||
class="menu-item"
|
class="menu-item"
|
||||||
@ -455,7 +461,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else class="connection-panel-wrapper p-relative">
|
<div v-else class="connection-panel-wrapper p-relative">
|
||||||
<WorkspaceEditConnectionPanel :connection="connection" />
|
<WorkspaceEditConnectionPanel :connection="connection" />
|
||||||
<WorkspaceQueryConsole v-if="isConsoleOpen" :uid="workspace.uid" />
|
|
||||||
</div>
|
</div>
|
||||||
<ModalProcessesList
|
<ModalProcessesList
|
||||||
v-if="isProcessesModal"
|
v-if="isProcessesModal"
|
||||||
@ -522,7 +527,10 @@ const {
|
|||||||
selectPrevTab
|
selectPrevTab
|
||||||
} = workspacesStore;
|
} = workspacesStore;
|
||||||
|
|
||||||
const { isConsoleOpen } = storeToRefs(useConsoleStore());
|
const consoleStore = useConsoleStore();
|
||||||
|
|
||||||
|
const { isConsoleOpen } = storeToRefs(consoleStore);
|
||||||
|
const { toggleConsole } = consoleStore;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
connection: Object as Prop<ConnectionParams>
|
connection: Object as Prop<ConnectionParams>
|
||||||
|
@ -551,7 +551,8 @@ localConnection.value = JSON.parse(JSON.stringify(props.connection));
|
|||||||
.connection-panel {
|
.connection-panel {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: .5rem;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
min-width: 450px;
|
min-width: 450px;
|
||||||
|
@ -14,13 +14,14 @@
|
|||||||
>
|
>
|
||||||
<div class="query-console-header">
|
<div class="query-console-header">
|
||||||
<div>{{ t('word.console') }}</div>
|
<div>{{ t('word.console') }}</div>
|
||||||
<i class="mdi mdi-close c-hand" @click="resizeConsole(0)" />
|
<button class="btn btn-clear mr-1" @click="resizeConsole(0)" />
|
||||||
</div>
|
</div>
|
||||||
<div ref="queryConsoleBody" class="query-console-body">
|
<div ref="queryConsoleBody" class="query-console-body">
|
||||||
<div
|
<div
|
||||||
v-for="(wLog, i) in workspaceLogs"
|
v-for="(wLog, i) in workspaceLogs"
|
||||||
:key="i"
|
:key="i"
|
||||||
class="query-console-log"
|
class="query-console-log"
|
||||||
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<span class="type-datetime">{{ moment(wLog.date).format('YYYY-MM-DD HH:mm:ss') }}</span>: <span class="type-string">{{ wLog.sql }}</span>
|
<span class="type-datetime">{{ moment(wLog.date).format('YYYY-MM-DD HH:mm:ss') }}</span>: <span class="type-string">{{ wLog.sql }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -136,7 +137,8 @@ onMounted(() => {
|
|||||||
padding: 1px 3px;
|
padding: 1px 3px;
|
||||||
user-select: text;
|
user-select: text;
|
||||||
border-radius: $border-radius;
|
border-radius: $border-radius;
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&:focus {
|
||||||
background: $bg-color-gray;
|
background: $bg-color-gray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,8 @@
|
|||||||
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import Functions from '@/ipc-api/Functions';
|
import Functions from '@/ipc-api/Functions';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
import BaseLoader from '@/components/BaseLoader.vue';
|
import BaseLoader from '@/components/BaseLoader.vue';
|
||||||
@ -200,6 +202,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -274,8 +277,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -311,6 +318,10 @@ watch(isChanged, (val) => {
|
|||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
originalFunction.value = {
|
originalFunction.value = {
|
||||||
sql: customizations.value.functionSql,
|
sql: customizations.value.functionSql,
|
||||||
language: customizations.value.languages ? customizations.value.languages[0] : null,
|
language: customizations.value.languages ? customizations.value.languages[0] : null,
|
||||||
|
@ -151,6 +151,8 @@
|
|||||||
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import Routines from '@/ipc-api/Routines';
|
import Routines from '@/ipc-api/Routines';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
import QueryEditor from '@/components/QueryEditor.vue';
|
import QueryEditor from '@/components/QueryEditor.vue';
|
||||||
@ -169,6 +171,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -243,8 +246,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -280,6 +287,10 @@ watch(isChanged, (val) => {
|
|||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
originalRoutine.value = {
|
originalRoutine.value = {
|
||||||
sql: customizations.value.functionSql,
|
sql: customizations.value.functionSql,
|
||||||
language: customizations.value.languages ? customizations.value.languages[0] : null,
|
language: customizations.value.languages ? customizations.value.languages[0] : null,
|
||||||
|
@ -129,6 +129,8 @@ import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Prop, Ref
|
|||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import { ConnectionParams, EventInfos } from 'common/interfaces/antares';
|
import { ConnectionParams, EventInfos } from 'common/interfaces/antares';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
import BaseLoader from '@/components/BaseLoader.vue';
|
import BaseLoader from '@/components/BaseLoader.vue';
|
||||||
@ -149,6 +151,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -233,8 +236,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -270,6 +277,10 @@ watch(isChanged, (val) => {
|
|||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
originalScheduler.value = {
|
originalScheduler.value = {
|
||||||
definer: '',
|
definer: '',
|
||||||
sql: 'BEGIN\r\n\r\nEND',
|
sql: 'BEGIN\r\n\r\nEND',
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="px-2">
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column col-auto">
|
<div class="column col-auto">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -118,8 +118,10 @@
|
|||||||
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import QueryEditor from '@/components/QueryEditor.vue';
|
import QueryEditor from '@/components/QueryEditor.vue';
|
||||||
import BaseLoader from '@/components/BaseLoader.vue';
|
import BaseLoader from '@/components/BaseLoader.vue';
|
||||||
import Triggers from '@/ipc-api/Triggers';
|
import Triggers from '@/ipc-api/Triggers';
|
||||||
@ -137,6 +139,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -254,8 +257,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -264,7 +271,7 @@ const resizeQueryEditor = () => {
|
|||||||
const onKey = (e: KeyboardEvent) => {
|
const onKey = (e: KeyboardEvent) => {
|
||||||
if (props.isSelected) {
|
if (props.isSelected) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (e.ctrlKey && e.keyCode === 83) { // CTRL + S
|
if (e.ctrlKey && e.key === 's') { // CTRL + S
|
||||||
if (isChanged.value)
|
if (isChanged.value)
|
||||||
saveChanges();
|
saveChanges();
|
||||||
}
|
}
|
||||||
@ -288,6 +295,10 @@ originalTrigger.value = {
|
|||||||
name: ''
|
name: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
localTrigger.value = JSON.parse(JSON.stringify(originalTrigger.value));
|
localTrigger.value = JSON.parse(JSON.stringify(originalTrigger.value));
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -99,6 +99,8 @@ import { Ace } from 'ace-builds';
|
|||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import BaseLoader from '@/components/BaseLoader.vue';
|
import BaseLoader from '@/components/BaseLoader.vue';
|
||||||
import QueryEditor from '@/components/QueryEditor.vue';
|
import QueryEditor from '@/components/QueryEditor.vue';
|
||||||
import Functions from '@/ipc-api/Functions';
|
import Functions from '@/ipc-api/Functions';
|
||||||
@ -116,6 +118,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -189,8 +192,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -212,6 +219,18 @@ originalFunction.value = {
|
|||||||
name: ''
|
name: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
|
watch(() => props.isSelected, (val) => {
|
||||||
|
if (val) changeBreadcrumbs({ schema: props.schema });
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(isChanged, (val) => {
|
||||||
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
localFunction.value = JSON.parse(JSON.stringify(originalFunction.value));
|
localFunction.value = JSON.parse(JSON.stringify(originalFunction.value));
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -238,12 +257,4 @@ onUnmounted(() => {
|
|||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
window.removeEventListener('keydown', onKey);
|
window.removeEventListener('keydown', onKey);
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(() => props.isSelected, (val) => {
|
|
||||||
if (val) changeBreadcrumbs({ schema: props.schema });
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(isChanged, (val) => {
|
|
||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -107,6 +107,8 @@
|
|||||||
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
import BaseLoader from '@/components/BaseLoader.vue';
|
import BaseLoader from '@/components/BaseLoader.vue';
|
||||||
@ -126,6 +128,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -202,8 +205,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -233,6 +240,10 @@ watch(isChanged, (val) => {
|
|||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
originalView.value = {
|
originalView.value = {
|
||||||
algorithm: 'UNDEFINED',
|
algorithm: 'UNDEFINED',
|
||||||
definer: '',
|
definer: '',
|
||||||
|
@ -194,6 +194,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
import { uidGen } from 'common/libs/uidGen';
|
import { uidGen } from 'common/libs/uidGen';
|
||||||
@ -218,6 +220,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -344,8 +347,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -443,6 +450,10 @@ watch(isChanged, (val) => {
|
|||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await getFunctionData();
|
await getFunctionData();
|
||||||
queryEditor.value.editor.session.setValue(localFunction.value.sql);
|
queryEditor.value.editor.session.setValue(localFunction.value.sql);
|
||||||
|
@ -168,6 +168,8 @@ import { Component, computed, onUnmounted, onBeforeUnmount, onMounted, Ref, ref,
|
|||||||
import { AlterRoutineParams, FunctionParam, RoutineInfos } from 'common/interfaces/antares';
|
import { AlterRoutineParams, FunctionParam, RoutineInfos } from 'common/interfaces/antares';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
import { uidGen } from 'common/libs/uidGen';
|
import { uidGen } from 'common/libs/uidGen';
|
||||||
@ -190,6 +192,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -316,8 +319,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -413,6 +420,10 @@ watch(isChanged, (val) => {
|
|||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await getRoutineData();
|
await getRoutineData();
|
||||||
queryEditor.value.editor.session.setValue(localRoutine.value.sql);
|
queryEditor.value.editor.session.setValue(localRoutine.value.sql);
|
||||||
|
@ -127,6 +127,8 @@ import { AlterEventParams, EventInfos } from 'common/interfaces/antares';
|
|||||||
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
import BaseLoader from '@/components/BaseLoader.vue';
|
import BaseLoader from '@/components/BaseLoader.vue';
|
||||||
@ -147,6 +149,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -269,8 +272,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -331,6 +338,10 @@ watch(isChanged, (val) => {
|
|||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await getSchedulerData();
|
await getSchedulerData();
|
||||||
queryEditor.value.editor.session.setValue(localScheduler.value.sql);
|
queryEditor.value.editor.session.setValue(localScheduler.value.sql);
|
||||||
|
@ -126,8 +126,10 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Component, computed, onMounted, onUnmounted, onUpdated, Prop, ref, Ref, watch } from 'vue';
|
import { Component, computed, onMounted, onUnmounted, onUpdated, Prop, ref, Ref, watch } from 'vue';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import * as Draggable from 'vuedraggable';
|
import * as Draggable from 'vuedraggable';
|
||||||
import TableRow from '@/components/WorkspaceTabPropsTableRow.vue';
|
import TableRow from '@/components/WorkspaceTabPropsTableRow.vue';
|
||||||
import TableContext from '@/components/WorkspaceTabPropsTableContext.vue';
|
import TableContext from '@/components/WorkspaceTabPropsTableContext.vue';
|
||||||
@ -150,9 +152,12 @@ const props = defineProps({
|
|||||||
const emit = defineEmits(['add-new-index', 'add-to-index', 'rename-field', 'duplicate-field', 'remove-field']);
|
const emit = defineEmits(['add-new-index', 'add-to-index', 'rename-field', 'duplicate-field', 'remove-field']);
|
||||||
|
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const consoleStore = useConsoleStore();
|
||||||
|
|
||||||
const { getWorkspace } = workspacesStore;
|
const { getWorkspace } = workspacesStore;
|
||||||
|
|
||||||
|
const { consoleHeight } = storeToRefs(consoleStore);
|
||||||
|
|
||||||
const tableWrapper: Ref<HTMLDivElement> = ref(null);
|
const tableWrapper: Ref<HTMLDivElement> = ref(null);
|
||||||
const propTable: Ref<HTMLDivElement> = ref(null);
|
const propTable: Ref<HTMLDivElement> = ref(null);
|
||||||
const resultTable: Ref<Component> = ref(null);
|
const resultTable: Ref<Component> = ref(null);
|
||||||
@ -172,8 +177,13 @@ const resizeResults = () => {
|
|||||||
const el = tableWrapper.value;
|
const el = tableWrapper.value;
|
||||||
|
|
||||||
if (el) {
|
if (el) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
resultsSize.value = size;
|
resultsSize.value = size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -216,6 +226,10 @@ watch(fieldsLength, () => {
|
|||||||
refreshScroller();
|
refreshScroller();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeResults();
|
||||||
|
});
|
||||||
|
|
||||||
onUpdated(() => {
|
onUpdated(() => {
|
||||||
if (propTable.value)
|
if (propTable.value)
|
||||||
refreshScroller();
|
refreshScroller();
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="px-2">
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column col-auto">
|
<div class="column col-auto">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -118,6 +118,8 @@
|
|||||||
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
import QueryEditor from '@/components/QueryEditor.vue';
|
import QueryEditor from '@/components/QueryEditor.vue';
|
||||||
@ -139,6 +141,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -304,8 +307,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -345,6 +352,10 @@ watch(isChanged, (val) => {
|
|||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: val });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await getTriggerData();
|
await getTriggerData();
|
||||||
queryEditor.value.editor.session.setValue(localTrigger.value.sql);
|
queryEditor.value.editor.session.setValue(localTrigger.value.sql);
|
||||||
|
@ -84,8 +84,10 @@
|
|||||||
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
import { Component, computed, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from 'vue';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import BaseLoader from '@/components/BaseLoader.vue';
|
import BaseLoader from '@/components/BaseLoader.vue';
|
||||||
import QueryEditor from '@/components/QueryEditor.vue';
|
import QueryEditor from '@/components/QueryEditor.vue';
|
||||||
import Functions from '@/ipc-api/Functions';
|
import Functions from '@/ipc-api/Functions';
|
||||||
@ -104,6 +106,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
@ -209,8 +212,12 @@ const clearChanges = () => {
|
|||||||
|
|
||||||
const resizeQueryEditor = () => {
|
const resizeQueryEditor = () => {
|
||||||
if (queryEditor.value) {
|
if (queryEditor.value) {
|
||||||
|
let sizeToSubtract = 0;
|
||||||
const footer = document.getElementById('footer');
|
const footer = document.getElementById('footer');
|
||||||
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - footer.offsetHeight;
|
if (footer) sizeToSubtract += footer.offsetHeight;
|
||||||
|
sizeToSubtract += consoleHeight.value;
|
||||||
|
|
||||||
|
const size = window.innerHeight - queryEditor.value.$el.getBoundingClientRect().top - sizeToSubtract;
|
||||||
editorHeight.value = size;
|
editorHeight.value = size;
|
||||||
queryEditor.value.editor.resize();
|
queryEditor.value.editor.resize();
|
||||||
}
|
}
|
||||||
@ -242,6 +249,10 @@ watch(() => props.function, async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(consoleHeight, () => {
|
||||||
|
resizeQueryEditor();
|
||||||
|
});
|
||||||
|
|
||||||
watch(() => props.isSelected, (val) => {
|
watch(() => props.isSelected, (val) => {
|
||||||
if (val) changeBreadcrumbs({ schema: props.schema });
|
if (val) changeBreadcrumbs({ schema: props.schema });
|
||||||
});
|
});
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
<div class="workspace-query-runner column col-12">
|
<div class="workspace-query-runner column col-12">
|
||||||
<QueryEditor
|
<QueryEditor
|
||||||
v-show="isSelected"
|
v-show="isSelected"
|
||||||
|
id="query-editor"
|
||||||
ref="queryEditor"
|
ref="queryEditor"
|
||||||
v-model="query"
|
v-model="query"
|
||||||
:auto-focus="true"
|
:auto-focus="true"
|
||||||
@ -187,18 +188,20 @@
|
|||||||
import { Component, computed, onBeforeUnmount, onMounted, Prop, ref, Ref, watch } from 'vue';
|
import { Component, computed, onBeforeUnmount, onMounted, Prop, ref, Ref, watch } from 'vue';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
import { format } from 'sql-formatter';
|
import { format } from 'sql-formatter';
|
||||||
import { ConnectionParams } from 'common/interfaces/antares';
|
import { ConnectionParams } from 'common/interfaces/antares';
|
||||||
import { useHistoryStore } from '@/stores/history';
|
import { useHistoryStore } from '@/stores/history';
|
||||||
import { useNotificationsStore } from '@/stores/notifications';
|
import { useNotificationsStore } from '@/stores/notifications';
|
||||||
import { useWorkspacesStore } from '@/stores/workspaces';
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
||||||
|
import { useResultTables } from '@/composables/useResultTables';
|
||||||
|
import { useConsoleStore } from '@/stores/console';
|
||||||
import Schema from '@/ipc-api/Schema';
|
import Schema from '@/ipc-api/Schema';
|
||||||
import QueryEditor from '@/components/QueryEditor.vue';
|
import QueryEditor from '@/components/QueryEditor.vue';
|
||||||
import BaseLoader from '@/components/BaseLoader.vue';
|
import BaseLoader from '@/components/BaseLoader.vue';
|
||||||
import WorkspaceTabQueryTable from '@/components/WorkspaceTabQueryTable.vue';
|
import WorkspaceTabQueryTable from '@/components/WorkspaceTabQueryTable.vue';
|
||||||
import WorkspaceTabQueryEmptyState from '@/components/WorkspaceTabQueryEmptyState.vue';
|
import WorkspaceTabQueryEmptyState from '@/components/WorkspaceTabQueryEmptyState.vue';
|
||||||
import ModalHistory from '@/components/ModalHistory.vue';
|
import ModalHistory from '@/components/ModalHistory.vue';
|
||||||
import { useResultTables } from '@/composables/useResultTables';
|
|
||||||
import BaseSelect from '@/components/BaseSelect.vue';
|
import BaseSelect from '@/components/BaseSelect.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@ -223,6 +226,8 @@ const { saveHistory } = useHistoryStore();
|
|||||||
const { addNotification } = useNotificationsStore();
|
const { addNotification } = useNotificationsStore();
|
||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
|
|
||||||
|
const { consoleHeight } = storeToRefs(useConsoleStore());
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getWorkspace,
|
getWorkspace,
|
||||||
changeBreadcrumbs,
|
changeBreadcrumbs,
|
||||||
@ -365,7 +370,7 @@ const resize = (e: MouseEvent) => {
|
|||||||
const el = queryEditor.value.$el;
|
const el = queryEditor.value.$el;
|
||||||
const queryFooterHeight = queryAreaFooter.value.clientHeight;
|
const queryFooterHeight = queryAreaFooter.value.clientHeight;
|
||||||
const bottom = e.pageY || resizer.value.getBoundingClientRect().bottom;
|
const bottom = e.pageY || resizer.value.getBoundingClientRect().bottom;
|
||||||
const maxHeight = window.innerHeight - 100 - queryFooterHeight;
|
const maxHeight = window.innerHeight - 100 - queryFooterHeight - consoleHeight.value;
|
||||||
let localEditorHeight = bottom - el.getBoundingClientRect().top;
|
let localEditorHeight = bottom - el.getBoundingClientRect().top;
|
||||||
if (localEditorHeight > maxHeight) localEditorHeight = maxHeight;
|
if (localEditorHeight > maxHeight) localEditorHeight = maxHeight;
|
||||||
if (localEditorHeight < 50) localEditorHeight = 50;
|
if (localEditorHeight < 50) localEditorHeight = 50;
|
||||||
@ -375,6 +380,7 @@ const resize = (e: MouseEvent) => {
|
|||||||
const resizeResults = () => queryTable.value.resizeResults();
|
const resizeResults = () => queryTable.value.resizeResults();
|
||||||
|
|
||||||
const onWindowResize = (e: MouseEvent) => {
|
const onWindowResize = (e: MouseEvent) => {
|
||||||
|
if (!queryEditor.value) return;
|
||||||
const el = queryEditor.value.$el;
|
const el = queryEditor.value.$el;
|
||||||
const queryFooterHeight = queryAreaFooter.value.clientHeight;
|
const queryFooterHeight = queryAreaFooter.value.clientHeight;
|
||||||
const bottom = e.pageY || resizer.value.getBoundingClientRect().bottom;
|
const bottom = e.pageY || resizer.value.getBoundingClientRect().bottom;
|
||||||
|
@ -100,6 +100,15 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
|||||||
getSelected: state => {
|
getSelected: state => {
|
||||||
if (!state.workspaces.length) return 'NEW';
|
if (!state.workspaces.length) return 'NEW';
|
||||||
if (state.selectedWorkspace) return state.selectedWorkspace;
|
if (state.selectedWorkspace) return state.selectedWorkspace;
|
||||||
|
const connectionsStore = useConnectionsStore();
|
||||||
|
if (connectionsStore.lastConnections.length) {
|
||||||
|
return connectionsStore.lastConnections.sort((a, b) => {
|
||||||
|
if (a.time < b.time) return 1;
|
||||||
|
else if (a.time > b.time) return -1;
|
||||||
|
return 0;
|
||||||
|
})[0].uid;
|
||||||
|
}
|
||||||
|
|
||||||
return state.workspaces[0].uid;
|
return state.workspaces[0].uid;
|
||||||
},
|
},
|
||||||
getWorkspace: state => (uid: string) => {
|
getWorkspace: state => (uid: string) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user