mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-06-29 19:12:11 +00:00
FEATURE: Sort queries by names, last_run_at by clicking table headers
This commit is contained in:
parent
80f97d9514
commit
d5d933c2a8
@ -119,6 +119,13 @@ export default Ember.Controller.extend({
|
|||||||
this.save().then(() => this.send('run'));
|
this.save().then(() => this.send('run'));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
sortByProperty(property) {
|
||||||
|
if (this.sortBy == `${property}:desc`){
|
||||||
|
this.set('sortBy', [`${property}:asc`]);}
|
||||||
|
else {
|
||||||
|
this.set('sortBy', [`${property}:desc`]);
|
||||||
|
}},
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
const name = this.get("newQueryName").trim();
|
const name = this.get("newQueryName").trim();
|
||||||
this.set('loading', true);
|
this.set('loading', true);
|
||||||
|
@ -147,9 +147,18 @@
|
|||||||
{{#if sortedQueries.length}}
|
{{#if sortedQueries.length}}
|
||||||
<table class="recent-queries">
|
<table class="recent-queries">
|
||||||
<thead class="heading-container">
|
<thead class="heading-container">
|
||||||
<th class="col heading name">{{i18n 'explorer.query_name'}}</th>
|
<th {{action "sortByProperty" "name"}} class="col heading name">
|
||||||
<th class="col heading user">{{i18n 'explorer.query_user'}}</th>
|
<i class="fa fa-sort"></i>
|
||||||
<th class="col heading time">{{i18n 'explorer.query_time'}}</th>
|
{{i18n 'explorer.query_name'}}
|
||||||
|
</th>
|
||||||
|
<th {{action "sortByProperty" "username"}} class="col heading user">
|
||||||
|
<i class="fa fa-sort"></i>
|
||||||
|
{{i18n 'explorer.query_user'}}
|
||||||
|
</th>
|
||||||
|
<th {{action "sortByProperty" "last_run_at"}} class="col heading time">
|
||||||
|
<i class="fa fa-sort"></i>
|
||||||
|
{{i18n 'explorer.query_time'}}
|
||||||
|
</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tr></tr>
|
<tr></tr>
|
||||||
{{#each sortedQueries as |query|}}
|
{{#each sortedQueries as |query|}}
|
||||||
|
@ -260,6 +260,9 @@
|
|||||||
.query-desc {
|
.query-desc {
|
||||||
color: $primary-high;
|
color: $primary-high;
|
||||||
}
|
}
|
||||||
|
th:hover{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.explorer-pad-bottom {
|
.explorer-pad-bottom {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user