discourse-data-explorer/assets/javascripts/discourse/routes/admin-plugins-explorer.js.es6

24 lines
644 B
Plaintext
Raw Normal View History

2015-06-25 16:26:31 -04:00
export default Discourse.Route.extend({
controllerName: 'admin-plugins-explorer',
queryParams: { id: { replace: true } },
2015-06-25 16:26:31 -04:00
model() {
2015-07-08 16:45:13 -04:00
const p1 = this.store.findAll('query');
const p2 = Discourse.ajax('/admin/plugins/explorer/schema.json', {cache: true});
return p1.then(function(model) {
model.forEach(function(query) {
query.markNotDirty();
});
2015-07-08 16:45:13 -04:00
return p2.then(function(schema) {
return { content: model, schema: schema };
});
});
},
setupController: function(controller, model) {
controller.set('model', model.content);
controller.set('schema', model.schema);
2015-06-25 16:26:31 -04:00
}
});