Files
discourse-data-explorer/assets/javascripts/discourse/components/query-result.hbs
T

91 lines
2.3 KiB
Handlebars
Raw Normal View History

<article>
<header class="result-header">
<div class="result-info">
2022-12-20 12:09:37 -06:00
<DButton
@action={{this.downloadResultJson}}
@icon="download"
@label="explorer.download_json"
/>
2022-12-20 12:09:37 -06:00
<DButton
@action={{this.downloadResultCsv}}
@icon="download"
@label="explorer.download_csv"
/>
2022-12-20 12:09:37 -06:00
{{#if this.canShowChart}}
{{#if this.chartDisplayed}}
<DButton
@action={{this.hideChart}}
@icon="table"
@label="explorer.show_table"
/>
{{else}}
2022-12-20 12:09:37 -06:00
<DButton
@action={{this.showChart}}
@icon="chart-bar"
@label="explorer.show_graph"
/>
{{/if}}
{{/if}}
</div>
<div class="result-about">
2022-12-20 12:09:37 -06:00
{{this.resultCount}}
{{this.duration}}
</div>
2022-12-13 09:21:01 -06:00
<br />
2022-12-20 12:09:37 -06:00
{{~#if this.explainText}}
<pre class="result-explain">
<code>
{{~this.explainText}}
</code>
</pre>
{{~/if}}
2022-12-13 09:21:01 -06:00
<br />
</header>
<section>
2022-12-20 12:09:37 -06:00
{{#if this.chartDisplayed}}
<DataExplorerBarChart
2022-12-20 12:09:37 -06:00
@labels={{this.chartLabels}}
@values={{this.chartValues}}
@datasetName={{this.chartDatasetName}}
/>
{{else}}
<table>
<thead>
<tr class="headers">
2022-12-20 12:09:37 -06:00
{{#each this.columnNames as |col|}}
<th>{{col}}</th>
{{/each}}
</tr>
</thead>
<tbody>
2022-12-20 12:09:37 -06:00
{{#each this.rows as |row|}}
2022-12-13 09:21:01 -06:00
<QueryRowContent
@row={{row}}
@columnTemplates={{this.columnTemplates}}
@lookupUser={{this.lookupUser}}
@lookupBadge={{this.lookupBadge}}
@lookupPost={{this.lookupPost}}
@lookupTopic={{this.lookupTopic}}
@lookupGroup={{this.lookupGroup}}
@lookupCategory={{this.lookupCategory}}
2022-12-14 09:06:36 -06:00
@transformedPostTable={{this.transformedPostTable}}
2022-12-13 09:21:01 -06:00
@transformedBadgeTable={{this.transformedBadgeTable}}
@transformedUserTable={{this.transformedUserTable}}
@transformedGroupTable={{this.transformedGroupTable}}
@transformedTopicTable={{this.transformedTopicTable}}
2022-12-15 08:26:40 -06:00
@site={{this.site}}
2022-12-13 09:21:01 -06:00
/>
{{/each}}
</tbody>
</table>
{{/if}}
</section>
</article>