open-nomad/ui/app/controllers/servers/server.js

23 lines
454 B
JavaScript
Raw Normal View History

import Controller from '@ember/controller';
import { computed } from '@ember/object';
2017-09-19 14:47:10 +00:00
export default Controller.extend({
activeTab: 'tags',
2017-10-24 18:29:00 +00:00
sortedTags: computed('model.tags', function() {
const tags = this.get('model.tags') || {};
return Object.keys(tags)
.map(name => ({
name,
value: tags[name],
}))
.sortBy('name');
}),
2017-09-19 14:47:10 +00:00
actions: {
setTab(tab) {
this.set('activeTab', tab);
},
},
});