import { alias } from '@ember/object/computed'; import Service from 'ui/models/service'; import Ember from 'ember'; const esc = Ember.Handlebars.Utils.escapeExpression; var KubernetesService = Service.extend({ type: 'kubernetesService', spec: alias('template.spec'), displayPorts: function() { var pub = ''; (this.get('spec.ports')||[]).forEach((port, idx) => { pub += '' + (idx === 0 ? '' : ', ') + esc(port.port) + ''; }); var out = '' + (pub||'None'); return out.htmlSafe(); }.property('spec.ports.[]'), }); export default KubernetesService;