2020-05-14 15:21:57 +02:00
|
|
|
<template>
|
2020-05-17 19:34:56 +02:00
|
|
|
<div v-show="selectedWorkspace === connection.uid" class="workspace column columns">
|
2020-05-15 17:52:59 +02:00
|
|
|
<DatabaseExploreBar :connection="connection" />
|
2020-05-14 15:21:57 +02:00
|
|
|
<div class="workspace-tabs column">
|
2020-05-18 18:06:32 +02:00
|
|
|
<pre>{{ JSON.stringify(connection, null, 3) }}</pre>
|
2020-05-14 15:21:57 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-05-15 17:52:59 +02:00
|
|
|
import { mapGetters, mapActions } from 'vuex';
|
2020-05-14 15:21:57 +02:00
|
|
|
import Connection from '@/ipc-api/Connection';
|
|
|
|
import DatabaseExploreBar from '@/components/DatabaseExploreBar';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'DatabaseWorkspace',
|
|
|
|
components: {
|
|
|
|
DatabaseExploreBar
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
connection: Object
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
2020-05-17 19:34:56 +02:00
|
|
|
selectedWorkspace: 'workspaces/getSelected',
|
|
|
|
getConnected: 'workspaces/getConnected'
|
2020-05-14 15:21:57 +02:00
|
|
|
})
|
|
|
|
},
|
|
|
|
async created () {
|
2020-05-18 18:06:32 +02:00
|
|
|
this.addWorkspace(this.connection.uid);
|
2020-05-17 19:34:56 +02:00
|
|
|
const isInitiated = await Connection.checkConnection(this.connection.uid);
|
2020-05-19 18:06:05 +02:00
|
|
|
if (isInitiated)
|
|
|
|
this.connectWorkspace(this.connection);
|
2020-05-14 15:21:57 +02:00
|
|
|
},
|
|
|
|
methods: {
|
2020-05-15 17:52:59 +02:00
|
|
|
...mapActions({
|
2020-05-17 19:34:56 +02:00
|
|
|
addNotification: 'notifications/addNotification',
|
2020-05-18 18:06:32 +02:00
|
|
|
addWorkspace: 'workspaces/addWorkspace',
|
2020-05-19 18:06:05 +02:00
|
|
|
connectWorkspace: 'workspaces/connectWorkspace',
|
2020-05-17 19:34:56 +02:00
|
|
|
removeConnected: 'workspaces/removeConnected'
|
2020-05-15 17:52:59 +02:00
|
|
|
})
|
2020-05-14 15:21:57 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.workspace{
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
</style>
|