open-nomad/ui/app/controllers/servers/server/index.js
2022-01-20 09:46:45 -05:00

25 lines
523 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);
}
}