diff --git a/install/ui/dns.js b/install/ui/dns.js index d30cc3123..65c331f5b 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -105,7 +105,7 @@ IPA.dns.zone_entity = function(spec) { facet_group: 'dnsrecord', nested_entity : 'dnsrecord', name: 'records', - pagination: false, + deleter_dialog: IPA.dns.record_search_deleter_dialog, title: IPA.metadata.objects.dnszone.label_singular, label: IPA.metadata.objects.dnsrecord.label, columns: [ @@ -468,80 +468,101 @@ IPA.dns.record_search_facet = function(spec) { var that = IPA.nested_search_facet(spec); - that.load_all = function(data) { + that.get_records = function(pkeys, on_success, on_error) { + + var batch = IPA.batch_command({ + name: that.get_records_command_name(), + on_success: on_success, + on_error: on_error + }); + + var zone = IPA.nav.get_state('dnszone-pkey'); + + for (var i=0; i 0) { + $('input[name="'+that.table.name+'"]', tr).remove(); + } } }; - that.get_selected_values = function() { + return that; +}; - var values = []; +IPA.dns.record_search_deleter_dialog = function(spec) { - var records = {}; - var value; - var record_type; + spec = spec || {}; - $('input[name="idnsname"]:checked', that.table.tbody).each(function() { - $('div', $(this).parent().parent()).each(function() { - var div = $(this); - var name = div.attr('name'); - var text = div.text(); + var that = IPA.search_deleter_dialog(spec); - if (name === 'idnsname') { - value = records[text]; - if (!value) { - value = { pkey: text }; - records[text] = value; - } - } else if (name === 'type') { - record_type = text.toLowerCase()+'record'; + that.create_command = function() { - } else if (name === 'data') { - if (!value[record_type]) { - value[record_type] = text; - } else { - value[record_type] += ',' + text; - } - } - }); - }); + var batch = that.search_deleter_dialog_create_command(); - for (var key in records) { - values.push(records[key]); + for (var i=0; i