2011-01-14 11:16:25 -06:00
|
|
|
/*jsl:import ipa.js */
|
|
|
|
|
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
|
|
|
|
*
|
2010-12-09 06:59:11 -06:00
|
|
|
* 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, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2010-08-06 09:01:44 -05:00
|
|
|
*
|
|
|
|
* 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
|
2010-12-09 06:59:11 -06:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
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-12-09 15:32:22 -06:00
|
|
|
IPA.expand_icon = 'ui-icon-minus';
|
|
|
|
IPA.collapse_icon = 'ui-icon-plus';
|
|
|
|
|
2011-02-04 11:48:09 -06:00
|
|
|
IPA.details_section = function(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 = {};
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
that.name = spec.name || '';
|
|
|
|
that.label = spec.label || '';
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
that.template = spec.template;
|
|
|
|
that._entity_name = spec.entity_name;
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
that.fields = [];
|
|
|
|
that.fields_by_name = {};
|
|
|
|
|
2011-02-04 11:48:09 -06:00
|
|
|
that.__defineGetter__('entity_name', function() {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
return that._entity_name;
|
|
|
|
});
|
|
|
|
|
2011-02-04 11:48:09 -06:00
|
|
|
that.__defineSetter__('entity_name', function(entity_name) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
that._entity_name = entity_name;
|
|
|
|
|
|
|
|
for (var i=0; i<that.fields.length; i++) {
|
|
|
|
that.fields[i].entity_name = entity_name;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
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) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
field.entity_name = that.entity_name;
|
2010-10-27 22:32:30 -05:00
|
|
|
that.fields.push(field);
|
|
|
|
that.fields_by_name[field.name] = field;
|
2010-10-25 18:55:57 -05:00
|
|
|
return field;
|
2010-10-27 22:32:30 -05:00
|
|
|
};
|
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
that.field = function(field) {
|
|
|
|
that.add_field(field);
|
|
|
|
return that;
|
|
|
|
};
|
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
that.text = function(spec) {
|
|
|
|
var field = IPA.text_widget(spec);
|
|
|
|
that.add_field(field);
|
|
|
|
return that;
|
|
|
|
};
|
|
|
|
|
2011-02-02 16:18:35 -06:00
|
|
|
that.multivalued_text = function(spec) {
|
2011-03-18 15:43:54 -05:00
|
|
|
spec.entity_name = that.entity_name;
|
2011-02-02 16:18:35 -06:00
|
|
|
var field = IPA.multivalued_text_widget(spec);
|
|
|
|
that.add_field(field);
|
|
|
|
return that;
|
|
|
|
};
|
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
that.textarea = function(spec) {
|
|
|
|
var field = IPA.textarea_widget(spec);
|
|
|
|
that.add_field(field);
|
|
|
|
return that;
|
|
|
|
};
|
2011-01-12 21:00:38 -06:00
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
that.radio = function(spec) {
|
|
|
|
var field = IPA.radio_widget(spec);
|
2010-10-27 22:32:30 -05:00
|
|
|
that.add_field(field);
|
2011-02-03 21:42:50 -06:00
|
|
|
return that;
|
2010-10-27 22:32:30 -05:00
|
|
|
};
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
that.init = function() {
|
|
|
|
for (var i=0; i<that.fields.length; i++) {
|
|
|
|
var field = that.fields[i];
|
|
|
|
field.init();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
that.create = function(container) {
|
|
|
|
|
|
|
|
if (that.template) return;
|
|
|
|
|
|
|
|
var fields = that.fields;
|
|
|
|
for (var i = 0; i < fields.length; ++i) {
|
|
|
|
var field = fields[i];
|
|
|
|
|
|
|
|
var span = $('<span/>', { 'name': field.name }).appendTo(container);
|
|
|
|
field.create(span);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
that.setup = function(container) {
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.container = container;
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
if (that.template) return;
|
|
|
|
|
|
|
|
var fields = that.fields;
|
|
|
|
for (var i = 0; i < fields.length; ++i) {
|
|
|
|
var field = fields[i];
|
|
|
|
|
|
|
|
var span = $('span[name='+field.name+']', this.container).first();
|
|
|
|
field.setup(span);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
that.load = function(record) {
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
that.record = record;
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
var fields = that.fields;
|
|
|
|
|
|
|
|
if (that.template) {
|
|
|
|
var template = IPA.get_template(that.template);
|
|
|
|
this.container.load(
|
|
|
|
template,
|
|
|
|
function(data, text_status, xhr) {
|
|
|
|
for (var i = 0; i < fields.length; ++i) {
|
|
|
|
var field = fields[i];
|
|
|
|
var span = $('span[name='+field.name+']', this.container).first();
|
|
|
|
field.setup(span);
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
field.load(record);
|
2010-11-15 11:10:55 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (var j=0; j<fields.length; j++) {
|
|
|
|
var field = fields[j];
|
|
|
|
var span = $('span[name='+field.name+']', this.container).first();
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
field.load(record);
|
2010-11-15 11:10:55 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
that.reset = function() {
|
|
|
|
for (var i=0; i<that.fields.length; i++) {
|
|
|
|
var field = that.fields[i];
|
|
|
|
var span = $('span[name='+field.name+']', this.container).first();
|
2010-11-18 20:17:14 -06:00
|
|
|
field.reset();
|
2010-11-15 11:10:55 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-02-04 11:48:09 -06:00
|
|
|
that.is_dirty = function() {
|
2011-01-26 19:58:06 -06:00
|
|
|
for (var i=0; i<that.fields.length; i++) {
|
|
|
|
var field = that.fields[i];
|
2011-02-04 11:48:09 -06:00
|
|
|
if (field.is_dirty()) {
|
2011-01-26 19:58:06 -06:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
2011-01-28 09:21:30 -06:00
|
|
|
};
|
2011-01-26 19:58:06 -06:00
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
// methods that should be invoked by subclasses
|
2010-12-02 22:12:59 -06:00
|
|
|
that.section_init = that.init;
|
2010-11-15 11:10:55 -06:00
|
|
|
that.section_create = that.create;
|
|
|
|
that.section_setup = that.setup;
|
|
|
|
that.section_load = that.load;
|
2011-01-29 14:25:56 -06:00
|
|
|
that.section_reset = that.reset;
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2010-11-16 18:10:40 -06:00
|
|
|
/**
|
|
|
|
* This class creates a details section formatted as a list of
|
2011-02-04 11:48:09 -06:00
|
|
|
* attributes names and values. The list is defined using a <dl> tag.
|
2010-11-16 18:10:40 -06:00
|
|
|
* The attribute name is defined inside a <dt> tag. The attribute
|
2011-02-04 11:48:09 -06:00
|
|
|
* value is specified within a <span> inside a <dd> tag. If the
|
|
|
|
* attribute has multiple values the <span> will contain be
|
|
|
|
* duplicated to display each value.
|
2010-11-16 18:10:40 -06:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* <dl class="entryattrs">
|
|
|
|
*
|
|
|
|
* <dt title="givenname">First Name:</dt>
|
2011-02-04 11:48:09 -06:00
|
|
|
* <dd>
|
|
|
|
* <span name="givenname">
|
|
|
|
* John Smith
|
|
|
|
* </span>
|
|
|
|
* </dd>
|
2010-11-16 18:10:40 -06:00
|
|
|
*
|
|
|
|
* <dt title="telephonenumber">Telephone Number:</dt>
|
2011-02-04 11:48:09 -06:00
|
|
|
* <dd>
|
|
|
|
* <span name="telephonenumber">
|
|
|
|
* <div name="value">111-1111</div>
|
|
|
|
* <div name="value">222-2222</div>
|
|
|
|
* </span>
|
|
|
|
* </dd>
|
2010-11-16 18:10:40 -06:00
|
|
|
*
|
|
|
|
* </dl>
|
|
|
|
*/
|
2011-02-04 11:48:09 -06:00
|
|
|
IPA.details_list_section = function(spec) {
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.details_section(spec);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
that.create = function(container) {
|
|
|
|
|
|
|
|
// do not call section_create() here
|
|
|
|
|
|
|
|
if (that.template) return;
|
|
|
|
|
|
|
|
var dl = $('<dl/>', {
|
|
|
|
'id': that.name,
|
|
|
|
'class': 'entryattrs'
|
|
|
|
}).appendTo(container);
|
|
|
|
|
|
|
|
var fields = that.fields;
|
|
|
|
for (var i = 0; i < fields.length; ++i) {
|
|
|
|
var field = fields[i];
|
|
|
|
|
2011-02-02 16:18:35 -06:00
|
|
|
var label = field.label || '';
|
2011-01-12 21:00:38 -06:00
|
|
|
|
2010-11-16 18:10:40 -06:00
|
|
|
$('<dt/>', {
|
2011-02-02 16:18:35 -06:00
|
|
|
html: label+':',
|
|
|
|
title: label
|
2010-11-16 18:10:40 -06:00
|
|
|
}).appendTo(dl);
|
|
|
|
|
2011-02-03 21:42:50 -06:00
|
|
|
var dd = $('<dd/>', {
|
|
|
|
'class': 'first'
|
|
|
|
}).appendTo(dl);
|
|
|
|
|
|
|
|
var span = $('<span/>', { 'name': field.name }).appendTo(dd);
|
2010-11-15 11:10:55 -06:00
|
|
|
field.create(span);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
|
|
|
|
2011-02-04 11:48:09 -06:00
|
|
|
IPA.details_facet = function(spec) {
|
2010-10-13 12:07:43 -05:00
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
spec = spec || {};
|
2011-01-19 20:10:18 -06:00
|
|
|
spec.name = spec.name || 'details';
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.facet(spec);
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-14 14:14:32 -06:00
|
|
|
that.label = ( IPA.messages && IPA.messages.facets && IPA.messages.facets.details) || spec.label;
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
that.is_dirty = spec.is_dirty || is_dirty;
|
2011-04-07 16:14:58 -05:00
|
|
|
that.create_content = spec.create_content || create_content;
|
2010-12-09 10:43:21 -06:00
|
|
|
that.setup = spec.setup || setup;
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
that.load = spec.load || load;
|
2011-01-12 18:51:22 -06:00
|
|
|
that.update = spec.update || IPA.details_update;
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
that.reset = spec.reset || reset;
|
2011-01-12 18:51:22 -06:00
|
|
|
that.refresh = spec.refresh || IPA.details_refresh;
|
2010-10-27 22:32:30 -05:00
|
|
|
|
|
|
|
that.sections = [];
|
2011-01-28 15:46:19 -06:00
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
that.__defineGetter__("entity_name", function(){
|
|
|
|
return that._entity_name;
|
|
|
|
});
|
|
|
|
|
|
|
|
that.__defineSetter__("entity_name", function(entity_name){
|
|
|
|
that._entity_name = entity_name;
|
|
|
|
|
|
|
|
for (var i=0; i<that.sections.length; i++) {
|
|
|
|
that.sections[i].entity_name = entity_name;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
that.add_section = function(section) {
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
section.entity_name = that.entity_name;
|
2010-10-27 22:32:30 -05:00
|
|
|
that.sections.push(section);
|
2010-10-25 18:55:57 -05:00
|
|
|
return section;
|
2010-10-27 22:32:30 -05:00
|
|
|
};
|
|
|
|
|
2011-01-19 20:10:18 -06:00
|
|
|
that.section = function(section) {
|
|
|
|
that.add_section(section);
|
|
|
|
return that;
|
|
|
|
};
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
that.create_section = function(spec) {
|
2011-01-12 18:51:22 -06:00
|
|
|
var section = IPA.details_section(spec);
|
2010-10-27 22:32:30 -05:00
|
|
|
that.add_section(section);
|
|
|
|
return section;
|
|
|
|
};
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
that.init = function() {
|
2011-02-08 15:41:24 -06:00
|
|
|
|
|
|
|
that.facet_init();
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
for (var i=0; i<that.sections.length; i++) {
|
|
|
|
var section = that.sections[i];
|
|
|
|
section.init();
|
|
|
|
}
|
|
|
|
};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.get_primary_key = function() {
|
2011-02-16 12:46:59 -06:00
|
|
|
var pkey_name = IPA.metadata.objects[that.entity_name].primary_key;
|
2010-10-25 18:55:57 -05:00
|
|
|
if (that.record[pkey_name] instanceof Array){
|
|
|
|
return that.record[pkey_name][0];
|
|
|
|
}else{
|
|
|
|
return that.record[pkey_name];
|
|
|
|
}
|
2010-11-18 20:17:14 -06:00
|
|
|
};
|
|
|
|
|
2011-04-07 16:14:58 -05:00
|
|
|
function create_content(container) {
|
2010-12-09 10:43:21 -06:00
|
|
|
|
2011-02-16 12:46:59 -06:00
|
|
|
var label = IPA.metadata.objects[that.entity_name].label;
|
|
|
|
|
|
|
|
var title = IPA.messages.details.settings;
|
|
|
|
title = title.replace('${entity}', label);
|
|
|
|
|
2011-01-10 20:14:51 -06:00
|
|
|
$('<h1/>',{
|
2011-02-16 12:46:59 -06:00
|
|
|
html: "<span id='headerpkey' />"+title
|
2011-01-10 20:14:51 -06:00
|
|
|
}).append(IPA.create_network_spinner()).
|
|
|
|
appendTo(container);
|
|
|
|
|
2010-12-09 10:43:21 -06:00
|
|
|
var details = $('<div/>', {
|
2011-04-07 16:14:58 -05:00
|
|
|
'name': 'details'
|
2010-12-09 10:43:21 -06:00
|
|
|
}).appendTo(container);
|
|
|
|
|
2011-02-10 16:10:53 -06:00
|
|
|
$('<a/>', {
|
|
|
|
name: 'expand_all',
|
|
|
|
href: 'expand_all',
|
|
|
|
text: 'Expand All',
|
2011-02-22 12:09:14 -06:00
|
|
|
'class': 'expand-collapse-all',
|
2011-02-10 16:10:53 -06:00
|
|
|
style: 'display: none;'
|
|
|
|
}).appendTo(details);
|
|
|
|
|
|
|
|
$('<a/>', {
|
|
|
|
name: 'collapse_all',
|
|
|
|
href: 'collapse_all',
|
2011-02-22 12:09:14 -06:00
|
|
|
text: 'Collapse All',
|
|
|
|
'class': 'expand-collapse-all'
|
2011-02-10 16:10:53 -06:00
|
|
|
}).appendTo(details);
|
|
|
|
|
|
|
|
details.append('<br/>');
|
|
|
|
|
2010-12-09 10:43:21 -06:00
|
|
|
var action_panel = that.get_action_panel();
|
|
|
|
|
|
|
|
var ul = $('ul', action_panel);
|
|
|
|
var buttons = $('.action-controls',action_panel);
|
|
|
|
|
|
|
|
$('<input/>', {
|
|
|
|
'type': 'text',
|
|
|
|
'name': 'reset'
|
|
|
|
}).appendTo(buttons);
|
|
|
|
|
|
|
|
$('<input/>', {
|
|
|
|
'type': 'text',
|
|
|
|
'name': 'update'
|
|
|
|
}).appendTo(buttons);
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < that.sections.length; ++i) {
|
|
|
|
var section = that.sections[i];
|
|
|
|
|
2011-02-10 16:10:53 -06:00
|
|
|
var header = $('<h2/>', {
|
2011-01-06 08:16:05 -06:00
|
|
|
name: section.name,
|
2011-02-10 16:10:53 -06:00
|
|
|
title: section.label
|
2010-12-09 10:43:21 -06:00
|
|
|
}).appendTo(details);
|
|
|
|
|
2011-02-10 16:10:53 -06:00
|
|
|
var icon = $('<span/>', {
|
|
|
|
name: 'icon',
|
|
|
|
'class': 'ui-icon section-expand '+IPA.expand_icon
|
|
|
|
}).appendTo(header);
|
|
|
|
|
|
|
|
header.append(' ');
|
|
|
|
|
|
|
|
header.append(section.label);
|
|
|
|
|
2010-12-09 10:43:21 -06:00
|
|
|
var div = $('<div/>', {
|
2011-02-10 16:10:53 -06:00
|
|
|
name: section.name,
|
2010-12-09 10:43:21 -06:00
|
|
|
'class': 'details-section'
|
|
|
|
}).appendTo(details);
|
|
|
|
|
|
|
|
section.create(div);
|
|
|
|
|
|
|
|
details.append('<hr/>');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function setup(container) {
|
|
|
|
|
|
|
|
that.facet_setup(container);
|
|
|
|
|
|
|
|
var button = $('input[name=reset]', that.container);
|
2010-12-09 15:32:22 -06:00
|
|
|
that.reset_button = IPA.action_button({
|
2010-12-09 10:43:21 -06:00
|
|
|
'label': 'Reset',
|
|
|
|
'icon': 'ui-icon-refresh',
|
|
|
|
'class': 'details-reset',
|
|
|
|
'click': function() {
|
|
|
|
that.reset();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
button.replaceWith(that.reset_button);
|
|
|
|
|
|
|
|
button = $('input[name=update]', that.container);
|
2010-12-09 15:32:22 -06:00
|
|
|
that.update_button = IPA.action_button({
|
2010-12-09 10:43:21 -06:00
|
|
|
'label': 'Update',
|
|
|
|
'icon': 'ui-icon-check',
|
|
|
|
'class': 'details-update',
|
|
|
|
'click': function() {
|
|
|
|
that.update();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
button.replaceWith(that.update_button);
|
|
|
|
|
2011-04-07 16:14:58 -05:00
|
|
|
var details = $('div[name=details]', that.container);
|
2011-02-10 16:10:53 -06:00
|
|
|
|
|
|
|
var expand_all = $('a[name=expand_all]', details);
|
|
|
|
expand_all.click(function() {
|
|
|
|
expand_all.css('display', 'none');
|
|
|
|
collapse_all.css('display', 'inline');
|
|
|
|
|
|
|
|
for (var i=0; i<that.sections.length; i++) {
|
|
|
|
var section = that.sections[i];
|
|
|
|
toggle(section, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
var collapse_all = $('a[name=collapse_all]', details);
|
|
|
|
collapse_all.click(function() {
|
|
|
|
expand_all.css('display', 'inline');
|
|
|
|
collapse_all.css('display', 'none');
|
|
|
|
|
|
|
|
for (var i=0; i<that.sections.length; i++) {
|
|
|
|
var section = that.sections[i];
|
|
|
|
toggle(section, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2010-12-09 10:43:21 -06:00
|
|
|
for (var i = 0; i < that.sections.length; ++i) {
|
|
|
|
var section = that.sections[i];
|
|
|
|
|
|
|
|
var header = $('h2[name='+section.name+']', that.container);
|
2011-02-10 16:10:53 -06:00
|
|
|
var div = $('div.details-section[name='+section.name+']', that.container);
|
2010-12-09 10:43:21 -06:00
|
|
|
|
2011-02-10 16:10:53 -06:00
|
|
|
header.click(function(section, div) {
|
2010-12-09 10:43:21 -06:00
|
|
|
return function() {
|
|
|
|
var visible = div.is(":visible");
|
2011-02-10 16:10:53 -06:00
|
|
|
toggle(section, !visible);
|
2011-01-12 13:47:29 -06:00
|
|
|
};
|
2011-02-10 16:10:53 -06:00
|
|
|
}(section, div));
|
2010-12-09 10:43:21 -06:00
|
|
|
|
|
|
|
section.setup(div);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-10 16:10:53 -06:00
|
|
|
function toggle(section, visible) {
|
|
|
|
var header = $('h2[name='+section.name+']', that.container);
|
|
|
|
|
|
|
|
var icon = $('span[name=icon]', header);
|
|
|
|
icon.toggleClass(IPA.expand_icon, visible);
|
|
|
|
icon.toggleClass(IPA.collapse_icon, !visible);
|
|
|
|
|
|
|
|
var div = section.container;
|
|
|
|
|
|
|
|
if (visible != div.is(":visible")) {
|
|
|
|
div.slideToggle();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-26 19:58:06 -06:00
|
|
|
function new_key(){
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
|
|
|
|
return pkey != that.pkey;
|
|
|
|
}
|
2011-01-26 19:58:06 -06:00
|
|
|
that.new_key = new_key;
|
|
|
|
|
|
|
|
|
|
|
|
function is_dirty() {
|
|
|
|
|
|
|
|
var i;
|
|
|
|
for ( i =0; i < that.sections.length; i +=1 ){
|
|
|
|
if (that.sections[i].is_dirty()){
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
|
|
|
function load(record) {
|
|
|
|
that.record = record;
|
|
|
|
for (var i=0; i<that.sections.length; i++) {
|
|
|
|
var section = that.sections[i];
|
|
|
|
section.load(record);
|
|
|
|
}
|
2011-01-10 20:14:51 -06:00
|
|
|
if (that.pkey){
|
|
|
|
$('h1 #headerpkey',that.container).html(that.pkey+": ");
|
|
|
|
}
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
function reset() {
|
2011-01-10 20:14:51 -06:00
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
for (var i=0; i<that.sections.length; i++) {
|
|
|
|
var section = that.sections[i];
|
|
|
|
section.reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-16 18:10:40 -06:00
|
|
|
that.details_facet_init = that.init;
|
2011-04-07 16:14:58 -05:00
|
|
|
that.details_facet_create_content = that.create_content;
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
that.details_facet_load = that.load;
|
2010-11-16 18:10:40 -06:00
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-12-09 15:32:22 -06:00
|
|
|
IPA.action_button = function(spec) {
|
2011-01-12 18:51:22 -06:00
|
|
|
var button = IPA.button(spec);
|
2010-12-09 15:32:22 -06:00
|
|
|
button.removeClass("ui-state-default").addClass("action-button");
|
|
|
|
return button;
|
2011-01-12 13:47:29 -06:00
|
|
|
};
|
2010-12-09 15:32:22 -06:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.button = function(spec) {
|
2010-10-27 22:32:30 -05:00
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
spec = spec || {};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
var button = $('<a/>', {
|
2011-01-06 08:16:05 -06:00
|
|
|
id: spec.id,
|
|
|
|
html: spec.label,
|
|
|
|
title: spec.title || spec.label,
|
2011-01-17 18:10:41 -06:00
|
|
|
'class': 'ui-state-default ui-corner-all'
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
});
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-02-21 16:28:06 -06:00
|
|
|
if (spec.click) {
|
|
|
|
button.click(spec.click);
|
|
|
|
}
|
|
|
|
|
2010-11-29 08:46:39 -06:00
|
|
|
if (spec['class']) button.addClass(spec['class']);
|
2011-01-17 18:10:41 -06:00
|
|
|
|
|
|
|
if (spec.icon) {
|
|
|
|
button.addClass('input_link');
|
|
|
|
button.append('<span class="ui-icon '+spec.icon+'" ></span> ');
|
|
|
|
} else {
|
|
|
|
button.addClass('button-without-icon');
|
|
|
|
}
|
2010-10-27 22:32:30 -05:00
|
|
|
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
return button;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-02-04 11:48:09 -06:00
|
|
|
IPA.details_refresh = function() {
|
2010-09-29 00:52:56 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
var that = this;
|
|
|
|
|
2011-02-11 14:36:29 -06:00
|
|
|
that.pkey = $.bbq.getState(that.entity_name + '-pkey', true) ;
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
var command = IPA.command({
|
2011-04-12 02:13:30 -05:00
|
|
|
entity: that.entity_name,
|
|
|
|
method: 'show',
|
|
|
|
options: { all: true, rights: true }
|
2011-01-29 14:25:56 -06:00
|
|
|
});
|
2011-03-18 15:43:54 -05:00
|
|
|
|
2011-03-31 14:32:29 -05:00
|
|
|
if (IPA.details_refresh_devel_hook){
|
|
|
|
IPA.details_refresh_devel_hook(that.entity_name,command,that.pkey);
|
2011-03-18 15:43:54 -05:00
|
|
|
}
|
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
|
2011-02-11 14:36:29 -06:00
|
|
|
if (that.pkey){
|
|
|
|
command.args = [that.pkey];
|
|
|
|
}
|
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
command.on_success = function(data, text_status, xhr) {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.load(data.result.result);
|
2011-01-29 14:25:56 -06:00
|
|
|
};
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
command.on_error = function(xhr, text_status, error_thrown) {
|
2010-11-18 20:17:14 -06:00
|
|
|
var details = $('.details', that.container).empty();
|
2010-11-09 14:22:31 -06:00
|
|
|
details.append('<p>Error: '+error_thrown.name+'</p>');
|
|
|
|
details.append('<p>'+error_thrown.title+'</p>');
|
|
|
|
details.append('<p>'+error_thrown.message+'</p>');
|
2011-01-29 14:25:56 -06:00
|
|
|
};
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-01-29 14:25:56 -06:00
|
|
|
command.execute();
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
2010-09-16 09:28:07 -05:00
|
|
|
|
2011-02-04 11:48:09 -06:00
|
|
|
IPA.details_update = function(on_win, on_fail) {
|
2010-11-18 20:17:14 -06:00
|
|
|
var that = this;
|
|
|
|
var entity_name = that.entity_name;
|
|
|
|
|
2011-01-28 09:36:25 -06:00
|
|
|
function on_success(data, text_status, xhr) {
|
2010-09-16 09:28:07 -05:00
|
|
|
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;
|
2010-11-18 20:17:14 -06:00
|
|
|
that.load(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
|
|
|
}
|
2010-09-16 09:28:07 -05:00
|
|
|
|
2011-01-28 09:36:25 -06:00
|
|
|
function on_error(xhr, text_status, error_thrown) {
|
2010-09-16 09:28:07 -05:00
|
|
|
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
|
|
|
|
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-11-05 12:11:56 -05:00
|
|
|
var modlist = {'all': true, 'setattr': [], 'addattr': [], 'rights': true};
|
2010-08-06 09:01:44 -05:00
|
|
|
var attrs_wo_option = {};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
for (var i=0; i<that.sections.length; i++) {
|
|
|
|
var section = that.sections[i];
|
HBAC Details Page
The UI framework has been extended to include a collection of widgets:
- ipa_widget: base class
- ipa_text_widget: text field
- ipa_radio_widget: radio button
- ipa_textarea_widget: textarea
- ipa_button_widget: button
- ipa_column_widget: column for table
- ipa_table_widget: table
These widgets can be used to create input controls. They can also be
extended to create custom controls.
The framework has also been enhanced to support custom layouts. This
can be used to change the look of the application without changing
the code. Initially this is only available in details section.
Layout consists of a collection of HTML templates. Each template is a
complete and valid HTML file representing a portion of a page. The
template will be loaded and initialized by the code, then filled with
the data from the server. The layouts are located in
install/static/layouts/<name> folder.
By default, if no templates are used, the fields in the details page
are rendered vertically using dd/dt/dd tags. For pages that require
different layout, a custom UI needs to be developed. There are two ways
to do that:
- write a custom widget to generate the UI dynamically
- create an HTML template and write the initialization code
For components that are quite complex or used frequently, it's might
be better to use the first method. For simple pages that are used only
in one location or need to support customization, the second method
might be preferable. Other benefits of templates:
- cleaner code and UI separation
- more flexibility in customization
- new pages can be developed quickly and require less coding
- multiple templates can be used with the same initialization code
- easier to maintain
The HBAC details page has been implemented using both methods. By
default it will use custom widgets to generate the page. To use a
custom layout, add the following parameter to the URL, then reload
the page:
&layout=<name>
Currently the only available layout is 'default' which produces the
same look as the custom widgets.
The HBAC details page is usable, but it still needs additional work.
The access time is not working yet. There is no undo button, hint,
or validation yet.
The table in the association facet has also been changed to use
ipa_association_widget which is derived from ipa_table_widget.
The Makefile has been updated to include the layouts. The unit tests
have been updated as well.
2010-11-02 20:16:55 -05:00
|
|
|
|
2010-10-25 18:55:57 -05:00
|
|
|
if (section.save){
|
|
|
|
section.save(modlist);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
for (var j=0; j<section.fields.length; j++) {
|
|
|
|
var field = section.fields[j];
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2011-02-10 16:10:53 -06:00
|
|
|
var span = $('span[name='+field.name+']', section.container).first();
|
2010-11-18 20:17:14 -06:00
|
|
|
values = field.save();
|
|
|
|
if (!values) continue;
|
2010-08-06 09:01:44 -05:00
|
|
|
|
2011-02-16 12:46:59 -06:00
|
|
|
var param_info = IPA.get_entity_param(entity_name, 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
|
|
|
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];
|
2011-01-28 09:36:25 -06:00
|
|
|
} else if (values.length > 1){
|
|
|
|
if (field.join) {
|
|
|
|
modlist[field.name] = values.join(',');
|
|
|
|
} else {
|
|
|
|
modlist[field.name] = values;
|
|
|
|
}
|
2010-10-22 15:23:02 -05:00
|
|
|
} else if (param_info['multivalue']){
|
2010-11-18 20:17:14 -06:00
|
|
|
modlist[field.name] = [];
|
2010-10-22 15:23: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
|
|
|
} 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
|
|
|
|
2011-01-14 11:16:25 -06:00
|
|
|
for (var 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]);
|
2011-01-12 13:47:29 -06:00
|
|
|
for (var k = 1; k < values.length; ++k){
|
|
|
|
modlist['addattr'].push(attr + '=' + values[k]);
|
|
|
|
}
|
2010-08-06 09:01:44 -05:00
|
|
|
}
|
|
|
|
|
2011-01-28 09:36:25 -06:00
|
|
|
var pkey = that.get_primary_key();
|
|
|
|
|
|
|
|
var args = pkey ? [pkey] : [];
|
|
|
|
|
|
|
|
var command = IPA.command({
|
2011-04-12 02:13:30 -05:00
|
|
|
entity: entity_name,
|
|
|
|
method: 'mod',
|
2011-01-28 09:36:25 -06:00
|
|
|
args: args,
|
|
|
|
options: modlist,
|
|
|
|
on_success: on_success,
|
|
|
|
on_error: on_error
|
|
|
|
});
|
|
|
|
|
|
|
|
//alert(JSON.stringify(command.to_json()));
|
2011-01-14 12:19:56 -06:00
|
|
|
|
2011-01-28 09:36:25 -06:00
|
|
|
command.execute();
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|