2010-08-06 09:01:44 -05:00
|
|
|
/* Authors:
|
|
|
|
* Pavel Zuna <pzuna@redhat.com>
|
2010-09-29 15:57:07 -05:00
|
|
|
* Adam Young <ayoung@redhat.com>
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
* Endi S. Dewata <edewata@redhat.com>
|
2010-08-06 09:01:44 -05:00
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Red Hat
|
|
|
|
* see file 'COPYING' for use and warranty information
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; version 2 only
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2010-08-23 21:32:23 -05:00
|
|
|
*/
|
2010-08-06 09:01:44 -05:00
|
|
|
|
|
|
|
/* IPA Object Details - populating definiton lists from entry data */
|
|
|
|
|
|
|
|
/* REQUIRES: ipa.js */
|
|
|
|
|
2010-09-16 09:28:07 -05:00
|
|
|
var ipa_details_cache = {};
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
function ipa_details_field(spec) {
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
spec = spec || {};
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
var that = {};
|
|
|
|
that.name = spec.name;
|
|
|
|
that.label = spec.label;
|
|
|
|
|
|
|
|
that.setup = spec.setup || setup;
|
|
|
|
that.load = spec.load || load;
|
|
|
|
that.save = spec.save || save;
|
|
|
|
|
|
|
|
function setup(container, dl, section) {
|
|
|
|
|
|
|
|
var obj_name = container.attr('title');
|
|
|
|
var title = this.name;
|
|
|
|
var label = '';
|
|
|
|
var param_info = ipa_get_param_info(obj_name, this.name);
|
|
|
|
if (param_info)
|
|
|
|
label = param_info['label'];
|
|
|
|
if (!label)
|
|
|
|
label = this.label;
|
|
|
|
$('<dt></dt>', {
|
|
|
|
id: this.name,
|
|
|
|
title: title,
|
|
|
|
html: label + ':'
|
|
|
|
}).appendTo(dl);
|
|
|
|
}
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
function load(container, dt, entry_attrs) {
|
|
|
|
|
|
|
|
var obj_name = container.attr('id');
|
|
|
|
var multivalue = false;
|
|
|
|
var hint_span = null;
|
|
|
|
var dd;
|
|
|
|
|
|
|
|
var param_info = ipa_get_param_info(obj_name, this.name);
|
|
|
|
if (param_info) {
|
|
|
|
if (param_info['multivalue'] || param_info['class'] == 'List')
|
|
|
|
multivalue = true;
|
|
|
|
var hint = param_info['hint'];
|
|
|
|
if (hint){
|
|
|
|
hint_span = $('<span />',{
|
|
|
|
'class': 'attrhint',
|
|
|
|
'html': 'Hint: ' + hint});
|
|
|
|
}
|
2010-10-13 12:07:43 -05:00
|
|
|
}
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
var value = entry_attrs[this.name];
|
|
|
|
if (value) {
|
|
|
|
dd = ipa_create_first_dd(
|
|
|
|
this.name, ipa_create_input(obj_name, this.name, value[0],hint_span)
|
|
|
|
);
|
|
|
|
dt.after(dd);
|
|
|
|
var last_dd = dd;
|
|
|
|
for (var i = 1; i < value.length; ++i) {
|
|
|
|
dd = ipa_create_other_dd(
|
|
|
|
this.name, ipa_create_input(obj_name, this.name, value[i],hint_span)
|
|
|
|
);
|
|
|
|
last_dd.after(dd);
|
|
|
|
last_dd = dd;
|
2010-10-13 12:07:43 -05:00
|
|
|
}
|
2010-10-27 22:32:30 -05:00
|
|
|
if (multivalue) {
|
|
|
|
dd = ipa_create_other_dd(
|
|
|
|
this.name, _ipa_a_add_template.replace('A', this.name)
|
|
|
|
);
|
|
|
|
last_dd.after(dd);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (multivalue) {
|
2010-10-13 12:07:43 -05:00
|
|
|
dd = ipa_create_first_dd(
|
2010-10-27 22:32:30 -05:00
|
|
|
this.name, _ipa_a_add_template.replace('A', this.name) /*.append(hint_span)*/
|
2010-10-13 12:07:43 -05:00
|
|
|
);
|
|
|
|
dt.after(dd);
|
|
|
|
} else {
|
2010-10-27 22:32:30 -05:00
|
|
|
dd = ipa_create_first_dd(
|
|
|
|
this.name, ipa_create_input(obj_name, this.name, '') /*.append(hint_span)*/
|
|
|
|
);
|
|
|
|
dt.after(dd);
|
2010-10-13 12:07:43 -05:00
|
|
|
}
|
|
|
|
}
|
2010-10-27 22:32:30 -05:00
|
|
|
}
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
function save(container) {
|
|
|
|
var field = this;
|
|
|
|
var values = [];
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
var dd = $('dd[title='+field.name+']', container);
|
|
|
|
dd.each(function () {
|
|
|
|
var input = $('input', $(this));
|
|
|
|
if (!input.length) return;
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
if (input.is('.strikethrough')) return;
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
var value = $.trim(input.val());
|
|
|
|
if (!value) value = '';
|
2010-10-27 12:41:48 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
values.push(value);
|
|
|
|
});
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
return values;
|
|
|
|
}
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
return that;
|
|
|
|
}
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
function ipa_details_section(spec){
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
spec = spec || {};
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
var that = {};
|
|
|
|
that.name = spec.name || '';
|
|
|
|
that.label = spec.label || '';
|
|
|
|
|
|
|
|
that.fields = [];
|
|
|
|
that.fields_by_name = {};
|
|
|
|
|
|
|
|
that.get_fields = function() {
|
|
|
|
return that.fields;
|
|
|
|
};
|
|
|
|
|
|
|
|
that.get_field = function(name) {
|
|
|
|
return that.fields_by_name[name];
|
2010-10-13 12:07:43 -05:00
|
|
|
};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
|
|
|
that.add_field = function(field) {
|
|
|
|
that.fields.push(field);
|
|
|
|
that.fields_by_name[field.name] = field;
|
|
|
|
};
|
|
|
|
|
|
|
|
that.create_field = function(spec) {
|
|
|
|
var field = ipa_details_field(spec);
|
|
|
|
that.add_field(field);
|
|
|
|
return field;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Deprecated: Used for backward compatibility only.
|
|
|
|
function input(spec){
|
|
|
|
that.create_field(spec);
|
|
|
|
return that;
|
|
|
|
}
|
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
that.input = input;
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
return that;
|
2010-10-27 22:32:30 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Deprecated: Used for backward compatibility only.
|
|
|
|
function ipa_stanza(spec) {
|
|
|
|
return ipa_details_section(spec);
|
|
|
|
}
|
|
|
|
|
|
|
|
function ipa_details_facet(spec) {
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
spec = spec || {};
|
|
|
|
|
|
|
|
var that = ipa_facet(spec);
|
|
|
|
|
|
|
|
that.init = spec.init;
|
|
|
|
that.setup = spec.setup || setup;
|
|
|
|
|
|
|
|
that.sections = [];
|
|
|
|
that.sections_by_name = {};
|
|
|
|
|
|
|
|
that.get_sections = function() {
|
|
|
|
return that.sections;
|
|
|
|
};
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
that.get_section = function(name) {
|
|
|
|
return that.sections_by_name[name];
|
|
|
|
};
|
|
|
|
|
|
|
|
that.add_section = function(section) {
|
|
|
|
that.sections.push(section);
|
|
|
|
that.sections_by_name[section.name] = section;
|
|
|
|
};
|
|
|
|
|
|
|
|
that.create_section = function(spec) {
|
|
|
|
var section = ipa_stanza(spec);
|
|
|
|
that.add_section(section);
|
|
|
|
return section;
|
|
|
|
};
|
|
|
|
|
|
|
|
that.is_dirty = function() {
|
|
|
|
var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
|
|
|
|
return pkey != that.pkey;
|
|
|
|
};
|
|
|
|
|
|
|
|
function setup(container, unspecified) {
|
|
|
|
|
|
|
|
that.pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
|
|
|
|
|
|
|
|
that.setup_views(container);
|
|
|
|
ipa_details_create(container, that.sections);
|
|
|
|
|
|
|
|
container.find('.details-reset').click(function() {
|
|
|
|
ipa_details_reset(container);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
container.find('.details-update').click(function() {
|
|
|
|
var pkey_name = IPA.metadata[that.entity_name].primary_key;
|
|
|
|
ipa_details_update(container, ipa_details_cache[that.entity_name][pkey_name][0]);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
if (that.pkey||unspecified){
|
|
|
|
ipa_details_load(container, that.pkey, null, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (that.init) that.init();
|
|
|
|
|
|
|
|
return that;
|
|
|
|
}
|
2010-10-13 12:07:43 -05:00
|
|
|
|
|
|
|
function ipa_make_button(which,text,details_class){
|
|
|
|
|
|
|
|
var button_class= details_class +
|
|
|
|
" ui-state-default ui-corner-all input_link ";
|
|
|
|
return $('<a ></a>',{
|
|
|
|
"class": button_class
|
|
|
|
}).
|
|
|
|
append('<span class="ui-icon ' + which +'" ></span> ').
|
|
|
|
append(text);
|
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
function ipa_details_create(container, sections)
|
2010-08-06 09:01:44 -05:00
|
|
|
{
|
2010-09-16 09:28:07 -05:00
|
|
|
if (!container) {
|
|
|
|
alert('ERROR: ipa_details_create: Missing container argument!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var obj_name = container.attr('id');
|
2010-09-16 09:28:07 -05:00
|
|
|
container.attr('title', obj_name);
|
|
|
|
container.addClass('details-container');
|
|
|
|
|
2010-09-29 00:52:56 -05:00
|
|
|
var details = $('<div/>', {
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
'class': 'details'
|
2010-09-29 00:52:56 -05:00
|
|
|
}).appendTo(container);
|
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var buttons = $('<div/>', {
|
|
|
|
'class': 'details-buttons'
|
|
|
|
}).appendTo(details);
|
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
buttons.append(ipa_make_button('ui-icon-refresh','Reset','details-reset'));
|
|
|
|
buttons.append(ipa_make_button('ui-icon-check','Update','details-update'));
|
2010-09-16 09:28:07 -05:00
|
|
|
|
2010-09-29 00:52:56 -05:00
|
|
|
details.append('<hr />');
|
2010-09-16 09:28:07 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
for (var i = 0; i < sections.length; ++i) {
|
|
|
|
var section = sections[i];
|
|
|
|
ipa_details_section_setup(container, details, section);
|
2010-09-16 09:28:07 -05:00
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2010-09-16 09:28:07 -05:00
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
|
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
function ipa_details_section_setup(container, details, section)
|
2010-08-06 09:01:44 -05:00
|
|
|
{
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var id = section.name;
|
|
|
|
var name = section.label;
|
|
|
|
var fields = section.fields;
|
2010-08-06 09:01:44 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
if (!fields)
|
|
|
|
return;
|
2010-08-06 09:01:44 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
details.append($("<h2/>",{
|
2010-09-29 15:57:07 -05:00
|
|
|
click: function(){_h2_on_click(this)},
|
|
|
|
html:"− "+name
|
|
|
|
}));
|
|
|
|
|
|
|
|
var dl = $('<dl></dl>',{
|
|
|
|
id:id,
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
"class":"entryattrs"
|
|
|
|
}).appendTo(details);
|
|
|
|
|
|
|
|
for (var i = 0; i < fields.length; ++i) {
|
|
|
|
var field = fields[i];
|
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
field.setup(container, dl, section);
|
2010-09-16 09:28:07 -05:00
|
|
|
}
|
2010-10-06 11:01:02 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
details.append('<hr/>');
|
|
|
|
}
|
|
|
|
|
2010-08-06 09:01:44 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
function ipa_details_load(container, pkey, on_win, on_fail)
|
2010-08-06 09:01:44 -05:00
|
|
|
{
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var obj_name = container.attr('id');
|
2010-09-29 00:52:56 -05:00
|
|
|
|
2010-09-16 09:28:07 -05:00
|
|
|
function load_on_win(data, text_status, xhr) {
|
|
|
|
if (on_win)
|
|
|
|
on_win(data, text_status, xhr);
|
|
|
|
if (data.error)
|
|
|
|
return;
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2010-09-16 09:28:07 -05:00
|
|
|
var result = data.result.result;
|
|
|
|
ipa_details_cache[obj_name] = $.extend(true, {}, result);
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
ipa_details_display(container, result);
|
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2010-09-16 09:28:07 -05:00
|
|
|
function load_on_fail(xhr, text_status, error_thrown) {
|
|
|
|
if (on_fail)
|
|
|
|
on_fail(xhr, text_status, error_thrown);
|
2010-09-29 00:52:56 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var details = $('.details', container).empty();
|
2010-09-29 00:52:56 -05:00
|
|
|
details.append('<p>Error: '+error_thrown.name+'</p>');
|
2010-10-28 09:50:34 -05:00
|
|
|
details.append('<p>'+error_thrown.title+'</p>');
|
2010-09-29 00:52:56 -05:00
|
|
|
details.append('<p>'+error_thrown.message+'</p>');
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
}
|
2010-09-16 09:28:07 -05:00
|
|
|
|
2010-10-06 16:24:58 -05:00
|
|
|
var params = [pkey];
|
|
|
|
if (!pkey){
|
|
|
|
params = [];
|
|
|
|
}
|
2010-09-16 09:28:07 -05:00
|
|
|
ipa_cmd(
|
2010-10-06 16:24:58 -05:00
|
|
|
'show', params, {all: true}, load_on_win, load_on_fail, obj_name
|
2010-09-16 09:28:07 -05:00
|
|
|
);
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
function ipa_details_update(container, pkey, on_win, on_fail)
|
2010-08-06 09:01:44 -05:00
|
|
|
{
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var obj_name = container.attr('id');
|
|
|
|
|
2010-09-16 09:28:07 -05:00
|
|
|
function update_on_win(data, text_status, xhr) {
|
|
|
|
if (on_win)
|
|
|
|
on_win(data, text_status, xhr);
|
|
|
|
if (data.error)
|
|
|
|
return;
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2010-09-16 09:28:07 -05:00
|
|
|
var result = data.result.result;
|
|
|
|
ipa_details_cache[obj_name] = $.extend(true, {}, result);
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
ipa_details_display(container, result);
|
|
|
|
}
|
2010-09-16 09:28:07 -05:00
|
|
|
|
|
|
|
function update_on_fail(xhr, text_status, error_thrown) {
|
|
|
|
if (on_fail)
|
|
|
|
on_fail(xhr, text_status, error_thrown);
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
|
|
|
|
if (!pkey)
|
2010-08-25 11:49:30 -05:00
|
|
|
return;
|
2010-08-06 09:01:44 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var values;
|
2010-08-06 09:01:44 -05:00
|
|
|
var modlist = {'all': true, 'setattr': [], 'addattr': []};
|
|
|
|
var attrs_wo_option = {};
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
var facet = ipa_entity_get_details_facet(obj_name);
|
|
|
|
var sections = facet.get_sections();
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
for (var i=0; i<sections.length; i++) {
|
|
|
|
var section = sections[i];
|
|
|
|
var fields = section.fields;
|
|
|
|
if (!fields) continue;
|
2010-08-06 09:01:44 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
for (var j=0; j<fields.length; j++) {
|
|
|
|
var field = fields[j];
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
values = field.save(container);
|
2010-08-06 09:01:44 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var param_info = ipa_get_param_info(obj_name, field.name);
|
|
|
|
if (param_info) {
|
|
|
|
if (param_info['primary_key']) continue;
|
2010-10-22 15:23:02 -05:00
|
|
|
if (values.length === 1) {
|
|
|
|
modlist[field.name] = values[0];
|
|
|
|
}else if (values.length > 1){
|
|
|
|
modlist[field.name] = values;
|
|
|
|
} else if (param_info['multivalue']){
|
|
|
|
modlist[field.name] = [];
|
|
|
|
}
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
} else {
|
|
|
|
if (values.length) attrs_wo_option[field.name] = values;
|
|
|
|
}
|
2010-08-25 11:49:30 -05:00
|
|
|
}
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
|
|
|
|
for (attr in attrs_wo_option) {
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
values = attrs_wo_option[attr];
|
2010-08-25 11:49:30 -05:00
|
|
|
modlist['setattr'].push(attr + '=' + values[0]);
|
|
|
|
for (var i = 1; i < values.length; ++i)
|
|
|
|
modlist['addattr'].push(attr + '=' + values[i]);
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
|
|
|
|
2010-09-16 09:28:07 -05:00
|
|
|
ipa_cmd('mod', [pkey], modlist, update_on_win, update_on_fail, obj_name);
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
|
2010-08-06 09:01:44 -05:00
|
|
|
/* HTML templates for ipa_details_display() */
|
|
|
|
var _ipa_a_add_template =
|
|
|
|
'<a href="jslink" onclick="return (_ipa_add_on_click(this))" title="A">Add</a>';
|
2010-08-25 11:49:30 -05:00
|
|
|
var _ipa_span_doc_template = '<span class="attrhint">Hint: D</span>';
|
2010-09-29 15:57:07 -05:00
|
|
|
var _ipa_span_hint_template = '<span class="attrhint">Hint: D</span>';
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
|
|
|
|
|
2010-08-06 09:01:44 -05:00
|
|
|
/* populate definition lists with the class 'entryattrs' with entry attributes
|
|
|
|
*
|
|
|
|
* The list has to be specially crafted for this function to work properly:
|
|
|
|
* <dt> tags should have the 'title' attribute set to an LDAP attribute name
|
|
|
|
* OR to a javascript function name prefixed with 'call_', which will be given
|
|
|
|
* the <dt> object and entry_attrs as arguments.
|
|
|
|
* Example:
|
|
|
|
* <dl class="entryattrs">
|
|
|
|
* <dt title="givenname">First Name:</dt>
|
|
|
|
* <dt title="call_some_callback">Some Attribute:</dt>
|
|
|
|
* </dl>
|
|
|
|
*
|
|
|
|
* arguments:
|
|
|
|
* entry_attrs - 'result' field as returned by ipa *-show commnads
|
|
|
|
* (basically an associative array with attr:value pairs) */
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
function ipa_details_display(container, entry_attrs)
|
2010-08-06 09:01:44 -05:00
|
|
|
{
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var obj_name = container.attr('id');
|
2010-09-16 09:28:07 -05:00
|
|
|
|
2010-08-06 09:01:44 -05:00
|
|
|
/* remove all <dd> tags i.e. all attribute values */
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
$('dd', container).remove();
|
2010-08-06 09:01:44 -05:00
|
|
|
|
|
|
|
/* go through all <dt> tags and pair them with newly created <dd>s */
|
2010-10-27 22:32:30 -05:00
|
|
|
var facet = ipa_entity_get_details_facet(obj_name);
|
|
|
|
var sections = facet.get_sections();
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
for (var i=0; i<sections.length; i++) {
|
|
|
|
var section = sections[i];
|
|
|
|
var fields = section.fields;
|
|
|
|
if (!fields) continue;
|
2010-08-25 11:49:30 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
for (var j=0; j<fields.length; j++) {
|
|
|
|
var field = fields[j];
|
|
|
|
var dt = $('dt[title='+field.name+']', container);
|
|
|
|
if (!dt.length) continue;
|
2010-10-13 12:07:43 -05:00
|
|
|
field.load(container, dt, entry_attrs);
|
2010-08-25 11:49:30 -05:00
|
|
|
}
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
|
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
function ipa_create_first_dd(field_name, content){
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
return $('<dd/>', {
|
2010-08-06 09:01:44 -05:00
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
'class': 'first',
|
|
|
|
'title': field_name
|
|
|
|
}).append(content);
|
2010-09-29 15:57:07 -05:00
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
function ipa_create_other_dd(field_name, content){
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
return $('<dd/>', {
|
|
|
|
'class': 'other',
|
|
|
|
'title': field_name
|
|
|
|
}).append(content);
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
function ipa_insert_first_dd(jobj, content){
|
|
|
|
ipa_insert_dd(jobj, content, "first");
|
|
|
|
}
|
|
|
|
|
|
|
|
function ipa_insert_dd(jobj, content, dd_class){
|
|
|
|
jobj.after( $('<dd/>',{
|
|
|
|
"class": dd_class
|
|
|
|
}).append(content))
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-06 09:01:44 -05:00
|
|
|
|
|
|
|
/* mapping of parameter types to handlers used to create inputs */
|
|
|
|
var _ipa_param_type_2_handler_map = {
|
|
|
|
'Str': _ipa_create_text_input,
|
|
|
|
'Int': _ipa_create_text_input,
|
|
|
|
'Bool': _ipa_create_text_input,
|
2010-09-29 00:52:56 -05:00
|
|
|
'List': _ipa_create_text_input
|
2010-08-06 09:01:44 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/* create an HTML element for displaying/editing an attribute
|
|
|
|
* arguments:
|
|
|
|
* attr - LDAP attribute name
|
|
|
|
* value - the attributes value */
|
2010-09-29 15:57:07 -05:00
|
|
|
function ipa_create_input(obj_name, attr, value,hint)
|
2010-08-06 09:01:44 -05:00
|
|
|
{
|
2010-09-29 15:57:07 -05:00
|
|
|
var input = $("<label>",{html:value.toString()});
|
2010-09-16 09:28:07 -05:00
|
|
|
var param_info = ipa_get_param_info(obj_name, attr);
|
2010-08-06 09:01:44 -05:00
|
|
|
if (!param_info) {
|
2010-08-25 11:49:30 -05:00
|
|
|
/* no information about the param is available, default to text input */
|
2010-09-29 15:57:07 -05:00
|
|
|
input = _ipa_create_text_input(attr, value, null);
|
|
|
|
if (hint){
|
|
|
|
input.after(hint);
|
|
|
|
}
|
|
|
|
}else if (param_info['primary_key'] ||
|
|
|
|
('no_update' in param_info['flags'])){
|
|
|
|
/* check if the param value can be modified */
|
|
|
|
/* THis is currently a no-op, as we use this logic for the
|
|
|
|
default case as well */
|
|
|
|
}else{
|
|
|
|
/* call handler by param class */
|
|
|
|
var handler = _ipa_param_type_2_handler_map[param_info['class']];
|
|
|
|
if (handler) {
|
2010-10-13 12:07:43 -05:00
|
|
|
input = handler(attr, value, param_info);
|
2010-09-29 15:57:07 -05:00
|
|
|
if (param_info['multivalue'] || param_info['class'] == 'List') {
|
2010-10-13 12:07:43 -05:00
|
|
|
input.append( _ipa_create_remove_link(attr, param_info));
|
|
|
|
}
|
|
|
|
if (hint){
|
|
|
|
input.after(hint);
|
2010-09-29 15:57:07 -05:00
|
|
|
}
|
2010-08-25 11:49:30 -05:00
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
2010-09-29 15:57:07 -05:00
|
|
|
return input;
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* creates a Remove link for deleting attribute values */
|
|
|
|
function _ipa_create_remove_link(attr, param_info)
|
|
|
|
{
|
|
|
|
if (!param_info)
|
2010-08-25 11:49:30 -05:00
|
|
|
return (_ipa_a_remove_template.replace('A', attr));
|
2010-08-06 09:01:44 -05:00
|
|
|
|
|
|
|
/* check if the param is required or of the Password type
|
|
|
|
* if it is, then we don't want people to be able to remove it */
|
|
|
|
if ((param_info['required']) || (param_info['class'] == 'Password'))
|
2010-08-25 11:49:30 -05:00
|
|
|
return ('');
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2010-10-22 15:23:02 -05:00
|
|
|
return $('<a/>',{
|
|
|
|
href:"jslink",
|
|
|
|
click: function (){return (_ipa_remove_on_click(this))},
|
|
|
|
title: attr,
|
|
|
|
text: 'Remove'});
|
|
|
|
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* creates a input box for editing a string attribute */
|
|
|
|
function _ipa_create_text_input(attr, value, param_info)
|
|
|
|
{
|
2010-10-13 12:07:43 -05:00
|
|
|
|
|
|
|
function calculate_dd_index(jobj){
|
|
|
|
var index = 0;
|
|
|
|
var dd = jobj.parents('dd').slice(0, 1)[0];
|
|
|
|
dd = dd.previousElementSibling;
|
|
|
|
|
2010-10-22 15:23:02 -05:00
|
|
|
while(dd.nodeName.toUpperCase() === 'DD'){
|
2010-10-13 12:07:43 -05:00
|
|
|
dd = dd.previousElementSibling;
|
|
|
|
index += 1;
|
|
|
|
if (index > 100 )
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
|
2010-10-27 12:41:48 -05:00
|
|
|
function validate_input(text, param_info,error_link){
|
|
|
|
if(param_info && param_info.pattern){
|
|
|
|
var regex = new RegExp( param_info.pattern );
|
|
|
|
if (!text.match(regex)) {
|
|
|
|
error_link.style.display ="block";
|
|
|
|
if ( param_info.pattern_errmsg){
|
|
|
|
error_link.innerHTML = param_info.pattern_errmsg;
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
error_link.style.display ="none";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
var input = $("<Span />");
|
|
|
|
input.append($("<input/>",{
|
2010-09-29 15:57:07 -05:00
|
|
|
type:"text",
|
|
|
|
name:attr,
|
|
|
|
value:value.toString(),
|
2010-10-27 12:41:48 -05:00
|
|
|
keyup: function(){
|
2010-09-29 15:57:07 -05:00
|
|
|
var undo_link=this.nextElementSibling;
|
|
|
|
undo_link.style.display ="inline";
|
2010-10-27 12:41:48 -05:00
|
|
|
var error_link = undo_link.nextElementSibling;
|
|
|
|
|
|
|
|
var text = $(this).val();
|
|
|
|
validate_input(text, param_info,error_link);
|
2010-09-29 15:57:07 -05:00
|
|
|
}
|
2010-10-27 12:41:48 -05:00
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
}));
|
|
|
|
input.append($("<a/>",{
|
2010-09-29 15:57:07 -05:00
|
|
|
html:"undo",
|
|
|
|
"class":"ui-state-highlight ui-corner-all",
|
|
|
|
style:"display:none",
|
|
|
|
click: function(){
|
|
|
|
var key = this.previousElementSibling.name;
|
|
|
|
var entity_divs = $(this).parents('.details-container');
|
|
|
|
var entry_attrs = ipa_details_cache[entity_divs[0].id];
|
2010-10-13 12:07:43 -05:00
|
|
|
|
|
|
|
index = calculate_dd_index($(this));
|
|
|
|
|
2010-09-29 15:57:07 -05:00
|
|
|
var previous_value = entry_attrs[key] || "";
|
2010-10-22 15:23:02 -05:00
|
|
|
if (index >= previous_value.length){
|
2010-10-13 12:07:43 -05:00
|
|
|
previous_value = '';
|
2010-10-22 15:23:02 -05:00
|
|
|
}else{
|
|
|
|
previous_value= previous_value[index];
|
2010-10-13 12:07:43 -05:00
|
|
|
}
|
|
|
|
|
2010-09-29 15:57:07 -05:00
|
|
|
this.previousElementSibling.value = previous_value;
|
|
|
|
this.style.display = "none";
|
2010-10-27 12:41:48 -05:00
|
|
|
var error_link = this.nextElementSibling;
|
|
|
|
validate_input(previous_value, param_info,error_link);
|
2010-09-29 15:57:07 -05:00
|
|
|
}
|
2010-10-13 12:07:43 -05:00
|
|
|
}));
|
|
|
|
input.append($("<span/>",{
|
2010-09-29 15:57:07 -05:00
|
|
|
html:"Does not match pattern",
|
|
|
|
"class":"ui-state-error ui-corner-all",
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
style:"display:none"
|
2010-09-29 15:57:07 -05:00
|
|
|
}));
|
2010-10-13 12:07:43 -05:00
|
|
|
return input;
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
|
|
|
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
function ipa_details_reset(container)
|
2010-08-06 09:01:44 -05:00
|
|
|
{
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
var obj_name = container.attr('id');
|
|
|
|
|
2010-09-29 15:57:07 -05:00
|
|
|
if (ipa_details_cache[obj_name]){
|
Certificate management for services.
This is an initial implementation of certificate management for
services. It addresses the mechanism required to view and update
certificates. The complete UI implementation will be addressed in
subsequent patches.
On the server side, the service.py has been modified to define
usercertificate in the service object's takes_params. This is
needed to generate the proper JSON metadata which is needed by
the UI. It also has been modified to accept null certificate for
deletion.
On the client side, the service details page has been modified to
display the base64-encoded certificate in a text area. When the
page is saved, the action handler will store the base64-encoded
certificate in the proper JSON structure. Also the service name
and service hostname are now displayed in separate fields.
The details configuration has been modified to support displaying
and updating certificates. The structure is changed to use maps
to define sections and fields. A section contains name, label,
and an array of fields. A field contains name, label, setup
function, load function, and save function. This is used to
implement custom interface and behavior for certificates.
All other entities, test cases, and test data have been updated
accordingly. Some functions and variables have been renamed to
improve clarity and consistency.
2010-10-07 14:02:44 -05:00
|
|
|
ipa_details_display(container, ipa_details_cache[obj_name]);
|
2010-09-29 15:57:07 -05:00
|
|
|
}
|
2010-08-23 21:32:23 -05:00
|
|
|
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Event handlers */
|
|
|
|
|
|
|
|
function _ipa_add_on_click(obj)
|
|
|
|
{
|
|
|
|
var jobj = $(obj);
|
2010-08-25 11:49:30 -05:00
|
|
|
var attr = jobj.attr('title');
|
2010-08-06 09:01:44 -05:00
|
|
|
var par = jobj.parent();
|
2010-09-16 09:28:07 -05:00
|
|
|
var obj_name = jobj.closest('.details-container').attr('title');
|
2010-08-25 11:49:30 -05:00
|
|
|
|
2010-10-22 15:23:02 -05:00
|
|
|
var param_info = ipa_get_param_info(obj_name, '');
|
|
|
|
var input = _ipa_create_text_input(attr, '', param_info);
|
|
|
|
|
|
|
|
par.prepend(input);
|
2010-08-06 09:01:44 -05:00
|
|
|
jobj.next('input').focus();
|
|
|
|
jobj.remove();
|
2010-10-13 12:07:43 -05:00
|
|
|
par.after( ipa_create_other_dd(attr,_ipa_a_add_template.replace('A', attr)));
|
2010-08-25 11:49:30 -05:00
|
|
|
|
2010-08-06 09:01:44 -05:00
|
|
|
return (false);
|
|
|
|
}
|
|
|
|
|
2010-10-22 15:23:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-06 09:01:44 -05:00
|
|
|
function _ipa_remove_on_click(obj)
|
|
|
|
{
|
|
|
|
var jobj = $(obj);
|
|
|
|
var attr = jobj.attr('title');
|
|
|
|
var par = jobj.parent();
|
|
|
|
|
2010-10-13 12:07:43 -05:00
|
|
|
var input = par.find('input');
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2010-10-22 15:23:02 -05:00
|
|
|
if (input.is('.strikethrough')){
|
|
|
|
input.removeClass('strikethrough');
|
|
|
|
jobj.text("Remove");
|
|
|
|
}else{
|
|
|
|
input.addClass('strikethrough');
|
|
|
|
jobj.text("Undo");
|
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
return (false);
|
|
|
|
}
|
|
|
|
|
|
|
|
function _h2_on_click(obj)
|
|
|
|
{
|
|
|
|
var jobj = $(obj);
|
|
|
|
var txt = jobj.text().replace(/^\s*/, '');
|
|
|
|
if (txt.charCodeAt(0) == 8722) {
|
2010-08-25 11:49:30 -05:00
|
|
|
obj.dl = jobj.next().detach();
|
|
|
|
jobj.text('+' + txt.substr(1));
|
2010-08-06 09:01:44 -05:00
|
|
|
} else {
|
2010-08-25 11:49:30 -05:00
|
|
|
if (obj.dl)
|
|
|
|
obj.dl.insertAfter(obj);
|
|
|
|
jobj.text(
|
|
|
|
String.fromCharCode(8722) + txt.substr(1)
|
|
|
|
);
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|