Permalink
Browse files

Minor appliance fix

  • Loading branch information...
oldpatricka committed Oct 11, 2013
1 parent 203c505 commit 25e98a5c2eac56d0127c332435eb002bab5ff83e
Showing with 9 additions and 50 deletions.
  1. +6 −48 phantomweb/static/js/phantom_lc.js
  2. +2 −1 phantomweb/static/js/phantom_public_lc.js
  3. +1 −1 phantomweb/templates/base.html
@@ -544,47 +544,6 @@ function phantom_lc_load_internal() {
$("#phantom_lc_appliance")
.append("<option>" + appliance.name + "</option>");
}
-
-
- /*$("#phantom_lc_name_select").empty();
- $("#phantom_lc_cloud").empty();
- g_lc_info = {};
- for(var i=0; i<launchconfigs.length; i++) {
- var launchconfig = launchconfigs[i];
- g_lc_info[launchconfig.name] = launchconfig;
- }
-
- phantom_lc_load_lc_names();
- phantom_lc_load_cloud_names();
- var cloud_name = g_selected_cloud;
- phantom_lc_select_new_cloud_internal(cloud_name);
- phantom_lc_change_image_type();
-
- var lc_name_from_saved = $("#phantom_lc_name_input").val();
- if (lc_name_from_saved) {
- // if it was a saved name load up its value
- $("#phantom_lc_name_select").val(lc_name_from_saved);
- }
-
- if (g_selected_lc === null) {
- var url_lc = get_hash_lc();
- var first_lc = $("a.launch_config").first().text();
-
- if (g_lc_info.hasOwnProperty(url_lc)) {
- g_selected_lc = url_lc;
- phantom_lc_load_lc_names();
- }
- else if (first_lc) {
- g_selected_lc = first_lc;
- phantom_lc_load_lc_names();
- }
- else {
- $("#phantom_lc_info_area").hide();
- $("#phantom_lc_order_area").hide();
- }
- }
-
- phantom_lc_buttons(true);*/
}
catch (err) {
phantom_alert("There was a problem loading the page. Please try again later. ".concat(err.message));
@@ -598,21 +557,21 @@ function phantom_lc_load_internal() {
var sites_url = make_url('sites?details=true')
var sites_request = phantomGET(sites_url)
- var lc_url = make_url('launchconfigurations')
- var lc_request = phantomGET(lc_url);
-
var appliances_url = make_url('launchconfigurations?public=true')
var appliances_request = phantomGET(appliances_url);
+ var lc_url = make_url('launchconfigurations')
+ var lc_request = phantomGET(lc_url);
+
phantom_lc_buttons(false);
phantom_info("Loading Launch Configurations");
- $.when(cred_request, sites_request, lc_request, appliances_request)
- .done(function(credentials, sites, lcs, appliances) {
+ $.when(cred_request, sites_request, appliances_request, lc_request)
+ .done(function(credentials, sites, appliances, lcs) {
load_sites_success(sites[0]);
load_credentials_success(credentials[0]);
- load_lc_success(lcs[0]);
load_appliances_success(appliances[0]);
+ load_lc_success(lcs[0]);
})
.fail(function(err) {
phantom_alert("There was a problem loading your launch configs. Please try again later. ".concat(err.message));
@@ -856,7 +815,6 @@ function phantom_lc_save_click_internal() {
phantom_lc_buttons(true);
}
- console.log(data);
if (g_unsaved_lcs.indexOf(lc_name) > -1) {
var url = make_url("launchconfigurations");
phantomPOST(url, data, success_func, error_func);
@@ -109,17 +109,18 @@ function import_lc(lc_id_to_import, new_name) {
$('a').removeClass('disabled');
$import_lc_name.parent().parent().show()
$("#importing").hide();
- console.log(error);
}
var lc_to_import = available_launch_configs[lc_id_to_import];
delete lc_to_import['id'];
delete lc_to_import['url'];
delete lc_to_import['owner'];
delete lc_to_import['description'];
+ lc_to_import['appliance'] = lc_to_import['name'];
lc_to_import['name'] = new_name;
var url = make_url("launchconfigurations");
+ console.log(lc_to_import);
phantomPOST(url, lc_to_import, import_lc_success, import_lc_failure);
$("#row-" + lc_id_to_import + " button.import").html("Importing...");
}
@@ -68,9 +68,9 @@
<div class="nav-collapse">
<ul class="nav">
<li id="nav-profile"><a href="/phantom/profile">Profile</a></li>
+ <li id="nav-appliances"><a href="/phantom/appliances">Appliances</a></li>
<li id="nav-launchconfig"><a href="/phantom/launchconfig">Launch Configurations</a></li>
<li id="nav-domains"><a href="/phantom/domain">Domains</a></li>
- <li id="nav-appliances"><a href="/phantom/appliances">Appliances</a></li>
{% if user.is_authenticated %}
<li id="nav-logout"><a href="/accounts/logout">Logout {{user.username}}</a></li>
{% else %}

0 comments on commit 25e98a5

Please sign in to comment.