open-nomad/ui/app/controllers/servers/server.js
2017-10-24 12:04:08 -07:00

24 lines
436 B
JavaScript

import Ember from 'ember';
const { Controller, computed } = Ember;
export default Controller.extend({
activeTab: 'tags',
sortedTags: computed('model.tags', function() {
const tags = this.get('model.tags') || {};
return Object.keys(tags)
.map(name => ({
name,
value: tags[name],
}))
.sortBy('name');
}),
actions: {
setTab(tab) {
this.set('activeTab', tab);
},
},
});