antares/src/renderer/components/DatabaseWorkspace.vue

60 lines
1.5 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-20 18:00:14 +02:00
<pre>{{ JSON.stringify(workspace.structure, 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',
2020-05-20 18:00:14 +02:00
getWorkspace: 'workspaces/getWorkspace'
}),
workspace () {
return this.getWorkspace(this.connection.uid);
}
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;
2020-05-20 18:00:14 +02:00
.workspace-tabs{
overflow: auto;
height: calc(100vh - #{$footer-height});
}
2020-05-14 15:21:57 +02:00
}
</style>