Update URL. Regression - select2 not updating
This commit is contained in:
parent
6852f69cd7
commit
a81f8495b0
|
@ -3,12 +3,13 @@ import Query from 'discourse/plugins/discourse-data-explorer/discourse/models/qu
|
|||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||
|
||||
export default Ember.ArrayController.extend({
|
||||
queryParams: { selectedQueryId: "id" },
|
||||
selectedQueryId: null,
|
||||
results: null,
|
||||
showResults: false,
|
||||
loading: false,
|
||||
|
||||
explain: false,
|
||||
explain: true,
|
||||
|
||||
saveDisabled: Ember.computed.not('selectedItem.dirty'),
|
||||
runDisabled: Ember.computed.alias('selectedItem.dirty'),
|
||||
|
@ -133,7 +134,7 @@ export default Ember.ArrayController.extend({
|
|||
type: "POST",
|
||||
data: {
|
||||
params: JSON.stringify(this.get('selectedItem.params')),
|
||||
explain: true
|
||||
explain: this.get('explain')
|
||||
}
|
||||
}).then(function(result) {
|
||||
if (!result.success) {
|
||||
|
|
|
@ -3,6 +3,5 @@ export default {
|
|||
path: '/plugins',
|
||||
map() {
|
||||
this.route('explorer');
|
||||
this.route('explorer-show', {path: 'explorer/:id'});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
export default Discourse.Route.extend({
|
||||
model(params) {
|
||||
return this.store.find('query', params.get('id'));
|
||||
}
|
||||
});
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
controllerName: 'admin-plugins-explorer',
|
||||
queryParams: { id: { replace: true } },
|
||||
|
||||
model() {
|
||||
return this.store.findAll('query');
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="bool-options">
|
||||
<label>{{input type="checkbox" checked=explain name="explain"}} {{i18n "explorer.explain_label"}}</label>
|
||||
</div>
|
||||
{{d-button action="run" label="explorer.run" disabled=runDisabled}}
|
||||
</div>
|
||||
<hr>
|
||||
|
|
|
@ -7,9 +7,13 @@
|
|||
{{duration}}
|
||||
</div>
|
||||
</div>
|
||||
{{#if hasExplain}}
|
||||
<pre><code>{{content.explain}}</code></pre>
|
||||
{{/if}}
|
||||
|
||||
{{~#if hasExplain}}
|
||||
<pre><code>
|
||||
{{~content.explain}}
|
||||
</code></pre>
|
||||
{{~/if}}
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="headers">
|
||||
|
|
|
@ -28,6 +28,13 @@
|
|||
.clear { clear: both; }
|
||||
}
|
||||
|
||||
.query-list, .query-edit, .query-results {
|
||||
.query-params {
|
||||
border: 1px solid dark-light-diff($primary, $secondary, 60%, -20%);
|
||||
input {
|
||||
margin: 9px;
|
||||
}
|
||||
}
|
||||
|
||||
.query-list, .query-edit, .query-results, .query-params {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
|
|
@ -37,3 +37,4 @@ en:
|
|||
download_json: "Save Query Results"
|
||||
run_time: "Query completed in {{value}} ms."
|
||||
column: "Column {{number}}"
|
||||
explain_label: "Include query plan?"
|
||||
|
|
|
@ -276,7 +276,7 @@ SQL
|
|||
end
|
||||
query.save
|
||||
|
||||
render_serialized query, DataExplorer::QuerySerializer, root: true
|
||||
render_serialized query, DataExplorer::QuerySerializer, root: 'query'
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
@ -290,7 +290,7 @@ SQL
|
|||
query = DataExplorer::Query.find(params[:id].to_i)
|
||||
query_params = MultiJson.load(params[:params])
|
||||
opts = {current_user: current_user.username}
|
||||
opts[:explain] = true if params[:explain]
|
||||
opts[:explain] = true if params[:explain] == "true"
|
||||
result = DataExplorer.run_query(query, query_params, opts)
|
||||
|
||||
if result[:error]
|
||||
|
@ -340,6 +340,7 @@ SQL
|
|||
|
||||
DataExplorer::Engine.routes.draw do
|
||||
root to: "query#index"
|
||||
|
||||
get 'queries' => "query#index"
|
||||
post 'queries' => "query#create"
|
||||
get 'queries/:id' => "query#show"
|
||||
|
|
Loading…
Reference in New Issue