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

25 lines
521 B
JavaScript
Raw Normal View History

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