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

Performance improvements

This commit is contained in:
2020-06-13 18:14:32 +02:00
parent 68b128c550
commit 3e13b9962d
6 changed files with 23 additions and 4 deletions

View File

@ -38,7 +38,7 @@ import WorkspaceQueryTable from '@/components/WorkspaceQueryTable';
import { mapGetters, mapActions } from 'vuex';
export default {
name: 'WorkspaceQueryTab',
name: 'WorkspaceTableTab',
components: {
WorkspaceQueryTable
},
@ -49,7 +49,8 @@ export default {
data () {
return {
isQuering: false,
results: {}
results: {},
lastTable: null
};
},
computed: {
@ -59,13 +60,25 @@ export default {
workspace () {
return this.getWorkspace(this.connection.uid);
},
isSelected () {
return this.workspace.selected_tab === 1;
},
query () {
return `SELECT * FROM \`${this.table}\` LIMIT 1000`;// TODO: use query builder
}
},
watch: {
table: function () {
this.runQuery();
if (this.isSelected) {
this.runQuery();
this.lastTable = this.table;
}
},
isSelected: function (val) {
if (val && this.lastTable !== this.table) {
this.runQuery();
this.lastTable = this.table;
}
}
},
created () {