open-nomad/ui/app/controllers/allocations/allocation/task/index.js
Michael Lange 71bc408f6c Remold the allocation detail and task detail pages
Now that there is a task detail page, some of the content from
the allocation detail page is better suited there.
2017-11-14 11:08:51 -08:00

24 lines
619 B
JavaScript

import Ember from 'ember';
const { Controller, computed } = Ember;
export default Controller.extend({
network: computed.alias('model.resources.networks.firstObject'),
ports: computed('network.reservedPorts.[]', 'network.dynamicPorts.[]', function() {
return this.get('network.reservedPorts')
.map(port => ({
name: port.Label,
port: port.Value,
isDynamic: false,
}))
.concat(
this.get('network.dynamicPorts').map(port => ({
name: port.Label,
port: port.Value,
isDynamic: true,
}))
)
.sortBy('name');
}),
});