summaryrefslogtreecommitdiffstats
path: root/install/ui/host.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/host.js')
-rw-r--r--install/ui/host.js84
1 files changed, 50 insertions, 34 deletions
diff --git a/install/ui/host.js b/install/ui/host.js
index 01b366e5e..007d20387 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -508,20 +508,28 @@ IPA.host_keytab_widget = function(spec) {
dialog.container.append(IPA.messages.objects.host.unprovision_confirmation);
};
- dialog.add_button(IPA.messages.objects.host.unprovision, function() {
- that.unprovision(
- function(data, text_status, xhr) {
- set_status('missing');
- dialog.close();
- },
- function(xhr, text_status, error_thrown) {
- dialog.close();
- }
- );
+ dialog.create_button({
+ name: 'unprovision',
+ label: IPA.messages.objects.host.unprovision,
+ click: function() {
+ that.unprovision(
+ function(data, text_status, xhr) {
+ set_status('missing');
+ dialog.close();
+ },
+ function(xhr, text_status, error_thrown) {
+ dialog.close();
+ }
+ );
+ }
});
- dialog.add_button(IPA.messages.buttons.cancel, function() {
- dialog.close();
+ dialog.create_button({
+ name: 'cancel',
+ label: IPA.messages.buttons.cancel,
+ click: function() {
+ dialog.close();
+ }
});
dialog.open(that.container);
@@ -637,34 +645,42 @@ IPA.host_password_widget = function(spec) {
type: 'password'
}));
- dialog.add_button(label, function() {
-
- var record = {};
- dialog.save(record);
+ dialog.create_button({
+ name: 'set_password',
+ label: label,
+ click: function() {
- var new_password = record.password1[0];
- var repeat_password = record.password2[0];
+ var record = {};
+ dialog.save(record);
- if (new_password != repeat_password) {
- alert(IPA.messages.password.password_must_match);
- return;
- }
+ var new_password = record.password1[0];
+ var repeat_password = record.password2[0];
- that.set_password(
- new_password,
- function(data, text_status, xhr) {
- that.load(data.result.result);
- dialog.close();
- },
- function(xhr, text_status, error_thrown) {
- dialog.close();
+ if (new_password != repeat_password) {
+ alert(IPA.messages.password.password_must_match);
+ return;
}
- );
- dialog.close();
+
+ that.set_password(
+ new_password,
+ function(data, text_status, xhr) {
+ that.load(data.result.result);
+ dialog.close();
+ },
+ function(xhr, text_status, error_thrown) {
+ dialog.close();
+ }
+ );
+ dialog.close();
+ }
});
- dialog.add_button(IPA.messages.buttons.cancel, function() {
- dialog.close();
+ dialog.create_button({
+ name: 'cancel',
+ label: IPA.messages.buttons.cancel,
+ click: function() {
+ dialog.close();
+ }
});
dialog.open(that.container);