Revision a6c6857c snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/ember/controllers/volume.js
b/snf-cyclades-app/synnefo/ui/new_ui/ui/javascripts/ember/controllers/volume.js | ||
---|---|---|
1 |
App.VolumeController = Ember.ObjectController.extend({ |
|
2 |
|
|
3 |
icon: 'snf-volume-full', |
|
1 |
App.VolumeController = App.ItemsItemController.extend({ |
|
4 | 2 |
|
5 | 3 |
codeName: 'volume', |
6 | 4 |
|
... | ... | |
9 | 7 |
return _.map(enabledActions, function(val,key) {return actionsMetaVolume[val]; }); |
10 | 8 |
}.property('model.enabledActions'), |
11 | 9 |
|
12 |
actions: { |
|
13 |
|
|
14 |
modalConnect: function(){ |
|
15 |
var component = Ember.View.views["modal-connect"]; |
|
16 |
component.set('message', 'connect to your <3 ' + this.get('model').get('name')); |
|
17 |
component.set('okCallback', _.bind(function() { |
|
18 |
|
|
19 |
alert("restarting " + this.get('model').get('name')); |
|
20 |
}, this)); |
|
21 |
$("#modal-connect").foundation('reveal', 'open'); |
|
22 |
}, |
|
23 |
|
|
24 |
modalStart: function(){ |
|
25 |
$("#modal-start").foundation('reveal', 'open'); |
|
26 |
}, |
|
27 |
|
|
28 |
modalShutdown: function(){ |
|
29 |
$("#modal-shutdown").foundation('reveal', 'open'); |
|
30 |
}, |
|
31 |
|
|
32 |
modalReboot: function(){ |
|
33 |
$("#modal-reboot").foundation('reveal', 'open'); |
|
34 |
var component = Ember.View.views["modal-reboot"]; |
|
35 |
component.set('message', '<p>Are you sure you want to reboot you Volume <strong>' + this.get('model').get('name')+'</strong> ?</p>'); |
|
36 |
component.set('okCallback', _.bind(function() { |
|
37 |
this.get('model').set('state','rebooting'); |
|
38 |
$("#modal-reboot").foundation('reveal','close'); |
|
39 |
}, this)); |
|
40 |
}, |
|
41 |
|
|
42 |
modalDestroy: function(){ |
|
43 |
$("#modal-destroy").foundation('reveal', 'open'); |
|
44 |
var component = Ember.View.views["modal-destroy"]; |
|
45 |
component.set('message', '<p>Are you sure you want to delete you Volume <strong>' + this.get('model').get('name')+'</strong> ?</p>'); |
|
46 |
component.set('okCallback', _.bind(function() { |
|
47 |
this.get('model').deleteRecord(); |
|
48 |
this.get('model').save(); |
|
49 |
$("#modal-destroy").foundation('reveal','close'); |
|
50 |
}, this)); |
|
51 |
}, |
|
52 | 10 |
|
53 |
}, |
|
54 | 11 |
}); |
Also available in: Unified diff