diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-10-03 18:24:33 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-10-20 12:06:02 +0200 |
commit | 741c31c2b428cf979db6a9d7cd91f88e5f247fb4 (patch) | |
tree | c51810e8f22c2be9e77165d213960416bb16ad55 /install | |
parent | 68825e7ac6e074ee62bc3787a718ae78ef29a88e (diff) | |
download | freeipa-741c31c2b428cf979db6a9d7cd91f88e5f247fb4.tar.gz freeipa-741c31c2b428cf979db6a9d7cd91f88e5f247fb4.tar.xz freeipa-741c31c2b428cf979db6a9d7cd91f88e5f247fb4.zip |
webui: allow --force in dnszone-mod and dnsrecord-add
Allow to use --force when changing authoritative nameserver address in DNS zone.
Same for dnsrecord-add for NS record.
https://fedorahosted.org/freeipa/ticket/4573
Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
Diffstat (limited to 'install')
-rw-r--r-- | install/ui/src/freeipa/dns.js | 68 | ||||
-rw-r--r-- | install/ui/test/data/ipa_init.json | 5 |
2 files changed, 68 insertions, 5 deletions
diff --git a/install/ui/src/freeipa/dns.js b/install/ui/src/freeipa/dns.js index 675a2d7e8..7b66c8674 100644 --- a/install/ui/src/freeipa/dns.js +++ b/install/ui/src/freeipa/dns.js @@ -516,6 +516,55 @@ IPA.dnszone_details_facet = function(spec, no_init) { return batch; }; + that.update = function (on_success, on_error) { + + // If update touches 'idnssoamname', open dialog to allow to skip + // DNS resolution check (--force option) + + var command = that.create_update_command(); + + command.on_success = function (data, text_status, xhr) { + that.update_on_success(data, text_status, xhr); + if (on_success) on_success.call(this, data, text_status, xhr); + }; + + command.on_error = function (xhr, text_status, error_thrown) { + that.update_on_error(xhr, text_status, error_thrown); + if (on_error) on_error.call(this, xhr, text_status, error_thrown); + }; + + if (command.options.idnssoamname === undefined) { + command.execute(); + return; + } + + var dialog = IPA.confirm_dialog({ + title: '@i18n:objects.dnszone.soamname_change_title', + message: '@i18n:objects.dnszone.soamname_change_message', + ok_label: '@i18n:objects.realmdomains.check_dns', + on_ok: function () { + command.execute(); + } + }); + + var cancel_button = dialog.get_button('cancel'); + dialog.buttons.remove('cancel'); + + dialog.create_button({ + name: 'force', + label: '@i18n:objects.realmdomains.force_update', + visible: true, + click: function () { + command.set_option('force', true); + command.execute(); + dialog.close(); + } + }); + + dialog.add_button(cancel_button); + dialog.open(); + }; + that.update_on_success = function(data, text_status, xhr) { that.refresh(); that.on_update.notify(); @@ -979,9 +1028,16 @@ IPA.dns.get_record_metadata = function() { { name: 'nsrecord', attributes: [ - 'ns_part_hostname' + 'ns_part_hostname', + { + $type: 'checkbox', + name: 'force', + label: '@i18n:objects.dnszone.skip_dns_check' + } + ], + adder_attributes: [ + 'force' ], - adder_attributes: [], columns: ['ns_part_hostname'] }, { @@ -1301,8 +1357,12 @@ IPA.dns.record_prepare_editor_for_type = function(type, fields, widgets, update) } var metadata = IPA.get_entity_param('dnsrecord', attribute.name); - if (metadata && update && metadata.flags && - metadata.flags.indexOf('no_update') > -1) continue; + var no_update = metadata && metadata.flags && + metadata.flags.indexOf('no_update') > -1; + var adder_attr = type.adder_attributes && + type.adder_attributes.indexOf(attribute.name) > -1; + + if (update && (no_update || adder_attr)) continue; //create field var field = {}; diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json index ad9449d28..c4ea2acef 100644 --- a/install/ui/test/data/ipa_init.json +++ b/install/ui/test/data/ipa_init.json @@ -298,7 +298,10 @@ "add_permission": "Add Permission", "add_permission_confirm":"Are you sure you want to add permission for DNS Zone ${object}?", "remove_permission": "Remove Permission", - "remove_permission_confirm": "Are you sure you want to remove permission for DNS Zone ${object}?" + "remove_permission_confirm": "Are you sure you want to remove permission for DNS Zone ${object}?", + "skip_dns_check": "Skip DNS check", + "soamname_change_message": "Do you want to check if new authoritative nameserver address is in DNS", + "soamname_change_title": "Authoritative nameserver change" }, "group": { "details": "Group Settings", |