antares/src/renderer/components/DatabaseWorkspace.vue

52 lines
1.3 KiB
Vue
Raw Normal View History

2020-05-14 15:21:57 +02:00
<template>
<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({
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);
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({
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',
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>