mirror of https://github.com/Fabio286/antares.git
Additions
This commit is contained in:
parent
5e03321eec
commit
cb9d32d9d2
|
@ -8,7 +8,7 @@
|
||||||
id="main-loader"
|
id="main-loader"
|
||||||
:is-loading="isLoading"
|
:is-loading="isLoading"
|
||||||
/> -->
|
/> -->
|
||||||
<TheAppWelcome @newConn="showNewConnModal" />
|
<TheAppWelcome v-if="!connections.length" @newConn="showNewConnModal" />
|
||||||
</div>
|
</div>
|
||||||
<TheFooter />
|
<TheFooter />
|
||||||
<ModalNewConnection v-if="isNewConnModal" />
|
<ModalNewConnection v-if="isNewConnModal" />
|
||||||
|
@ -39,7 +39,8 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
isLoading: 'application/isLoading',
|
isLoading: 'application/isLoading',
|
||||||
isNewConnModal: 'connections/isNewModal'
|
isNewConnModal: 'connections/isNewModal',
|
||||||
|
connections: 'connections/getConnections'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -152,7 +152,8 @@ export default {
|
||||||
port: '3306',
|
port: '3306',
|
||||||
user: 'root',
|
user: 'root',
|
||||||
password: '',
|
password: '',
|
||||||
ask: false
|
ask: false,
|
||||||
|
uid: Math.random().toString(36).substr(2, 9).toUpperCase()
|
||||||
},
|
},
|
||||||
toast: {
|
toast: {
|
||||||
status: '',
|
status: '',
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
<div class="settingbar-top-elements">
|
<div class="settingbar-top-elements">
|
||||||
<ul class="settingbar-elements">
|
<ul class="settingbar-elements">
|
||||||
<li
|
<li
|
||||||
v-for="(connection, key) in connections"
|
v-for="connection in connections"
|
||||||
:key="key"
|
:key="connection.uid"
|
||||||
class="settingbar-element btn btn-link tooltip tooltip-right p-0"
|
class="settingbar-element btn btn-link tooltip tooltip-right p-0"
|
||||||
|
:class="{'selected': connection.uid === selectedConnection}"
|
||||||
:data-tooltip="`${connection.user}@${connection.host}:${connection.port}`"
|
:data-tooltip="`${connection.user}@${connection.host}:${connection.port}`"
|
||||||
>
|
>
|
||||||
<i class="dbi" :class="`dbi-${connection.client}`" />
|
<i class="dbi" :class="`dbi-${connection.client}`" />
|
||||||
|
@ -37,13 +38,15 @@ export default {
|
||||||
name: 'TheSettingBar',
|
name: 'TheSettingBar',
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
connections: 'connections/getConnections'
|
connections: 'connections/getConnections',
|
||||||
|
selectedConnection: 'connections/getSelected'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
showNewConnModal: 'connections/showNewConnModal'
|
showNewConnModal: 'connections/showNewConnModal'
|
||||||
})
|
}),
|
||||||
|
isActiveTab: uid => uid === this.selectedConnection
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -5,10 +5,16 @@ export default {
|
||||||
strict: true,
|
strict: true,
|
||||||
state: {
|
state: {
|
||||||
connections: [],
|
connections: [],
|
||||||
is_new_modal: false
|
is_new_modal: false,
|
||||||
|
connection_selected: null
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
getConnections: state => state.connections,
|
getConnections: state => state.connections,
|
||||||
|
getSelected: state => {
|
||||||
|
if (state.connection_selected) return state.connection_selected;
|
||||||
|
if (state.connections.length) return state.connections[0].uid;
|
||||||
|
return null;
|
||||||
|
},
|
||||||
isNewModal: state => state.is_new_modal
|
isNewModal: state => state.is_new_modal
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
|
Loading…
Reference in New Issue