~vcs-imports/elasticfox/trunk

« back to all changes in this revision

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

  • Committer: jhatax
  • Date: 2009-05-21 23:27:40 UTC
  • Revision ID: vcs-imports@canonical.com-20090521232740-bi5hmpcscpub0ar4
In this Release:
- Reserved Instances support comes to Elasticfox

Bug fixes to/for:
- EBS volume attachment to an instance from both the instances and volumes view
- Strict Javascript warnings

M    trunk/src/chrome/locale/ec2ui/en-US/ec2ui.dtd
A    trunk/src/chrome/content/ec2ui/dialog_purchase_offering.xul
A    trunk/src/chrome/content/ec2ui/dialog_offering_details.xul
M    trunk/src/chrome/content/ec2ui/eipdetaildialog.js
M    trunk/src/chrome/content/ec2ui/controller.js
M    trunk/src/chrome/content/ec2ui/volumesview.js
M    trunk/src/chrome/content/ec2ui/securitygroupdetaildialog.js
M    trunk/src/chrome/content/ec2ui/dialog_volume_details.xul
M    trunk/src/chrome/content/ec2ui/utils.js
A    trunk/src/chrome/content/ec2ui/offeringdetaildialog.js
M    trunk/src/chrome/content/ec2ui/attachebsvolumedialog.js
A    trunk/src/chrome/content/ec2ui/dialog_reserved_instances_details.xul
M    trunk/src/chrome/content/ec2ui/client.js
M    trunk/src/chrome/content/ec2ui/bundletaskdetailsdialog.js
M    trunk/src/chrome/content/ec2ui/instancesview.js
A    trunk/src/chrome/content/ec2ui/reservedinstancesdetaildialog.js
M    trunk/src/chrome/content/ec2ui/dialog_new_volume.xul
M    trunk/src/chrome/content/ec2ui/permissiondetaildialog.js
M    trunk/src/chrome/content/ec2ui/keypairdetaildialog.js
A    trunk/src/chrome/content/ec2ui/purchaseofferingdialog.js
M    trunk/src/chrome/content/ec2ui/dialog_new_attachment.xul
M    trunk/src/chrome/content/ec2ui/dialog_snapshot_details.xul
A    trunk/src/chrome/content/ec2ui/reservedinstancesview.js
A    trunk/src/chrome/content/ec2ui/leaseofferingsview.js
AM   trunk/src/chrome/content/ec2ui/images/cash.png
M    trunk/src/chrome/content/ec2ui/dialog_attach_ebs_volume.xul
A    trunk/src/chrome/content/ec2ui/leases_tab_overlay.xul
M    trunk/src/chrome/content/ec2ui/snapshotdetaildialog.js
M    trunk/src/chrome/content/ec2ui/instancedetaildialog.js
M    trunk/src/chrome/content/ec2ui/volumedetaildialog.js
M    trunk/src/chrome/content/ec2ui/bundleInstanceDialog.js
M    trunk/src/chrome/content/ec2ui/session.js
M    trunk/src/chrome/content/ec2ui/ec2ui_main_window.xul
M    trunk/src/chrome/content/ec2ui/model.js

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
            document.getElementById("ec2ui.volumes.view").view = ec2ui_VolumeTreeView;
36
36
            document.getElementById("ec2ui.snapshots.view").view = ec2ui_SnapshotTreeView;
37
37
            document.getElementById("ec2ui.bundleTasks.view").view = ec2ui_BundleTasksTreeView;
 
38
            document.getElementById("ec2ui.offerings.view").view = ec2ui_LeaseOfferingsTreeView;
 
39
            document.getElementById("ec2ui.rsvdInst.view").view = ec2ui_ReservedInstancesTreeView;
38
40
 
 
41
            // Enable about:blank to work if noscript is installed
39
42
            if("@maone.net/noscript-service;1" in Components.classes) {
40
43
                (Components.classes ["@maone.net/noscript-service;1"].getService().wrappedJSObject).setJSEnabled("about:blank", true);
41
44
            }
44
47
            this.loadCredentials();
45
48
            this.switchCredentials();
46
49
            this.loadAllTags();
47
 
            this.controller.describeImages();
48
50
 
49
51
            this.initialized = true;
50
52
        }
51
53
 
52
54
        this.loadEndpointMap();
53
55
        this.switchEndpoints();
 
56
        this.args = this.parseURL();
 
57
        this.processURLArguments();
 
58
    },
 
59
 
 
60
    parseURL : function () {
 
61
        var a = window.location.href.split("?");
 
62
        if (a[1]) a = a[1].split("&");
 
63
        var o = {};
 
64
        for (var i = 0; i < a.length; ++i) {
 
65
            var parts = a[i].split("=");
 
66
            o[parts[0]] = parts[1];
 
67
        }
 
68
        return o;
 
69
    },
 
70
 
 
71
    processURLArguments : function () {
 
72
        // At this moment, we only act on the ami argument
 
73
        var fSync = false;
 
74
        var amiToLaunch = this.args.ami;
 
75
        var tabBox = document.getElementById("ec2ui.primary.tabs");
 
76
        if (amiToLaunch &&
 
77
            amiToLaunch.match(regExs["ami"])) {
 
78
            fSync = true;
 
79
            if (tabBox.selectedIndex != 1) {
 
80
                tabBox.selectedIndex = 1;
 
81
            }
 
82
        }
 
83
        this.showBusyCursor(true);
 
84
        if (fSync) {
 
85
            // this is a synchronous call, meaning
 
86
            // an ami launch was requested
 
87
            ec2ui_AMIsTreeView.selectByImageId(amiToLaunch);
 
88
            this.showBusyCursor(false);
 
89
            ec2ui_AMIsTreeView.launchNewInstances();
 
90
        } else {
 
91
            // Since this is an async call, and the UI has
 
92
            // not switched over to the Images Tab,
 
93
            if (tabBox.selectedIndex != 1) {
 
94
                this.controller.describeImages(fSync);
 
95
            }
 
96
            this.showBusyCursor(false);
 
97
        }
54
98
    },
55
99
 
56
100
    addTabToRefreshList : function (tab) {
114
158
        case "Availability Zones":
115
159
            eval("ec2ui_AvailZoneTreeView." + toCall);
116
160
            break;
 
161
        case "Reserved Instances":
 
162
            eval("ec2ui_LeaseOfferingsTreeView." + toCall);
 
163
            eval("ec2ui_ReservedInstancesTreeView." + toCall);
 
164
            break;
117
165
        default:
118
166
            log ("This is an invalid tab: " + tabs.selectedItem.label);
119
167
            break;