diff --git a/install/static/add.js b/install/static/add.js index 69e0ad79b..69b1108c3 100644 --- a/install/static/add.js +++ b/install/static/add.js @@ -78,8 +78,7 @@ IPA.add_dialog = function (spec) { state[that.entity_name + '-facet'] = 'details'; state[that.entity_name + '-pkey'] = pkey; $.bbq.pushState(state); - }, - function() { } + } ); }); @@ -90,28 +89,30 @@ IPA.add_dialog = function (spec) { that.dialog_init(); }; - - function save_field(field, record, args, options){ - var pkey_name = IPA.metadata[that.entity_name].primary_key; - var value = record[field.name]; - if (!value) return; - if (field.name == pkey_name) { - args.push(value); - } else { - options[field.name] = value; - } - } - that.add = function(record, on_success, on_error) { - var args = []; - var options = {}; + var pkey_name = IPA.metadata[that.entity_name].primary_key; + + var command = IPA.command({ + method: that.entity_name+'_add', + on_success: on_success, + on_error: on_error + }); for (var i=0; i').appendTo(table); var td = $('', { - 'style': 'vertical-align: top;' + style: 'vertical-align: top;', + title: field.label }).appendTo(tr); td.append(field.label+': '); @@ -128,7 +137,8 @@ IPA.service_add_dialog = function (spec) { tr = $('').appendTo(table); td = $('', { - 'style': 'vertical-align: top;' + style: 'vertical-align: top;', + title: field.label }).appendTo(tr); td.append(field.label+': '); @@ -138,6 +148,23 @@ IPA.service_add_dialog = function (spec) { span = $('', { 'name': 'host' }).appendTo(td); field.create(span); + + field = that.get_field('force'); + + tr = $('').appendTo(table); + + td = $('', { + style: 'vertical-align: top;', + title: field.label + }).appendTo(tr); + td.append(field.label+': '); + + td = $('', { + 'style': 'vertical-align: top;' + }).appendTo(tr); + + span = $('', { 'name': 'force' }).appendTo(td); + field.create(span); }; that.get_record = function() { @@ -151,6 +178,11 @@ IPA.service_add_dialog = function (spec) { record['krbprincipalname'] = service+'/'+host; + field = that.get_field('force'); + var force = field.save()[0]; + + record['force'] = force; + return record; }; diff --git a/install/static/widget.js b/install/static/widget.js index 9221e499c..576eef77b 100644 --- a/install/static/widget.js +++ b/install/static/widget.js @@ -30,6 +30,7 @@ IPA.widget = function(spec) { that.id = spec.id; that.name = spec.name; that.label = spec.label; + that.tooltip = spec.tooltip; that.read_only = spec.read_only; that._entity_name = spec.entity_name; @@ -81,10 +82,18 @@ IPA.widget = function(spec) { } function init() { - if (that.entity_name && !that.label){ + if (that.entity_name) { that.param_info = IPA.get_param_info(that.entity_name, that.name); - if ((that.param_info) && (that.label === undefined)){ - that.label = that.param_info.label; + + if (that.param_info) { + + if (that.label === undefined) { + that.label = that.param_info.label; + } + + if (that.tooltip === undefined) { + that.tooltip = that.param_info.doc; + } } } } @@ -182,9 +191,10 @@ IPA.text_widget = function(spec) { that.create = function(container) { $('', { - 'type': 'text', - 'name': that.name, - 'size': that.size + type: 'text', + name: that.name, + size: that.size, + title: that.tooltip }).appendTo(container); $('', { @@ -269,7 +279,8 @@ IPA.checkbox_widget = function (spec) { $('', { type: 'checkbox', name: that.name, - checked : is_checked + checked : is_checked, + title: that.tooltip }).appendTo(container); if (that.undo) { @@ -404,9 +415,10 @@ IPA.textarea_widget = function (spec) { that.create = function(container) { $('