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

25 lines
523 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)
2021-12-28 14:45:20 +00:00
.map((name) => ({
2017-10-24 18:29:00 +00:00
name,
value: tags[name],
}))
.sortBy('name');
}
2017-10-24 18:29:00 +00:00
@action
setTab(tab) {
this.set('activeTab', tab);
}
}