fix: approximate row count shown for results less than 1000

This commit is contained in:
Fabio Di Stasio 2021-04-15 10:13:55 +02:00
parent 90fd9db917
commit a6b75ad0dc
2 changed files with 10 additions and 1 deletions

View File

@ -74,7 +74,7 @@
<div v-if="results.length && results[0].rows">
{{ $t('word.results') }}: <b>{{ results[0].rows.length.toLocaleString() }}</b>
</div>
<div v-if="results.length && results[0].rows && tableInfo && results[0].rows.length < tableInfo.rows">
<div v-if="hasApproximately">
{{ $t('word.total') }}: <b>{{ tableInfo.rows.toLocaleString() }}</b> <small>({{ $t('word.approximately') }})</small>
</div>
<div v-if="workspace.breadcrumbs.database">
@ -179,6 +179,13 @@ export default {
catch (err) {
return { rows: 0 };
}
},
hasApproximately () {
return this.results.length &&
this.results[0].rows &&
this.tableInfo &&
this.results[0].rows.length === 1000 &&
this.results[0].rows.length < this.tableInfo.rows;
}
},
watch: {

View File

@ -99,6 +99,7 @@ body {
.modal-container,
.modal-sm .modal-container {
padding: 0;
border-radius: 3px;
.modal-header {
padding: 0.4rem 0.8rem;
@ -106,6 +107,7 @@ body {
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 3px 3px 0 0;
}
}
}