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

Additions, again

This commit is contained in:
2020-05-19 18:06:05 +02:00
parent c23deb3760
commit f5917de5d0
5 changed files with 37 additions and 39 deletions

View File

@ -20,11 +20,6 @@ export default {
props: {
connection: Object
},
data () {
return {
structure: null
};
},
computed: {
...mapGetters({
selectedWorkspace: 'workspaces/getSelected',
@ -34,26 +29,14 @@ export default {
async created () {
this.addWorkspace(this.connection.uid);
const isInitiated = await Connection.checkConnection(this.connection.uid);
if (isInitiated) {
try {
const { status, response } = await Connection.connect(this.connection);
if (status === 'success') {
this.structure = response;
this.addConnected(this.connection.uid);
}
else
this.addNotification({ status, message: response });
}
catch (err) {
this.addNotification({ status: 'error', message: err.toString() });
}
}
if (isInitiated)
this.connectWorkspace(this.connection);
},
methods: {
...mapActions({
addNotification: 'notifications/addNotification',
addWorkspace: 'workspaces/addWorkspace',
addConnected: 'workspaces/addConnected',
connectWorkspace: 'workspaces/connectWorkspace',
removeConnected: 'workspaces/removeConnected'
})
}