mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-17 12:10:39 +01:00
feat: context shortcut to disconnect from left bar
This commit is contained in:
parent
6573fe69ac
commit
e97da37103
@ -3,6 +3,13 @@
|
|||||||
:context-event="contextEvent"
|
:context-event="contextEvent"
|
||||||
@close-context="$emit('close-context')"
|
@close-context="$emit('close-context')"
|
||||||
>
|
>
|
||||||
|
<div
|
||||||
|
v-if="isConnected"
|
||||||
|
class="context-element"
|
||||||
|
@click="disconnect"
|
||||||
|
>
|
||||||
|
<span class="d-flex"><i class="mdi mdi-18px mdi-power text-light pr-1" /> {{ $t('word.disconnect') }}</span>
|
||||||
|
</div>
|
||||||
<div class="context-element" @click="duplicateConnection">
|
<div class="context-element" @click="duplicateConnection">
|
||||||
<span class="d-flex"><i class="mdi mdi-18px mdi-content-duplicate text-light pr-1" /> {{ $t('word.duplicate') }}</span>
|
<span class="d-flex"><i class="mdi mdi-18px mdi-content-duplicate text-light pr-1" /> {{ $t('word.duplicate') }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -47,7 +54,11 @@ const {
|
|||||||
const workspacesStore = useWorkspacesStore();
|
const workspacesStore = useWorkspacesStore();
|
||||||
const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore);
|
const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore);
|
||||||
|
|
||||||
const { selectWorkspace } = workspacesStore;
|
const {
|
||||||
|
selectWorkspace,
|
||||||
|
removeConnected: disconnectWorkspace,
|
||||||
|
getWorkspace
|
||||||
|
} = workspacesStore;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
contextEvent: MouseEvent,
|
contextEvent: MouseEvent,
|
||||||
@ -59,6 +70,7 @@ const emit = defineEmits(['close-context']);
|
|||||||
const isConfirmModal = ref(false);
|
const isConfirmModal = ref(false);
|
||||||
|
|
||||||
const connectionName = computed(() => getConnectionName(props.contextConnection.uid));
|
const connectionName = computed(() => getConnectionName(props.contextConnection.uid));
|
||||||
|
const isConnected = computed(() => getWorkspace(props.contextConnection.uid).connectionStatus === 'connected');
|
||||||
|
|
||||||
const confirmDeleteConnection = () => {
|
const confirmDeleteConnection = () => {
|
||||||
if (selectedWorkspace.value === props.contextConnection.uid)
|
if (selectedWorkspace.value === props.contextConnection.uid)
|
||||||
@ -88,6 +100,11 @@ const hideConfirmModal = () => {
|
|||||||
closeContext();
|
closeContext();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const disconnect = () => {
|
||||||
|
disconnectWorkspace(props.contextConnection.uid);
|
||||||
|
closeContext();
|
||||||
|
};
|
||||||
|
|
||||||
const closeContext = () => {
|
const closeContext = () => {
|
||||||
emit('close-context');
|
emit('close-context');
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user