open-nomad/ui/app/controllers/allocations/allocation/task/index.js

24 lines
635 B
JavaScript
Raw Normal View History

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() {
2017-11-14 18:50:09 +00:00
return (this.get('network.reservedPorts') || [])
.map(port => ({
name: port.Label,
port: port.Value,
isDynamic: false,
}))
.concat(
2017-11-14 18:50:09 +00:00
(this.get('network.dynamicPorts') || []).map(port => ({
name: port.Label,
port: port.Value,
isDynamic: true,
}))
)
.sortBy('name');
}),
});