From 6d14331a0561e98e4ce8a51bb418c1f6d25b5e88 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 19 Jul 2011 13:46:09 -0500 Subject: Added checkbox to remove hosts from DNS. A custom deleter dialog for hosts has been added to provide an option whether to remove the hosts from DNS. Ticket #1470 --- install/ui/dialog.js | 4 +- install/ui/entity.js | 7 +++ install/ui/host.js | 41 +++++++++++++++++ install/ui/search.js | 127 ++++++++++++++++++++++++++++++--------------------- 4 files changed, 125 insertions(+), 54 deletions(-) (limited to 'install') diff --git a/install/ui/dialog.js b/install/ui/dialog.js index 9d22da7f1..5245ba92c 100644 --- a/install/ui/dialog.js +++ b/install/ui/dialog.js @@ -631,7 +631,7 @@ IPA.deleter_dialog = function (spec) { }; that.set_values = function(values) { - that.values = that.values.concat(values); + that.values = values; }; that.create = function() { @@ -678,5 +678,7 @@ IPA.deleter_dialog = function (spec) { that.dialog_open(container); }; + that.deleter_dialog_create = that.create; + return that; }; diff --git a/install/ui/entity.js b/install/ui/entity.js index ec0317897..0940c7d17 100644 --- a/install/ui/entity.js +++ b/install/ui/entity.js @@ -974,6 +974,13 @@ IPA.entity_builder = function(){ return that.dialog(spec); }; + that.deleter_dialog = function(spec) { + spec.factory = spec.factory || IPA.search_deleter_dialog; + spec.name = spec.name || 'remove'; + + return that.dialog(spec); + }; + that.build = function(){ var item = entity; entity = null; diff --git a/install/ui/host.js b/install/ui/host.js index 9994abf31..bbac4edd7 100644 --- a/install/ui/host.js +++ b/install/ui/host.js @@ -122,9 +122,50 @@ IPA.entity_factories.host = function () { } ] }). + deleter_dialog({ + factory: IPA.host_deleter_dialog + }). build(); }; +IPA.host_deleter_dialog = function(spec) { + + spec = spec || {}; + + var that = IPA.search_deleter_dialog(spec); + + that.create = function() { + + that.deleter_dialog_create(); + + var metadata = IPA.get_method_option('host_del', 'updatedns'); + + that.updatedns = $('', { + type: 'checkbox', + name: 'updatedns', + title: metadata.doc + }).appendTo(that.container); + + that.container.append(' '); + + that.container.append(metadata.doc); + }; + + that.create_command = function() { + var batch = that.search_deleter_dialog_create_command(); + var updatedns = that.updatedns.is(':checked'); + + for (var i=0; i