summaryrefslogtreecommitdiffstats
path: root/install/ui/host.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2011-08-05 17:12:21 +0200
committerEndi S. Dewata <edewata@redhat.com>2011-08-05 19:14:19 +0000
commit08905eb9a9039b38c032275a87b4f5602e5a63dd (patch)
treea566ca2e61144a2d5d98b751f56c9af125b367e3 /install/ui/host.js
parent966fbd6485f3e2a1bc7fa4c3f96fcb435daa553d (diff)
downloadfreeipa-08905eb9a9039b38c032275a87b4f5602e5a63dd.tar.gz
freeipa-08905eb9a9039b38c032275a87b4f5602e5a63dd.tar.xz
freeipa-08905eb9a9039b38c032275a87b4f5602e5a63dd.zip
Fixed adding host without DNS reverse zone
https://fedorahosted.org/freeipa/ticket/1481 Shows status dialog instead of error dialog (error 4304 is treated like success). Refactored error dialog. Added generic message dialog (IPA.message_dialog) Modified core tests to work with dialog.
Diffstat (limited to 'install/ui/host.js')
-rw-r--r--install/ui/host.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/install/ui/host.js b/install/ui/host.js
index b8e849211..743196b08 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -102,6 +102,7 @@ IPA.entity_factories.host = function () {
}).
standard_association_facets().
adder_dialog({
+ factory: IPA.host_adder_dialog,
width: 400,
height: 250,
fields:[
@@ -128,6 +129,47 @@ IPA.entity_factories.host = function () {
build();
};
+IPA.host_adder_dialog = function(spec)
+{
+ spec = spec || {};
+ spec.retry = typeof spec.retry !== 'undefined' ? spec.retry : false;
+
+ var that = IPA.add_dialog(spec);
+
+ that.on_error = function(xhr, text_status, error_thrown)
+ {
+ var command = that.command;
+ var data = error_thrown.data;
+ var dialog = null;
+
+ if(data && data.error && data.error.code === 4304) {
+ dialog = IPA.message_dialog({
+ message: data.error.message,
+ title: spec.title,
+ on_ok: function() {
+ data.result = {
+ result: {
+ fqdn: that.get_field('fqdn').save()
+ }
+ };
+ command.on_success(data, text_status, xhr);
+ }
+ });
+ } else {
+ dialog = IPA.error_dialog({
+ xhr: xhr,
+ text_status: text_status,
+ error_thrown: error_thrown,
+ command: command
+ });
+ }
+
+ dialog.open(that.container);
+ };
+
+ return that;
+};
+
IPA.host_deleter_dialog = function(spec) {
spec = spec || {};