feat: approximate totals in table tata tab

This commit is contained in:
Fabio Di Stasio 2020-11-25 11:47:35 +01:00
parent e954f04828
commit e95d29c7c3
3 changed files with 12 additions and 3 deletions

View File

@ -17,7 +17,7 @@
</div>
<div class="workspace-query-info">
<div v-if="resultsCount">
{{ $t('word.results') }}: <b>{{ resultsCount }}</b>
{{ $t('word.results') }}: <b>{{ resultsCount.toLocaleString() }}</b>
</div>
<div v-if="affectedCount">
{{ $t('message.affectedRows') }}: <b>{{ affectedCount }}</b>

View File

@ -42,7 +42,10 @@
</div>
<div class="workspace-query-info">
<div v-if="results.length && results[0].rows">
{{ $t('word.results') }}: <b>{{ results[0].rows.length }}</b>
{{ $t('word.results') }}: <b>{{ results[0].rows.length.toLocaleString() }}</b>
</div>
<div v-if="results.length && results[0].rows && results[0].rows.length < tableInfo.rows">
{{ $t('word.total') }}: <b>{{ tableInfo.rows.toLocaleString() }}</b> <small>({{ $t('word.approximately') }})</small>
</div>
<div v-if="workspace.breadcrumbs.database">
{{ $t('word.schema') }}: <b>{{ workspace.breadcrumbs.database }}</b>
@ -117,6 +120,9 @@ export default {
},
keyUsage () {
return this.results.length ? this.results[0].keys : [];
},
tableInfo () {
return this.workspace.structure.find(db => db.name === this.schema).tables.find(table => table.name === this.table);
}
},
watch: {

View File

@ -55,7 +55,10 @@ module.exports = {
order: 'Order',
expression: 'Expression',
autoIncrement: 'Auto Increment',
engine: 'Engine'
engine: 'Engine',
field: 'Field | Fields',
approximately: 'Approximately',
total: 'Total'
},
message: {
appWelcome: 'Welcome to Antares SQL Client!',