From ff35c8f76cc52424574c9ab42b2f719ee96113eb Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 6 Oct 2017 18:27:36 -0700 Subject: [PATCH] New namespaces model --- ui/app/models/namespace.js | 8 ++++++++ ui/mirage/config.js | 3 +++ ui/mirage/factories/namespace.js | 10 ++++++++++ ui/mirage/scenarios/default.js | 4 ++++ 4 files changed, 25 insertions(+) create mode 100644 ui/app/models/namespace.js create mode 100644 ui/mirage/factories/namespace.js diff --git a/ui/app/models/namespace.js b/ui/app/models/namespace.js new file mode 100644 index 000000000..1fa82eba7 --- /dev/null +++ b/ui/app/models/namespace.js @@ -0,0 +1,8 @@ +import Model from 'ember-data/model'; +import attr from 'ember-data/attr'; + +export default Model.extend({ + name: attr('string'), + hash: attr('string'), + description: attr('string'), +}); diff --git a/ui/mirage/config.js b/ui/mirage/config.js index 07566d72c..f4a0bb502 100644 --- a/ui/mirage/config.js +++ b/ui/mirage/config.js @@ -58,6 +58,9 @@ export default function() { this.get('/allocation/:id'); + this.get('/namespaces'); + this.get('/namespace/:id'); + this.get('/agent/members', function({ agents }) { return { Members: this.serialize(agents.all()), diff --git a/ui/mirage/factories/namespace.js b/ui/mirage/factories/namespace.js new file mode 100644 index 000000000..22eb4531a --- /dev/null +++ b/ui/mirage/factories/namespace.js @@ -0,0 +1,10 @@ +import { Factory, faker } from 'ember-cli-mirage'; + +export default Factory.extend({ + id: i => `namespace-${i}`, + name() { + return this.id; + }, + hash: () => faker.random.uuid(), + description: '', +}); diff --git a/ui/mirage/scenarios/default.js b/ui/mirage/scenarios/default.js index 2c4a0b07b..729b4e6a8 100644 --- a/ui/mirage/scenarios/default.js +++ b/ui/mirage/scenarios/default.js @@ -1,5 +1,9 @@ export default function(server) { server.createList('agent', 3); server.createList('node', 50); + + server.create('namespace', { id: 'default' }); + server.createList('namespace', 3); + server.createList('job', 15); }