New namespaces model
This commit is contained in:
parent
3bb0a9779c
commit
4481e04d43
|
@ -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'),
|
||||
});
|
|
@ -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()),
|
||||
|
|
|
@ -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: '',
|
||||
});
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue