open-nomad/ui/app/controllers/servers/server/index.js
2020-06-16 10:23:36 -07:00

25 lines
521 B
JavaScript

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