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
This commit is contained in:
Endi S. Dewata
2011-07-19 13:46:09 -05:00
committed by Adam Young
parent bc4e97e191
commit 6d14331a05
4 changed files with 127 additions and 56 deletions

View File

@@ -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 = $('<input/>', {
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<batch.commands.length; i++) {
var command = batch.commands[i];
command.set_option('updatedns', updatedns);
}
return batch;
};
return that;
};
IPA.dnszone_select_widget = function(spec) {
spec = spec || {};