d8c14b51a3
* Create ConsulNodeList component * Implement ConsulNodeList and the new Search/Sort to Node List page * Minor styling fix to align the first icons in composite row * Fix-up and add tests for the redesigned Node List page * Add Leader to composite row for Node List page * Add test for node leader
27 lines
665 B
JavaScript
27 lines
665 B
JavaScript
import Route from '@ember/routing/route';
|
|
import { inject as service } from '@ember/service';
|
|
import { hash } from 'rsvp';
|
|
|
|
export default Route.extend({
|
|
repo: service('repository/node'),
|
|
data: service('data-source/service'),
|
|
queryParams: {
|
|
sortBy: 'sort',
|
|
search: {
|
|
as: 'filter',
|
|
replace: true,
|
|
},
|
|
},
|
|
model: function(params) {
|
|
const dc = this.modelFor('dc').dc.Name;
|
|
const nspace = '*';
|
|
return hash({
|
|
items: this.data.source(uri => uri`/${nspace}/${dc}/nodes`),
|
|
leader: this.repo.findByLeader(dc),
|
|
});
|
|
},
|
|
setupController: function(controller, model) {
|
|
controller.setProperties(model);
|
|
},
|
|
});
|