Revision ad01d4d2
Added by Walden Raines over 10 years ago
app/assets/javascripts/host_edit.js | ||
---|---|---|
$("#compute_profile").show();
|
||
$('#vm_details').empty();
|
||
var data = $('form').serialize().replace('method=put', 'method=post');
|
||
$('#compute_resource').html(spinner_placeholder(_('Loading virtual machine information ...')));
|
||
$('#compute_resource').html(spinner_placeholder(__('Loading virtual machine information ...')));
|
||
$('#compute_resource_tab a').removeClass('tab-error');
|
||
$(item).indicator_show();
|
||
var url = $(item).attr('data-url');
|
||
... | ... | |
data: data,
|
||
complete: function(){$(item).indicator_hide()},
|
||
error: function(jqXHR, status, error){
|
||
$('#compute_resource').html(Jed.sprintf(_("Error loading virtual machine information: %s"), error));
|
||
$('#compute_resource').html(Jed.sprintf(__("Error loading virtual machine information: %s"), error));
|
||
$('#compute_resource_tab a').addClass('tab-error');
|
||
},
|
||
success: function(result){
|
||
... | ... | |
var link = content.children('a');
|
||
var links = content.find('a');
|
||
links.attr('onclick', 'remove_puppet_class(this)');
|
||
links.attr('data-original-title', _('Click to undo adding this class'));
|
||
links.attr('data-original-title', __('Click to undo adding this class'));
|
||
links.tooltip();
|
||
link.removeClass('glyphicon-plus-sign').addClass('glyphicon-minus-sign');
|
||
|
||
... | ... | |
|
||
if (url == undefined) return; // no parameters
|
||
var placeholder = $('<tr id="puppetclass_'+id+'_params_loading">'+
|
||
'<td colspan="5">' + spinner_placeholder(_('Loading parameters...')) + '</td></tr>');
|
||
'<td colspan="5">' + spinner_placeholder(__('Loading parameters...')) + '</td></tr>');
|
||
$('#inherited_puppetclasses_parameters').append(placeholder);
|
||
$.ajax({
|
||
url: url,
|
||
... | ... | |
function load_with_placeholder(target, url, data){
|
||
if(url==undefined) return;
|
||
var placeholder = $('<tr id="' + target + '_loading" >'+
|
||
'<td colspan="4">'+ spinner_placeholder(_('Loading parameters...')) + '</td></tr>');
|
||
'<td colspan="4">'+ spinner_placeholder(__('Loading parameters...')) + '</td></tr>');
|
||
$('#' + target + ' tbody').replaceWith(placeholder);
|
||
$.ajax({
|
||
type:'post',
|
||
... | ... | |
|
||
subnet_options.attr('disabled', true);
|
||
if (domain_id == '') {
|
||
subnet_options.append($("<option />").val(null).text(_('No subnets')));
|
||
subnet_options.append($("<option />").val(null).text(__('No subnets')));
|
||
return false;
|
||
}
|
||
|
||
... | ... | |
dataType:'json',
|
||
success:function (result) {
|
||
if (result.length > 1)
|
||
subnet_options.append($("<option />").val(null).text(_('Please select')));
|
||
subnet_options.append($("<option />").val(null).text(__('Please select')));
|
||
|
||
$.each(result, function () {
|
||
subnet_options.append($("<option />").val(this.subnet.id).text(this.subnet.name + ' (' + this.subnet.to_label + ')'));
|
||
... | ... | |
subnet_options.change();
|
||
}
|
||
else {
|
||
subnet_options.append($("<option />").text(_('No subnets')));
|
||
subnet_options.append($("<option />").text(__('No subnets')));
|
||
subnet_options.attr('disabled', true);
|
||
}
|
||
$(element).indicator_hide();
|
||
... | ... | |
$(this).attr("disabled", "disabled");
|
||
});
|
||
$("a.disable-unsupported").remove();
|
||
}
|
||
}
|
Also available in: Unified diff
fixes #3984 - use __ instead of _ for i18n to avoid conflict with underscore.js