FEATURE: Show the number of results after running a query (limit 250)
This commit is contained in:
parent
68059b540e
commit
316923f190
|
@ -1,6 +1,7 @@
|
|||
import { ajax } from 'discourse/lib/ajax';
|
||||
import Badge from 'discourse/models/badge';
|
||||
import { getOwner } from 'discourse-common/lib/get-owner';
|
||||
import { default as computed } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
function randomIdShort() {
|
||||
return 'xxxxxxxx'.replace(/[xy]/g, function() {
|
||||
|
@ -29,8 +30,17 @@ const QueryResultComponent = Ember.Component.extend({
|
|||
columns: Em.computed.alias('content.columns'),
|
||||
params: Em.computed.alias('content.params'),
|
||||
explainText: Em.computed.alias('content.explain'),
|
||||
|
||||
hasExplain: Em.computed.notEmpty('content.explain'),
|
||||
|
||||
@computed('content.result_count')
|
||||
resultCount: function(count) {
|
||||
if (count === 250) {
|
||||
return I18n.t('explorer.max_result_count', { count });
|
||||
} else {
|
||||
return I18n.t('explorer.result_count', { count });
|
||||
}
|
||||
},
|
||||
|
||||
colCount: function() {
|
||||
return this.get('content.columns').length;
|
||||
}.property('content.columns.length'),
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
</div>
|
||||
|
||||
<div class="result-about">
|
||||
{{resultCount}}
|
||||
{{duration}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -52,6 +52,12 @@ en:
|
|||
download_csv: "CSV"
|
||||
others_dirty: "A query has unsaved changes that will be lost if you navigate away."
|
||||
run_time: "Query completed in {{value}} ms."
|
||||
result_count:
|
||||
one: "%{count} result."
|
||||
other: "%{count} results."
|
||||
max_result_count:
|
||||
one: "Showing top %{count} results."
|
||||
other: "Showing top %{count} results."
|
||||
query_name: "Query"
|
||||
query_description: "Description"
|
||||
query_time: "Last run"
|
||||
|
|
Loading…
Reference in New Issue