~vcs-imports/elasticfox/trunk

« back to all changes in this revision

Viewing changes to src/chrome/content/ec2ui/volumesview.js

  • Committer: jhatax
  • Date: 2009-03-21 04:24:40 UTC
  • Revision ID: vcs-imports@canonical.com-20090321042440-9efsr19bbxomq3dp
This update to Elasticfox contains the following changes:

1. Tagging for AMIs and Elastic IPs
2. Fix for Register Image from the Images tab
3. Snapshot inherits tag of Volume it was created from
4. An instance in the EU can be bundled into a bucket and registered in the US and vice-versa
5. Better checks when specifying a bucket for bundling or manifest path for registering
6. An EBS volume cannot be attached to a Windows instance that is not "Ready to Use"
7. Elasticfox now supports Firefox Versions 2.0 through 3.5.*
8. The AMI Migration dialog is non-modal so that the user can continue using Elasticfox
while the migration occurs in the background

Please report any issues via sourceforge or the AWS page for Elasticfox.


M    src/install.rdf
M    src/ec2ui.rdf
M    src/install.js
M    src/chrome/content/ec2ui/eipdetaildialog.js
M    src/chrome/content/ec2ui/newattachmentdialog.js
M    src/chrome/content/ec2ui/controller.js
M    src/chrome/content/ec2ui/volumesview.js
M    src/chrome/content/ec2ui/utils.js
M    src/chrome/content/ec2ui/eipview.js
M    src/chrome/content/ec2ui/bundletasksview.js
M    src/chrome/content/ec2ui/client.js
M    src/chrome/content/ec2ui/instancesview.js
M    src/chrome/content/ec2ui/baseimagesview.js
M    src/chrome/content/ec2ui/dialog_new_volume.xul
M    src/chrome/content/ec2ui/eip_tab_overlay.xul
M    src/chrome/content/ec2ui/preferences.js
M    src/chrome/content/ec2ui/newimagedialog.js
M    src/chrome/content/ec2ui/dialog_ami_details.xul
M    src/chrome/content/ec2ui/dialog_eip_details.xul
M    src/chrome/content/ec2ui/newvolumedialog.js
M    src/chrome/content/ec2ui/amidetaildialog.js
M    src/chrome/content/ec2ui/volumedetaildialog.js
M    src/chrome/content/ec2ui/bundleInstanceDialog.js
M    src/chrome/content/ec2ui/session.js
M    src/chrome/content/ec2ui/amisview.js
M    src/chrome/content/ec2ui/model.js

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
    createSnapshot : function () {
101
101
        var image = this.getSelectedImage();
102
102
        if (image == null) return;
103
 
        var wrap = function(list) {
 
103
        var me = this;
 
104
        var wrap = function(snapId) {
 
105
            // Replicate the volume tag for this snapshot
 
106
            var tag = me.getSelectedImage().tag;
 
107
            if (tag && tag.length > 0) {
 
108
                ec2ui_session.setResourceTag(snapId, tag);
 
109
            }
104
110
            if (ec2ui_prefs.isRefreshOnChangeEnabled()) {
105
111
                ec2ui_SnapshotTreeView.refresh();
 
112
                ec2ui_SnapshotTreeView.selectByImageId(snapId);
106
113
            }
107
114
        }
108
115
        ec2ui_session.controller.createSnapshot(image.id, wrap);
110
117
 
111
118
    createVolume : function () {
112
119
        var retVal = {ok:null};
113
 
        window.openDialog("chrome://ec2ui/content/dialog_new_volume.xul", null, "chrome,centerscreen,modal", null, ec2ui_session, retVal);
 
120
        window.openDialog("chrome://ec2ui/content/dialog_new_volume.xul",
 
121
                          null,
 
122
                          "chrome,centerscreen,modal",
 
123
                          null,
 
124
                          ec2ui_session,
 
125
                          retVal);
114
126
        if (retVal.ok) {
115
127
            var me = this;
116
 
            var wrap = function(list) {
117
 
                if (ec2ui_prefs.isRefreshOnChangeEnabled()) {
118
 
                    me.refresh();
 
128
            var wrap = function(id) {
 
129
                me.refresh();
 
130
                me.selectByImageId(id);
 
131
            }
 
132
            ec2ui_session.controller.createVolume(retVal.size,
 
133
                                                  retVal.snapshotId,
 
134
                                                  retVal.zone,
 
135
                                                  wrap);
 
136
 
 
137
            // Let's tag this volume
 
138
            if (retVal.tag) {
 
139
                var vol = this.getSelectedImage();
 
140
                if (vol) {
 
141
                    vol.tag = retVal.tag;
 
142
                    ec2ui_session.setResourceTag(vol.id, vol.tag);
119
143
                }
120
144
            }
121
 
            ec2ui_session.controller.createVolume(
122
 
                retVal.size,
123
 
                retVal.snapshotId,
124
 
                retVal.zone,
125
 
                wrap);
126
145
        }
127
146
    },
128
147
 
132
151
        var confirmed = confirm("Delete volume " + image.id + "?");
133
152
        if (!confirmed)
134
153
            return;
135
 
        var wrap = function(list) {
 
154
        var wrap = function() {
136
155
            if (ec2ui_prefs.isRefreshOnChangeEnabled()) {
137
156
                ec2ui_VolumeTreeView.refresh();
138
157
            }
149
168
        log("Device Selected for instance: " + device);
150
169
 
151
170
        var me = this;
152
 
        var wrap = function(list) {
 
171
        var wrap = function() {
153
172
            if (ec2ui_prefs.isRefreshOnChangeEnabled()) {
154
173
                me.refresh();
155
174
            }
156
175
        }
157
176
 
158
 
        ec2ui_session.controller.attachVolume(
159
 
            volumeId,
160
 
            instId,
161
 
            device,
162
 
            wrap);
 
177
        ec2ui_session.controller.attachVolume(volumeId,
 
178
                                              instId,
 
179
                                              device,
 
180
                                              wrap);
163
181
    },
164
182
 
165
183
    attachVolume : function () {
166
184
        var image = this.getSelectedImage();
167
185
        if (image == null) return;
168
186
        var retVal = {ok:null};
169
 
        window.openDialog("chrome://ec2ui/content/dialog_new_attachment.xul", null, "chrome,centerscreen,modal", image, ec2ui_session, retVal);
170
 
        if (retVal.ok) {
171
 
            if (retVal.device.length == 0) {
172
 
                // If this is a Windows instance, the device should be windows_device
 
187
        while (true) {
 
188
            window.openDialog("chrome://ec2ui/content/dialog_new_attachment.xul",
 
189
                              null,
 
190
                              "chrome,centerscreen,modal",
 
191
                              image,
 
192
                              ec2ui_session,
 
193
                              retVal);
 
194
            if (retVal.ok) {
 
195
                // If this is a Windows instance,
 
196
                // the device should be windows_device
 
197
                // and the instance should be ready to use
173
198
                var instances = ec2ui_session.model.getInstances();
 
199
                var instance = null;
174
200
                for (var i in instances) {
175
 
                    if (instances[i].id == retVal.instanceId) {
176
 
                        if (isWindows(instances[i].platform)) {
 
201
                    instance = instances[i];
 
202
                    if (instance.id == retVal.instanceId) {
 
203
                        if (!ec2ui_InstancesTreeView.isInstanceReadyToUse(instance)) {
 
204
                            // The selected instance is not ready to
 
205
                            // use. Repeat.
 
206
                            continue;
 
207
                        }
 
208
                        if (isWindows(instance.platform)) {
177
209
                            retVal.device = "windows_device";
178
210
                        }
179
211
                        // The 2 if conditions aren't folded into 1
182
214
                        break;
183
215
                    }
184
216
                }
 
217
                this.attachEBSVolume(retVal.volumeId, retVal.instanceId, retVal.device);
185
218
            }
186
 
            this.attachEBSVolume(retVal.volumeId, retVal.instanceId, retVal.device);
 
219
            break;
187
220
        }
188
221
    },
189
222
 
223
256
        var confirmed = confirm("Detach volume " + image.id + "?");
224
257
        if (!confirmed)
225
258
            return;
226
 
        var wrap = function(list) {
 
259
        var wrap = function() {
227
260
            if (ec2ui_prefs.isRefreshOnChangeEnabled()) {
228
261
                ec2ui_VolumeTreeView.refresh();
229
262
            }
237
270
        var confirmed = confirm("Force detach volume " + image.id + "?");
238
271
        if (!confirmed)
239
272
            return;
240
 
        var wrap = function(list) {
 
273
        var wrap = function() {
241
274
            if (ec2ui_prefs.isRefreshOnChangeEnabled()) {
242
275
                ec2ui_VolumeTreeView.refresh();
243
276
            }