Revision 0e2122e7 snf-cyclades-app/synnefo/ui/new_ui/ui/app/models/vm.js

b/snf-cyclades-app/synnefo/ui/new_ui/ui/app/models/vm.js
1
App.Vm = DS.Model.extend({
2

  
3
    name      : DS.attr(),
4
    status    : DS.attr(),
5
    os        : DS.attr(),
6
    link      : DS.attr(),
7
    created   : DS.attr('date'), 
8
    updated   : DS.attr('date'), 
9
    tags      : DS.hasMany('tag', { async:true }),
10
    volumes   : DS.hasMany('volume', { async:true}),
11
    ports     : DS.hasMany('port', { async: true}),
12

  
13
    /*flavor   : DS.attr('raw'),*/
14

  
15
    enabledActions: function() {
16
        return statusActionsVm[this.get('status')].enabledActions;
17
    }.property('status'),
18

  
19
});
20

  
21

  
22
App.Vm.FIXTURES = [
23
    {
24
        created: '2011-04-19T10:18:52.085737+00:00',
25
        id: 1,
26
        metadata: { foo: "bar"},
27
        name: "The answer to everything",
28
        os: 'windows',
29
        status: "running",
30
        link: 'http://www.in.gr',
31
        updated: "2011-05-29T14:07:07.037602+00:00",
32
        tags: [1,2,3],
33
        volumes: [1,2],
34
        ports: [1,2,6],
35
    }, 
36
    {
37
        id: 2,
38
        name: 'My even cooler VM 2 that has a long name',
39
        status: 'error',
40
        os: 'unknown',
41
        link: 'http://www.in.gr',
42
        updated: "2011-05-29T14:07:07.037602+00:00",
43
        tags: [4,5,6],
44
        volumes: [3],
45
        ports: [3],
46
    },
47
    {
48
        id: 3,
49
        name: 'My cool VM 3',
50
        status: 'building',
51
        os: 'windows',
52
        link: 'http://www.in.gr',
53
        tags: [7],
54
        ports: [4,5],
55
    },
56
    {
57
        id: 4,
58
        name: 'So awesome VM 4',
59
        status: 'off',
60
        os: 'fedora',
61
        link: 'www.france24.fr',
62
        tags: [8],
63
    },
64
    {
65
        id: 5,
66
        name: 'olga',
67
        status: 'rebooting',
68
        os: 'kubuntu',
69
        link: 'http://www.in.gr',
70
        tags: [9],
71
    },
72
    {
73
        id: 6,
74
        name: 'athina',
75
        status: 'starting',
76
        os: 'kubuntu',
77
        link: 'http://www.in.gr',
78
    },
79
    {
80
        id: 7,
81
        name: 'kpap',
82
        status: 'shutting',
83
        os: 'kubuntu',
84
        link: 'http://www.in.gr',
85
    },
86
];

Also available in: Unified diff