1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

Notifications board

This commit is contained in:
2020-05-15 17:52:59 +02:00
parent aea94f0325
commit 55b1991869
15 changed files with 363 additions and 26 deletions

View File

@ -1,18 +1,14 @@
<template>
<div v-show="selectedConnection === connection.uid" class="workspace column columns">
<DatabaseExploreBar
:uid="connection.uid"
:is-connected="isConnected"
@connect="startConnection"
/>
<DatabaseExploreBar :connection="connection" />
<div class="workspace-tabs column">
<p>{{ connection.uid }}</p>
<p>{{ connection }}</p>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { mapGetters, mapActions } from 'vuex';
import Connection from '@/ipc-api/Connection';
import DatabaseExploreBar from '@/components/DatabaseExploreBar';
@ -26,7 +22,6 @@ export default {
},
data () {
return {
isConnected: false,
structure: null
};
},
@ -37,14 +32,19 @@ export default {
},
async created () {
this.isConnected = await Connection.checkConnection(this.connection.uid);
if (this.isConnected)
this.structure = await Connection.connect(this.connection);// TODO: use refresh
if (this.isConnected) {
try {
this.structure = await Connection.connect(this.connection);// TODO: use refresh
}
catch (err) {
this.addNotification({ status: 'error', message: err.stack });
}
}
},
methods: {
async startConnection () {
this.structure = await Connection.connect(this.connection);
this.isConnected = true;
}
...mapActions({
addNotification: 'notifications/addNotification'
})
}
};
</script>