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

feat(UI): query duration calc

This commit is contained in:
2021-02-26 18:45:00 +01:00
parent 4494e637f7
commit 777b73fa6f
4 changed files with 25 additions and 3 deletions

View File

@ -26,6 +26,13 @@
</button>
</div>
<div class="workspace-query-info">
<div
v-if="results.length"
class="d-flex"
:title="$t('message.queryDuration')"
>
<i class="mdi mdi-timer-sand mdi-rotate-180 pr-1" /> <b>{{ durationsCount / 1000 }}s</b>
</div>
<div v-if="resultsCount">
{{ $t('word.results') }}: <b>{{ resultsCount.toLocaleString() }}</b>
</div>
@ -84,6 +91,7 @@ export default {
isQuering: false,
results: [],
resultsCount: 0,
durationsCount: 0,
affectedCount: 0,
editorHeight: 200
};
@ -143,6 +151,7 @@ export default {
if (status === 'success') {
this.results = Array.isArray(response) ? response : [response];
this.resultsCount += this.results.reduce((acc, curr) => acc + (curr.rows ? curr.rows.length : 0), 0);
this.durationsCount += this.results.reduce((acc, curr) => acc + curr.duration, 0);
this.affectedCount += this.results.reduce((acc, curr) => acc + (curr.report ? curr.report.affectedRows : 0), 0);
}
else
@ -161,6 +170,7 @@ export default {
clearTabData () {
this.results = [];
this.resultsCount = 0;
this.durationsCount = 0;
this.affectedCount = 0;
},
resize (e) {