From 6d3924024c48c990afa03e961a2e6b77031990fb Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 3 Nov 2011 15:14:15 +0100 Subject: Field for DNS SOA class changed to combobox with options https://fedorahosted.org/freeipa/ticket/602 SOA class is an enumerated field. Changing input field to combobox with options allows inserting only valid value. --- install/ui/dns.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/install/ui/dns.js b/install/ui/dns.js index 4dbf3e0d..769eee60 100644 --- a/install/ui/dns.js +++ b/install/ui/dns.js @@ -62,7 +62,13 @@ IPA.entity_factories.dnszone = function() { 'idnssoaexpire', 'idnssoaminimum', 'dnsttl', - 'dnsclass', + { + factory: IPA.combobox_widget, + name: 'dnsclass', + options: [ + 'IN', 'CS', 'CH', 'HS' + ] + }, { factory: IPA.radio_widget, name: 'idnsallowdynupdate', @@ -435,14 +441,14 @@ IPA.entity_factories.dnsrecord = function() { return IPA.entity_builder(). entity('dnsrecord'). containing_entity('dnszone'). - details_facet({ + details_facet({ post_update_hook:function(data){ var result = data.result.result; if (result.idnsname) { this.load(result); } else { this.reset(); - var dialog = IPA.dnsrecord_redirection_dialog(); + var dialog = IPA.dnsrecord_redirection_dialog(); dialog.open(this.container); } }, @@ -603,11 +609,11 @@ IPA.entity_factories.dnsrecord = function() { }; IPA.dnsrecord_redirection_dialog = function(spec) { - spec = spec || {}; - spec.title = spec.title || IPA.messages.dialogs.redirection; - - var that = IPA.dialog(spec); - + spec = spec || {}; + spec.title = spec.title || IPA.messages.dialogs.redirection; + + var that = IPA.dialog(spec); + that.create = function() { $('

', { 'text': IPA.messages.objects.dnsrecord.deleted_no_data @@ -616,7 +622,7 @@ IPA.dnsrecord_redirection_dialog = function(spec) { 'text': IPA.messages.objects.dnsrecord.redirection_dnszone }).appendTo(that.container); }; - + that.create_button({ name: 'ok', label: IPA.messages.buttons.ok, -- cgit