/*jsl:import ipa.js */
/*jsl:import search.js */
/* Authors:
* Adam Young ').appendTo(dialog.container);
$('', {
html: IPA.messages.objects.dnsrecord.resource
}).appendTo(dl);
var dd = $('').appendTo(dl);
dialog.resource = $('', {
type: 'text'
}).appendTo(dd);
$('', {
html: IPA.messages.objects.dnsrecord.type
}).appendTo(dl);
dd = $('').appendTo(dl);
dialog.type = create_type_select('dns-record-type').appendTo(dd);
$('', {
html: IPA.messages.objects.dnsrecord.data
}).appendTo(dl);
dd = $('').appendTo(dl);
dialog.data = $('', {
rows: 8,
cols: 20
}).appendTo(dd);
};
dialog.add_button(IPA.messages.buttons.add, function() {
dialog.add();
dialog.close();
});
dialog.add_button(IPA.messages.buttons.add_and_add_another, function() {
dialog.add();
});
dialog.add_button(IPA.messages.buttons.cancel, function() {
dialog.close();
});
dialog.add = function() {
var pkey = $.bbq.getState(that.entity_name+'-pkey');
var resource = dialog.resource.val();
var options = {};
var key = dialog.type.val().toLowerCase()+'record';
options[key] = dialog.data.val();
var command = IPA.command({
entity: 'dnsrecord',
method: 'add',
args: [pkey, resource],
options: options,
on_success: function(data, text_status, xhr) {
that.refresh();
}
});
command.execute();
};
dialog.init();
dialog.open(that.container);
};
that.remove = function() {
var values = that.table.get_selected_rows();
if (!values.length) {
return;
}
var zone = $.bbq.getState('dnszone-pkey');
var records = [];
values.each(function() {
var tr = $(this);
records.push({
resource: $('span[name=idnsname]', tr).text(),
type: $('span[name=type]', tr).text().toLowerCase(),
data: $('span[name=data]', tr).text()
});
});
var dialog = IPA.dialog({
title: IPA.messages.buttons.remove
});
dialog.create = function() {
var to_delete_table =
$('
'+
'
').appendTo(dialog.container);
var to_delete_body = to_delete_table.find('tbody');
for (var i=0; i '+
'Resource Type ', {
html: record.resource
}).appendTo(tr);
$(' ', {
html: record.type
}).appendTo(tr);
}
$('', {
text: IPA.messages.search.delete_confirm
}).appendTo(dialog.container);
};
dialog.add_button(IPA.messages.buttons.remove, function() {
var batch = IPA.batch_command({
on_success: function() {
that.refresh();
dialog.close();
},
on_error: function() {
that.refresh();
dialog.close();
}
});
for (var i=0; i
'+error_thrown.message+'
'); } var options = {}; var filter = that.filter.val(); /* if (filter){ options.idnsname = filter; } var type_filter = that.container.find("#dns-record-type-filter").val(); if (type_filter){ options.type = type_filter; } var data_filter = that.container.find("#dns-record-data-filter").val(); if (data_filter){ options.data = data_filter; } */ var args = [$.bbq.getState(that.entity_name+'-pkey')]; if (filter) { args.push(filter); } IPA.command({ entity: 'dnsrecord', method: 'find', args: args, options: options, on_success: on_success, on_error: on_error }).execute(); }; return that; };