2017-12-15 21:39:18 +00:00
|
|
|
import Controller from '@ember/controller';
|
2020-06-10 13:49:16 +00:00
|
|
|
import { action, computed } from '@ember/object';
|
|
|
|
import classic from 'ember-classic-decorator';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@classic
|
|
|
|
export default class ServerController extends Controller {
|
|
|
|
activeTab = 'tags';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +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');
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
2017-10-24 18:29:00 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@action
|
|
|
|
setTab(tab) {
|
|
|
|
this.set('activeTab', tab);
|
|
|
|
}
|
|
|
|
}
|