From 314d6be229736d76aaf538e9e05894ee42b476fb Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 9 May 2011 20:46:52 -0500 Subject: Updated DNS interface. The IPA.records_facet has been converted into a subclass of IPA.search_facet. This helps remove duplicate table code and provide consistent DOM element attributes for Selenium tests. --- install/ui/dns.js | 376 +++++++++++++++++++++++++----------------------------- 1 file changed, 171 insertions(+), 205 deletions(-) (limited to 'install/ui/dns.js') diff --git a/install/ui/dns.js b/install/ui/dns.js index bd8d6e185..6784584b6 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -26,36 +26,53 @@ /* DNS */ IPA.entity_factories.dnszone = function() { - if (!IPA.dns_enabled){ + if (!IPA.dns_enabled) { throw "DNS not enabled on server"; } - return IPA.entity_builder(). + return IPA.entity_builder(). entity('dnszone'). search_facet({ columns:['idnsname'] }). - details_facet({sections:[{ - name:'identity', - fields:[ - 'idnsname', - 'idnszoneactive', - 'idnssoamname', - 'idnssoarname', - 'idnssoaserial', - 'idnssoarefresh', - 'idnssoaretry', - 'idnssoaexpire', - 'idnssoaminimum', - 'dnsttl', - 'dnsclass', - 'idnsallowdynupdate', - 'idnsupdatepolicy']}]}). + details_facet({ + sections:[{ + name:'identity', + fields:[ + 'idnsname', + 'idnszoneactive', + 'idnssoamname', + 'idnssoarname', + 'idnssoaserial', + 'idnssoarefresh', + 'idnssoaretry', + 'idnssoaexpire', + 'idnssoaminimum', + 'dnsttl', + 'dnsclass', + 'idnsallowdynupdate', + 'idnsupdatepolicy']}] + }). facet({ factory: IPA.records_facet, - 'name': 'records', - 'facet_group':'Member', - 'label': IPA.metadata.objects.dnsrecord.label + name: 'records', + facet_group:'Member', + label: IPA.metadata.objects.dnsrecord.label, + columns: [ + { + name: 'idnsname', + label: IPA.get_entity_param('dnsrecord', 'idnsname').label, + primary_key: true + }, + { + name: 'type', + label: 'Record Type' + }, + { + name: 'data', + label: 'Data' + } + ] }). standard_association_facets(). adder_dialog({ @@ -68,7 +85,7 @@ IPA.entity_factories.dnszone = function() { build(); }; -IPA.force_dnszone_add_checkbox_widget = function (spec){ +IPA.force_dnszone_add_checkbox_widget = function(spec) { var param_info = IPA.get_method_option('dnszone_add', 'force'); spec.name = 'force'; spec.label = param_info.label; @@ -77,18 +94,44 @@ IPA.force_dnszone_add_checkbox_widget = function (spec){ return IPA.checkbox_widget(spec); }; -IPA.records_facet = function (spec){ +IPA.records_facet = function(spec) { spec = spec || {}; - var that = IPA.facet(spec); + var that = IPA.search_facet(spec); + + var record_types = [ + 'a', 'aaaa', 'dname', 'cname', 'mx', 'ns', 'ptr', + 'srv', 'txt', 'a6', 'afsdb', 'cert', 'ds', + 'key', 'kx', 'loc', 'naptr', 'nsec', + 'rrsig', 'sshfp' + ]; + + that.init = function() { + + that.facet_init(); + + that.table = IPA.table_widget({ + name: 'search', + label: IPA.metadata.objects[that.entity_name].label, + entity_name: that.entity_name + }); + + for (var i=0; i',{ @@ -96,7 +139,7 @@ IPA.records_facet = function (spec){ }); if (add_none){ - type_select.append($('