2015-06-25 17:53:03 -04:00
|
|
|
|
2015-06-25 16:26:31 -04:00
|
|
|
export default Discourse.Route.extend({
|
|
|
|
controllerName: 'admin-plugins-explorer',
|
2015-06-30 18:56:09 -04:00
|
|
|
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) {
|
2015-07-14 13:34:23 -04:00
|
|
|
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
|
|
|
}
|
|
|
|
});
|