1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-25 02:50:08 +03:00

Merge branch 'master' of git.opennebula.org:one

This commit is contained in:
Carlos Martín 2014-03-21 19:31:21 +01:00
commit b4640f495b
6 changed files with 64 additions and 29 deletions

View File

@ -166,13 +166,25 @@ EOT
configure_network()
{
gen_network_configuration > /etc/network/interfaces
}
service networking stop
sleep 1
service networking start
activate_network()
{
if [[ `lsb_release -c | awk '{print($2)}'` = precise ]]; then
IFACES=`get_interfaces`
for i in $IFACES; do
DEV=`get_dev $i`
service network-interface restart INTERFACE=$DEV
done
else
service networking stop
sleep 1
service networking start
fi
sleep 2
}
configure_network
activate_network

View File

@ -1263,7 +1263,7 @@ function setupCreateGroupDialog(){
separator = "+";
});
group_json['group']['admin_group_resources'] = resources;
group_json['group']['admin_resources'] = resources;
if ( $('#group_admin_res_user', dialog).prop("checked") ){
group_json['group']['admin_manage_users'] = "YES";

View File

@ -245,13 +245,15 @@ var image_actions = {
type: "create",
call: OpenNebula.Image.create,
callback: function(request, response){
// Reset the create wizard
addImageElement(request, response);
if ($appmarket_import_dialog || $marketplace_import_dialog) {
$create_image_dialog.trigger('close');
} else {
$create_image_dialog.foundation('reveal', 'close');
$create_image_dialog.empty();
setupCreateImageDialog();
addImageElement(request, response);
notifyCustom(tr("Image created"), " ID: " + response.IMAGE.ID, false);
}
notifyCustom(tr("Image created"), " ID: " + response.IMAGE.ID, false)
},
error: onError
},
@ -987,6 +989,8 @@ function initialize_create_image_dialog(dialog) {
};
$('#create_image_submit',dialog).click(function(){
$create_image_dialog = dialog;
var exit = false;
var upload = false;
$('.img_man',this).each(function(){

View File

@ -60,7 +60,6 @@ var market_actions = {
dialogs_context.append(marketplace_import_dialog);
$marketplace_import_dialog = $('#marketplace_import_dialog',dialogs_context);
$marketplace_import_dialog.addClass("reveal-modal large max-height").attr("data-reveal", "");
$marketplace_import_dialog.foundation().foundation('reveal', 'open');
var tab_id = 1;
@ -110,8 +109,8 @@ var market_actions = {
})
image_dialog.on("close", function(){
a_image_dialog.html("");
image_dialog.html("");
a_image_dialog.remove();
image_dialog.remove();
if ($('a', $("dl#marketplace_import_dialog_tabs")).size > 0) {
$('a', $("dl#marketplace_import_dialog_tabs")).first().click();
} else {
@ -125,7 +124,19 @@ var market_actions = {
})
if (response['opennebula_template'] && response['opennebula_template'] !== "CPU=1") {
$create_template_dialog.html("");
var opennebula_template;
try {
opennebula_template = JSON.parse(response['opennebula_template']);
} catch (error) {
notifyError("Error parsing OpenNebula template: " + error.message);
return;
}
if ($create_template_dialog) {
$create_template_dialog.html("");
}
// Template
// Append the new div containing the tab and add the tab to the list
var template_dialog = $('<div id="'+tab_id+'Tab" class="content disk wizard_internal_tab">'+
@ -137,17 +148,15 @@ var market_actions = {
</dd>").appendTo($("dl#marketplace_import_dialog_tabs"));
initialize_create_template_dialog(template_dialog);
fillTemplatePopUp(
JSON.parse(response['opennebula_template']),
template_dialog);
fillTemplatePopUp(opennebula_template, template_dialog);
a_template_dialog.on('click', function(){
$create_template_dialog = template_dialog;
})
template_dialog.on("close", function(){
a_template_dialog.html("");
template_dialog.html("");
a_template_dialog.remove();
template_dialog.remove();
if ($('a', $("dl#marketplace_import_dialog_tabs")).size > 0) {
$('a', $("dl#marketplace_import_dialog_tabs")).first().click();
} else {
@ -159,7 +168,13 @@ var market_actions = {
$("a[href='#manual']", template_dialog).closest('dl').remove();
}
$marketplace_import_dialog.foundation().foundation('reveal', 'open');
$('a', $("dl#marketplace_import_dialog_tabs")).first().click();
$marketplace_import_dialog.on('closed', function(){
$marketplace_import_dialog.remove();
$marketplace_import_dialog = undefined;
})
},
error: onError
},
@ -325,10 +340,9 @@ function updateMarketInfo(request,app){
function infoListenerMarket(dataTable){
$('tbody tr',dataTable).live("click",function(e){
if ($(e.target).is('input') ||
$(e.target).is('select') ||
$(e.target).is('option')) return true;
if ($(e.target).is('input') ||
$(e.target).is('select') ||
$(e.target).is('option')) return true;
var aData = dataTable.fnGetData(this);
var id =aData["_id"]["$oid"];

View File

@ -15,7 +15,7 @@
/* -------------------------------------------------------------------------- */
var create_template_tmpl = '\
<div class="row">'+
<div class="row" id="create_template_header_row">'+
'<div class="large-5 columns">'+
'<h3 class="subheader" id="create_template_header">'+tr("Create VM Template")+'</h3><h3 class="subheader" id="update_template_header" class="hidden">'+tr("Update VM Template")+'</h3>'+
'</div>'+
@ -226,8 +226,11 @@ var template_actions = {
type: "create",
call: OpenNebula.Template.create,
callback: function(request, response){
$create_template_dialog.foundation('reveal', 'close')
$create_template_dialog.empty();
if ($appmarket_import_dialog || $marketplace_import_dialog) {
$create_template_dialog.trigger('close');
} else {
$create_template_dialog.foundation('reveal', 'close');
}
addTemplateElement(request, response);
notifyCustom(tr("Template created"), " ID: " + response.VMTEMPLATE.ID, false)
},
@ -3230,16 +3233,16 @@ function setup_context_tab_content(context_section) {
$("td", this).removeClass('markrowchecked');
$('div#selected_files_spans span#tag_file_'+file_id, context_section).remove();
}
if ($.isEmptyObject(selected_files)) {
$('#files_selected', context_section).hide();
$('#select_files', context_section).show();
}
$('.alert-box', $('#contextTab')).hide();
generate_context_files();
return true;
});
@ -3752,6 +3755,7 @@ function initialize_create_template_dialog(dialog) {
//Process form
$('button#create_template_form_easy',dialog).click(function(){
$create_template_dialog = dialog;
//wrap it in the "vmtemplate" object
var vm_json = build_template();
vm_json = {vmtemplate: vm_json};

View File

@ -1254,6 +1254,7 @@ function updateView(item_list,dataTable){
//replaces an element with id 'tag' in a dataTable with a new one
function updateSingleElement(element,dataTable,tag){
// fnGetData should be used instead, otherwise it depends on the visible columns
var nodes = dataTable.fnGetNodes();
var tr = $(tag,nodes).parents('tr')[0];
var checked_val = $('input.check_item',tr).attr('checked');