Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / ember / routes / vm.js @ 631f7329

History | View | Annotate | Download (1.1 kB)

1
App.VmRoute = Ember.Route.extend({
2

    
3
    redirect: function() {
4
       this.transitionTo('vm.info'); 
5
    },
6

    
7
    renderTemplate: function() {
8
        
9
        this.render('details');
10

    
11
        this.render('lt-bar', {
12
            into: 'details',
13
            outlet: 'lt-bar',
14
            controller: 'vms',
15
        });
16
    },
17
});
18

    
19

    
20
App.VminitRoute = Ember.Route.extend({
21

    
22
  model: function(){
23
      return this.store.find('vm');
24
  },
25

    
26
  afterModel: function(model) {
27
       this.transitionTo('vm', model.get('firstObject').id);
28
  },
29

    
30
});
31

    
32
App.VmInfoRoute = Ember.Route.extend({
33
    renderTemplate: function() {
34
        this.render('details/info');
35
    },
36
    model: function () {
37
        return this.modelFor("vm");
38
    },
39
});
40

    
41
App.VmDiskConnectedRoute = Ember.Route.extend({
42
    renderTemplate: function() {
43
        this.render('details/disk-connected');
44
    },
45
    model: function () {
46
        return this.modelFor("vm");
47
    }
48
});
49

    
50
App.VmNetworkConnectedRoute = Ember.Route.extend({
51
    renderTemplate: function() {
52
        this.render('details/network-connected');
53
    },
54
    model: function () {
55
        return this.modelFor("vm");
56
    }
57
});