mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
Additions, again
This commit is contained in:
@ -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'
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user