github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/mirage/factories/service.js (about) 1 import { Factory } from 'ember-cli-mirage'; 2 import faker from 'nomad-ui/mirage/faker'; 3 import { provide } from '../utils'; 4 5 export default Factory.extend({ 6 name: id => `${faker.hacker.noun().dasherize()}-${id}-service`, 7 portLabel: () => faker.hacker.noun().dasherize(), 8 tags: () => { 9 if (!faker.random.boolean()) { 10 return provide( 11 faker.random.number({ min: 0, max: 2 }), 12 faker.hacker.noun.bind(faker.hacker.noun) 13 ); 14 } else { 15 return null; 16 } 17 }, 18 Connect: { 19 SidecarService: { 20 Proxy: { 21 Upstreams: [ 22 { 23 DestinationName: faker.hacker.noun().dasherize(), 24 LocalBindPort: faker.random.number({ min: 5000, max: 60000 }), 25 }, 26 ], 27 }, 28 }, 29 }, 30 });