diff options
author | Adam Young <ayoung@redhat.com> | 2011-06-28 12:02:48 -0400 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-06-28 18:10:02 +0000 |
commit | acc00afa4c0024f0a1edbb7bfa9295dad163568d (patch) | |
tree | d44d849ac138e932a1cf9b75c2792b96f02ee657 /install | |
parent | 9837bb0d10466332b486ceb958ba30dc431440d7 (diff) | |
download | freeipa-acc00afa4c0024f0a1edbb7bfa9295dad163568d.tar.gz freeipa-acc00afa4c0024f0a1edbb7bfa9295dad163568d.tar.xz freeipa-acc00afa4c0024f0a1edbb7bfa9295dad163568d.zip |
Generate record type list from metadata https://fedorahosted.org/freeipa/ticket/945
now matches record at the end of the string
Diffstat (limited to 'install')
-rw-r--r-- | install/ui/dns.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/install/ui/dns.js b/install/ui/dns.js index 14be46468..25addc425 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -105,12 +105,22 @@ IPA.dnsrecord_facet = function(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' - ]; + function generate_recordtype_list(){ + var attrs = IPA.metadata.objects.dnsrecord.default_attributes; + var record_types = []; + for (var i =0; i < attrs.length; i+=1){ + var attr = attrs[i]; + var index = attr.search('record$'); + if (index > -1){ + var rec_type = attr.substring(0,index); + record_types.push(rec_type); + } + } + return record_types; + + } + + var record_types = generate_recordtype_list(); that.init = function() { |