2011-01-14 11:16:25 -06:00
|
|
|
/*jsl:import ipa.js */
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
/* Authors:
|
|
|
|
* Endi Sukma Dewata <edewata@redhat.com>
|
|
|
|
*
|
|
|
|
* 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-10-27 22:32:30 -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-10-27 22:32:30 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.hbacrule = function () {
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.entity({
|
2011-01-11 07:31:09 -06:00
|
|
|
'name': 'hbacrule'
|
2010-10-27 22:32:30 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
that.init = 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
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var dialog = IPA.hbacrule_add_dialog({
|
2010-10-27 22:32:30 -05:00
|
|
|
'name': 'add',
|
2010-11-09 14:22:31 -06:00
|
|
|
'title': 'Add New Rule'
|
2010-10-27 22:32:30 -05:00
|
|
|
});
|
2010-11-09 14:22:31 -06:00
|
|
|
that.add_dialog(dialog);
|
|
|
|
dialog.init();
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var facet = IPA.hbacrule_search_facet({
|
2010-10-27 22:32:30 -05:00
|
|
|
'name': 'search',
|
2010-11-09 14:22:31 -06:00
|
|
|
'label': 'Search'
|
2010-10-27 22:32:30 -05:00
|
|
|
});
|
2010-11-09 14:22:31 -06:00
|
|
|
that.add_facet(facet);
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
facet = IPA.hbacrule_details_facet({
|
2011-01-14 14:14:32 -06:00
|
|
|
'name': 'details'
|
2010-10-27 22:32:30 -05:00
|
|
|
});
|
2010-11-09 14:22:31 -06:00
|
|
|
that.add_facet(facet);
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.entity_init();
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.add_entity(IPA.hbacrule());
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-14 11:16:25 -06:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.hbacrule_add_dialog = function (spec) {
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
spec = spec || {};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.add_dialog(spec);
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
that.init = function() {
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
that.add_field(IPA.text_widget({
|
2010-11-09 14:22:31 -06:00
|
|
|
'name': 'cn',
|
2010-11-15 11:10:55 -06:00
|
|
|
'undo': false
|
2010-11-09 14:22:31 -06:00
|
|
|
}));
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
that.add_field(IPA.radio_widget({
|
2010-11-09 14:22:31 -06:00
|
|
|
'name': 'accessruletype',
|
2010-11-18 23:53:14 -06:00
|
|
|
'options': [
|
|
|
|
{ 'value': 'allow', 'label': 'Allow' },
|
|
|
|
{ 'value': 'deny', 'label': 'Deny' }
|
|
|
|
],
|
2010-11-15 11:10:55 -06:00
|
|
|
'undo': false
|
2010-11-09 14:22:31 -06:00
|
|
|
}));
|
2010-12-06 16:30:10 -06:00
|
|
|
|
|
|
|
that.add_dialog_init();
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.hbacrule_search_facet = function (spec) {
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
spec = spec || {};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.search_facet(spec);
|
2010-11-09 14:22:31 -06:00
|
|
|
|
|
|
|
that.init = function() {
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-12-06 13:51:49 -06:00
|
|
|
that.create_column({name:'cn'});
|
|
|
|
that.create_column({name:'usercategory'});
|
|
|
|
that.create_column({name:'hostcategory'});
|
|
|
|
that.create_column({name:'ipaenabledflag'});
|
|
|
|
that.create_column({name:'servicecategory'});
|
|
|
|
that.create_column({name:'sourcehostcategory'});
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.search_facet_init();
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
that.create = function(container) {
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
/*
|
|
|
|
// Not yet implemented
|
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-11-09 14:22:31 -06:00
|
|
|
var left_buttons = $('<span/>', {
|
|
|
|
'style': 'float: left;'
|
|
|
|
}).appendTo(container);
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
left_buttons.append(IPA.button({
|
2010-11-09 14:22:31 -06:00
|
|
|
'label': 'Troubleshoot Rules'
|
|
|
|
}));
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
left_buttons.append(IPA.button({
|
2010-11-09 14:22:31 -06:00
|
|
|
'label': 'Cull Disabled Rules'
|
|
|
|
}));
|
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
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.search_facet_create(container);
|
2010-11-15 14:15:47 -06:00
|
|
|
|
2010-11-19 11:38:35 -06:00
|
|
|
};
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.hbacrule_details_facet = function (spec) {
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
spec = spec || {};
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.details_facet(spec);
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
that.init = function() {
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
var 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
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
if (IPA.layout) {
|
|
|
|
section = that.create_section({
|
|
|
|
'name': 'general',
|
|
|
|
'label': 'General',
|
2011-01-11 07:31:09 -06:00
|
|
|
'template': 'hbacrule-details-general.html #contents'
|
2010-11-09 14:22:31 -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
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
} else {
|
2011-01-12 18:51:22 -06:00
|
|
|
section = IPA.hbacrule_details_general_section({
|
2010-11-09 14:22:31 -06:00
|
|
|
'name': 'general',
|
|
|
|
'label': 'General'
|
|
|
|
});
|
|
|
|
that.add_section(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
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
section.create_text({ 'name': 'cn', 'label': 'Name', 'read_only': true });
|
2010-11-09 14:22:31 -06:00
|
|
|
section.create_radio({ 'name': 'accessruletype', 'label': 'Rule Type' });
|
|
|
|
section.create_textarea({ 'name': 'description', 'label': 'Description' });
|
|
|
|
section.create_radio({ 'name': 'ipaenabledflag', 'label': 'Enabled' });
|
|
|
|
|
|
|
|
if (IPA.layout) {
|
|
|
|
section = that.create_section({
|
|
|
|
'name': 'user',
|
|
|
|
'label': 'Who',
|
2011-01-11 07:31:09 -06:00
|
|
|
'template': 'hbacrule-details-user.html #contents'
|
2010-11-09 14:22:31 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
2011-01-12 18:51:22 -06:00
|
|
|
section = IPA.rule_details_section({
|
2010-11-09 14:22:31 -06:00
|
|
|
'name': 'user',
|
|
|
|
'label': 'Who',
|
|
|
|
'text': 'Rule applies when access is requested by:',
|
|
|
|
'field_name': 'usercategory',
|
|
|
|
'options': [
|
|
|
|
{ 'value': 'all', 'label': 'Anyone' },
|
|
|
|
{ 'value': '', 'label': 'Specified Users and Groups' }
|
|
|
|
],
|
|
|
|
'tables': [
|
|
|
|
{ 'field_name': 'memberuser_user' },
|
|
|
|
{ 'field_name': 'memberuser_group' }
|
|
|
|
]
|
|
|
|
});
|
|
|
|
that.add_section(section);
|
|
|
|
}
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
var category = section.create_radio({ name: 'usercategory', label: 'User category' });
|
2011-01-12 18:51:22 -06:00
|
|
|
section.add_field(IPA.rule_association_table_widget({
|
2010-11-09 14:22:31 -06:00
|
|
|
'id': that.entity_name+'-memberuser_user',
|
2010-11-15 11:10:55 -06:00
|
|
|
'name': 'memberuser_user', 'label': 'Users', 'category': category,
|
2010-11-18 20:17:14 -06:00
|
|
|
'other_entity': 'user', 'add_method': 'add_user', 'remove_method': 'remove_user'
|
2010-11-09 14:22:31 -06:00
|
|
|
}));
|
2011-01-12 18:51:22 -06:00
|
|
|
section.add_field(IPA.rule_association_table_widget({
|
2010-11-09 14:22:31 -06:00
|
|
|
'id': that.entity_name+'-memberuser_group',
|
2010-11-15 11:10:55 -06:00
|
|
|
'name': 'memberuser_group', 'label': 'Groups', 'category': category,
|
2010-11-18 20:17:14 -06:00
|
|
|
'other_entity': 'group', 'add_method': 'add_user', 'remove_method': 'remove_user'
|
2010-11-09 14:22:31 -06:00
|
|
|
}));
|
|
|
|
|
|
|
|
if (IPA.layout) {
|
|
|
|
section = that.create_section({
|
|
|
|
'name': 'host',
|
|
|
|
'label': 'Accessing',
|
2011-01-11 07:31:09 -06:00
|
|
|
'template': 'hbacrule-details-host.html #contents'
|
2010-11-09 14:22:31 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
2011-01-12 18:51:22 -06:00
|
|
|
section = IPA.rule_details_section({
|
2010-11-09 14:22:31 -06:00
|
|
|
'name': 'host',
|
|
|
|
'label': 'Accessing',
|
|
|
|
'text': 'Rule applies when access is requested to:',
|
|
|
|
'field_name': 'hostcategory',
|
|
|
|
'options': [
|
|
|
|
{ 'value': 'all', 'label': 'Any Host' },
|
|
|
|
{ 'value': '', 'label': 'Specified Hosts and Groups' }
|
|
|
|
],
|
|
|
|
'tables': [
|
|
|
|
{ 'field_name': 'memberhost_host' },
|
|
|
|
{ 'field_name': 'memberhost_hostgroup' }
|
|
|
|
]
|
|
|
|
});
|
|
|
|
that.add_section(section);
|
|
|
|
}
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
category = section.create_radio({ 'name': 'hostcategory', 'label': 'Host category' });
|
2011-01-12 18:51:22 -06:00
|
|
|
section.add_field(IPA.rule_association_table_widget({
|
2010-11-09 14:22:31 -06:00
|
|
|
'id': that.entity_name+'-memberhost_host',
|
2010-11-15 11:10:55 -06:00
|
|
|
'name': 'memberhost_host', 'label': 'Hosts', 'category': category,
|
2010-11-18 20:17:14 -06:00
|
|
|
'other_entity': 'host', 'add_method': 'add_host', 'remove_method': 'remove_host'
|
2010-11-09 14:22:31 -06:00
|
|
|
}));
|
2011-01-12 18:51:22 -06:00
|
|
|
section.add_field(IPA.rule_association_table_widget({
|
2010-11-09 14:22:31 -06:00
|
|
|
'id': that.entity_name+'-memberhost_hostgroup',
|
2010-11-15 11:10:55 -06:00
|
|
|
'name': 'memberhost_hostgroup', 'label': 'Host Groups', 'category': category,
|
2010-11-18 20:17:14 -06:00
|
|
|
'other_entity': 'hostgroup', 'add_method': 'add_host', 'remove_method': 'remove_host'
|
2010-11-09 14:22:31 -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
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
if (IPA.layout) {
|
|
|
|
section = that.create_section({
|
|
|
|
'name': 'service',
|
|
|
|
'label': 'Via Service',
|
2011-01-11 07:31:09 -06:00
|
|
|
'template': 'hbacrule-details-service.html #contents'
|
2010-11-09 14:22:31 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
2011-01-12 18:51:22 -06:00
|
|
|
section = IPA.rule_details_section({
|
2010-11-09 14:22:31 -06:00
|
|
|
'name': 'service',
|
|
|
|
'label': 'Via Service',
|
|
|
|
'text': 'Rule applies when access is requested via:',
|
|
|
|
'field_name': 'servicecategory',
|
|
|
|
'options': [
|
|
|
|
{ 'value': 'all', 'label': 'Any Service' },
|
|
|
|
{ 'value': '', 'label': 'Specified Services and Groups' }
|
|
|
|
],
|
|
|
|
'tables': [
|
|
|
|
{ 'field_name': 'memberservice_hbacsvc' },
|
|
|
|
{ 'field_name': 'memberservice_hbacsvcgroup' }
|
|
|
|
]
|
|
|
|
});
|
|
|
|
that.add_section(section);
|
|
|
|
}
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
category = section.create_radio({ 'name': 'servicecategory', 'label': 'Service category' });
|
2011-01-12 18:51:22 -06:00
|
|
|
section.add_field(IPA.rule_association_table_widget({
|
2010-11-09 14:22:31 -06:00
|
|
|
'id': that.entity_name+'-memberservice_hbacsvc',
|
2010-11-15 11:10:55 -06:00
|
|
|
'name': 'memberservice_hbacsvc', 'label': 'Services', 'category': category,
|
2010-11-18 20:17:14 -06:00
|
|
|
'other_entity': 'hbacsvc', 'add_method': 'add_service', 'remove_method': 'remove_service'
|
2010-11-09 14:22:31 -06:00
|
|
|
}));
|
2011-01-12 18:51:22 -06:00
|
|
|
section.add_field(IPA.rule_association_table_widget({
|
2010-11-09 14:22:31 -06:00
|
|
|
'id': that.entity_name+'-memberservice_hbacsvcgroup',
|
2010-11-15 11:10:55 -06:00
|
|
|
'name': 'memberservice_hbacsvcgroup', 'label': 'Service Groups', 'category': category,
|
2010-11-18 20:17:14 -06:00
|
|
|
'other_entity': 'hbacsvcgroup', 'add_method': 'add_service', 'remove_method': 'remove_service'
|
2010-11-09 14:22:31 -06:00
|
|
|
}));
|
|
|
|
|
|
|
|
if (IPA.layout) {
|
|
|
|
section = that.create_section({
|
|
|
|
'name': 'sourcehost',
|
|
|
|
'label': 'From',
|
2011-01-11 07:31:09 -06:00
|
|
|
'template': 'hbacrule-details-sourcehost.html #contents'
|
2010-11-09 14:22:31 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
2011-01-12 18:51:22 -06:00
|
|
|
section = IPA.rule_details_section({
|
2010-11-09 14:22:31 -06:00
|
|
|
'name': 'sourcehost',
|
|
|
|
'label': 'From',
|
|
|
|
'text': 'Rule applies when access is being initiated from:',
|
|
|
|
'field_name': 'sourcehostcategory',
|
|
|
|
'options': [
|
|
|
|
{ 'value': 'all', 'label': 'Any Host' },
|
|
|
|
{ 'value': '', 'label': 'Specified Hosts and Groups' }
|
|
|
|
],
|
|
|
|
'tables': [
|
|
|
|
{ 'field_name': 'sourcehost_host' },
|
|
|
|
{ 'field_name': 'sourcehost_hostgroup' }
|
|
|
|
]
|
|
|
|
});
|
|
|
|
that.add_section(section);
|
|
|
|
}
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
category = section.create_radio({ 'name': 'sourcehostcategory', 'label': 'Source host category' });
|
2011-01-12 18:51:22 -06:00
|
|
|
section.add_field(IPA.rule_association_table_widget({
|
2010-11-09 14:22:31 -06:00
|
|
|
'id': that.entity_name+'-sourcehost_host',
|
2010-11-15 11:10:55 -06:00
|
|
|
'name': 'sourcehost_host', 'label': 'Host', 'category': category,
|
2010-11-18 20:17:14 -06:00
|
|
|
'other_entity': 'host', 'add_method': 'add_sourcehost', 'remove_method': 'remove_sourcehost'
|
2010-11-09 14:22:31 -06:00
|
|
|
}));
|
2011-01-12 18:51:22 -06:00
|
|
|
section.add_field(IPA.rule_association_table_widget({
|
2010-11-09 14:22:31 -06:00
|
|
|
'id': that.entity_name+'-sourcehost_hostgroup',
|
2010-11-15 11:10:55 -06:00
|
|
|
'name': 'sourcehost_hostgroup', 'label': 'Host Groups', 'category': category,
|
2010-11-18 20:17:14 -06:00
|
|
|
'other_entity': 'hostgroup', 'add_method': 'add_sourcehost', 'remove_method': 'remove_sourcehost'
|
2010-11-09 14:22:31 -06:00
|
|
|
}));
|
2010-12-02 22:09:18 -06:00
|
|
|
/*
|
2010-11-09 14:22:31 -06:00
|
|
|
if (IPA.layout) {
|
|
|
|
section = that.create_section({
|
|
|
|
'name': 'accesstime',
|
|
|
|
'label': 'When',
|
2011-01-11 07:31:09 -06:00
|
|
|
'template': 'hbacrule-details-accesstime.html #contents'
|
2010-11-09 14:22:31 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
2010-11-15 11:10:55 -06:00
|
|
|
section = that.create_section({
|
|
|
|
'name': 'accesstime',
|
|
|
|
'label': 'When'
|
|
|
|
});
|
2010-11-09 14:22:31 -06:00
|
|
|
}
|
|
|
|
|
2011-01-11 07:31:09 -06:00
|
|
|
section.add_field(ipa_hbacrule_accesstime_widget({
|
2010-11-15 11:10:55 -06:00
|
|
|
'id': 'accesstime',
|
|
|
|
'name': 'accesstime', 'label': 'Access Time',
|
|
|
|
'text': 'Rule applies when access is being requested at:',
|
|
|
|
'options': [
|
|
|
|
{ 'value': 'all', 'label': 'Any Time' },
|
|
|
|
{ 'value': '', 'label': 'Specified Times' }
|
|
|
|
]
|
2010-11-09 14:22:31 -06:00
|
|
|
}));
|
2010-12-02 22:09:18 -06:00
|
|
|
*/
|
2010-11-18 20:17:14 -06:00
|
|
|
that.details_facet_init();
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.update = function() {
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
|
|
|
|
|
|
|
|
var modify_operation = {
|
|
|
|
'execute': false,
|
2011-01-12 18:51:22 -06:00
|
|
|
'command': IPA.command({
|
2010-11-15 11:10:55 -06:00
|
|
|
'method': that.entity_name+'_mod',
|
|
|
|
'args': [pkey],
|
|
|
|
'options': {'all': true, 'rights': true}
|
|
|
|
})
|
|
|
|
};
|
|
|
|
|
|
|
|
var remove_accesstime = {
|
2011-01-12 18:51:22 -06:00
|
|
|
'template': IPA.command({
|
2010-11-15 11:10:55 -06:00
|
|
|
'method': that.entity_name+'_remove_accesstime',
|
|
|
|
'args': [pkey],
|
|
|
|
'options': {'all': true, 'rights': true}
|
|
|
|
}),
|
|
|
|
'commands': []
|
|
|
|
};
|
|
|
|
|
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 categories = {
|
|
|
|
'usercategory': {
|
|
|
|
'remove_values': false
|
|
|
|
},
|
|
|
|
'hostcategory': {
|
|
|
|
'remove_values': false
|
|
|
|
},
|
|
|
|
'servicecategory': {
|
|
|
|
'remove_values': false
|
|
|
|
},
|
|
|
|
'sourcehostcategory': {
|
|
|
|
'remove_values': false
|
|
|
|
}
|
2010-11-15 11:10:55 -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
|
|
|
var member_operations = {
|
2010-11-15 11:10:55 -06:00
|
|
|
'memberuser': {
|
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
|
|
|
'category': 'usercategory',
|
2010-11-15 11:10:55 -06:00
|
|
|
'has_values': false,
|
2011-01-12 18:51:22 -06:00
|
|
|
'command': IPA.command({
|
2010-11-15 11:10:55 -06:00
|
|
|
'method': that.entity_name+'_remove_user',
|
|
|
|
'args': [pkey],
|
|
|
|
'options': {'all': true, 'rights': true}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
'memberhost': {
|
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
|
|
|
'category': 'hostcategory',
|
2010-11-15 11:10:55 -06:00
|
|
|
'has_values': false,
|
2011-01-12 18:51:22 -06:00
|
|
|
'command': IPA.command({
|
2010-11-15 11:10:55 -06:00
|
|
|
'method': that.entity_name+'_remove_host',
|
|
|
|
'args': [pkey],
|
|
|
|
'options': {'all': true, 'rights': true}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
'memberservice': {
|
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
|
|
|
'category': 'servicecategory',
|
2010-11-15 11:10:55 -06:00
|
|
|
'has_values': false,
|
2011-01-12 18:51:22 -06:00
|
|
|
'command': IPA.command({
|
2010-11-15 11:10:55 -06:00
|
|
|
'method': that.entity_name+'_remove_service',
|
|
|
|
'args': [pkey],
|
|
|
|
'options': {'all': true, 'rights': true}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
'sourcehost': {
|
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
|
|
|
'category': 'sourcehostcategory',
|
2010-11-15 11:10:55 -06:00
|
|
|
'has_values': false,
|
2011-01-12 18:51:22 -06:00
|
|
|
'command': IPA.command({
|
2010-11-15 11:10:55 -06:00
|
|
|
'method': that.entity_name+'_remove_sourcehost',
|
|
|
|
'args': [pkey],
|
|
|
|
'options': {'all': true, 'rights': true}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
var enable_operation = {
|
|
|
|
'execute': false,
|
2011-01-12 18:51:22 -06:00
|
|
|
'command': IPA.command({
|
2010-11-15 11:10:55 -06:00
|
|
|
'method': that.entity_name+'_enable',
|
|
|
|
'args': [pkey],
|
|
|
|
'options': {'all': true, 'rights': true}
|
|
|
|
})
|
|
|
|
};
|
|
|
|
|
|
|
|
for (var i=0; i<that.sections.length; i++) {
|
|
|
|
var section = that.sections[i];
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
var div = $('#'+that.entity_name+'-'+that.name+'-'+section.name, that.container);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
for (var j=0; j<section.fields.length; j++) {
|
|
|
|
var field = section.fields[j];
|
|
|
|
|
|
|
|
var span = $('span[name='+field.name+']', div).first();
|
2010-11-18 20:17:14 -06:00
|
|
|
var values = field.save();
|
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
|
|
|
if (!values) continue;
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var param_info = IPA.get_param_info(that.entity_name, field.name);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
// skip primary key
|
|
|
|
if (param_info && param_info['primary_key']) continue;
|
|
|
|
|
|
|
|
var p = field.name.indexOf('_');
|
|
|
|
if (p >= 0) {
|
|
|
|
// prepare command to remove members if needed
|
|
|
|
var attribute = field.name.substring(0, p);
|
|
|
|
var other_entity = field.name.substring(p+1);
|
|
|
|
|
|
|
|
if (values.length) {
|
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
|
|
|
member_operations[attribute].command.set_option(other_entity, values.join(','));
|
|
|
|
member_operations[attribute].has_values = true;
|
2010-11-15 11:10:55 -06:00
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// skip unchanged field
|
|
|
|
if (!field.is_dirty(span)) continue;
|
|
|
|
|
|
|
|
// check enable/disable
|
|
|
|
if (field.name == 'ipaenabledflag') {
|
|
|
|
if (values[0] == 'FALSE') enable_operation.command.method = that.entity_name+'_disable';
|
|
|
|
enable_operation.execute = true;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (field.name == 'accesstime') {
|
|
|
|
// if accesstime is dirty, it means 'Any Time' is selected,
|
|
|
|
// so existing values have to be removed
|
|
|
|
for (var k=0; k<field.values.length; k++) {
|
2011-01-12 18:51:22 -06:00
|
|
|
var command = IPA.command(remove_accesstime.template);
|
2010-11-15 11:10:55 -06:00
|
|
|
command.set_option(field.name, field.values[k]);
|
|
|
|
remove_accesstime.commands.push(command);
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
if (categories[field.name]) {
|
|
|
|
if (values[0] == 'all') {
|
|
|
|
categories[field.name].remove_values = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
// use setattr/addattr if param_info not available
|
|
|
|
if (!param_info) {
|
2011-01-12 13:47:29 -06:00
|
|
|
for (var l=0; l<values.length; l++) {
|
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
|
|
|
modify_operation.command.set_option(
|
2011-01-12 13:47:29 -06:00
|
|
|
l === 0 ? 'setattr' : 'addattr',
|
|
|
|
field.name+'='+values[l]);
|
2010-11-15 11:10:55 -06:00
|
|
|
modify_operation.execute = true;
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// set modify options
|
|
|
|
if (values.length == 1) {
|
|
|
|
modify_operation.command.set_option(field.name, values[0]);
|
|
|
|
} else {
|
|
|
|
modify_operation.command.set_option(field.name, values);
|
|
|
|
}
|
|
|
|
modify_operation.execute = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var batch = IPA.batch_command({
|
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
|
|
|
'name': 'hbac_details_update',
|
|
|
|
'on_success': function(data, text_status, xhr) {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.refresh();
|
2010-11-15 11:10:55 -06:00
|
|
|
},
|
|
|
|
'on_error': function(xhr, text_status, error_thrown) {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.refresh();
|
2010-11-15 11:10:55 -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 member_attribute in member_operations) {
|
|
|
|
var member_operation = member_operations[member_attribute];
|
|
|
|
if (member_operation.has_values &&
|
|
|
|
categories[member_operation.category].remove_values) {
|
|
|
|
batch.add_command(member_operations[member_attribute].command);
|
2010-11-15 11:10:55 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
batch.add_commands(remove_accesstime.commands);
|
|
|
|
|
|
|
|
if (modify_operation.execute) batch.add_command(modify_operation.command);
|
|
|
|
if (enable_operation.execute) batch.add_command(enable_operation.command);
|
|
|
|
|
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
|
|
|
if (!batch.commands.length) {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.refresh();
|
2010-11-15 11:10:55 -06:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-01-13 12:08:41 -06:00
|
|
|
//alert(JSON.stringify(batch.to_json()));
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
batch.execute();
|
|
|
|
};
|
|
|
|
|
|
|
|
that.reset = function() {
|
|
|
|
for (var i=0; i<that.sections.length; i++) {
|
|
|
|
var section = that.sections[i];
|
|
|
|
section.reset();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
return that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|
|
|
|
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.hbacrule_details_general_section = 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
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.details_section(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
|
|
|
that.create = function(container) {
|
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 table = $('<table/>', {
|
|
|
|
'style': 'width: 100%;'
|
|
|
|
}).appendTo(container);
|
2010-10-27 22:32:30 -05:00
|
|
|
|
2010-12-02 22:12:59 -06:00
|
|
|
var tr = $('<tr/>').appendTo(table);
|
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 td = $('<td/>', {
|
|
|
|
'style': 'width: 100px; text-align: right;',
|
|
|
|
'html': 'Name:'
|
|
|
|
}).appendTo(tr);
|
|
|
|
|
|
|
|
td = $('<td/>').appendTo(tr);
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
var span = $('<span/>', { 'name': 'cn' }).appendTo(td);
|
|
|
|
|
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
|
|
|
$('<input/>', {
|
|
|
|
'type': 'text',
|
|
|
|
'name': 'cn',
|
|
|
|
'size': 30
|
2010-11-15 11:10:55 -06:00
|
|
|
}).appendTo(span);
|
|
|
|
|
|
|
|
span.append(' ');
|
|
|
|
|
|
|
|
$('<span/>', {
|
|
|
|
'name': 'undo',
|
|
|
|
'class': 'ui-state-highlight ui-corner-all',
|
|
|
|
'style': 'display: none;',
|
|
|
|
'html': 'undo'
|
|
|
|
}).appendTo(span);
|
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
|
|
|
|
|
|
|
td = $('<td/>', {
|
|
|
|
'style': 'text-align: right;'
|
|
|
|
}).appendTo(tr);
|
|
|
|
|
|
|
|
td.append('Rule type:');
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
span = $('<span/>', { 'name': 'accessruletype' }).appendTo(td);
|
|
|
|
|
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
|
|
|
$('<input/>', {
|
|
|
|
'type': 'radio',
|
|
|
|
'name': 'accessruletype',
|
|
|
|
'value': 'allow'
|
2010-11-15 11:10:55 -06:00
|
|
|
}).appendTo(span);
|
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-11-15 11:10:55 -06:00
|
|
|
span.append('Allow');
|
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
|
|
|
|
|
|
|
$('<input/>', {
|
|
|
|
'type': 'radio',
|
|
|
|
'name': 'accessruletype',
|
|
|
|
'value': 'deny'
|
2010-11-15 11:10:55 -06:00
|
|
|
}).appendTo(span);
|
|
|
|
|
|
|
|
span.append('Deny');
|
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-11-15 11:10:55 -06:00
|
|
|
span.append(' ');
|
|
|
|
|
|
|
|
$('<span/>', {
|
|
|
|
'name': 'undo',
|
|
|
|
'class': 'ui-state-highlight ui-corner-all',
|
|
|
|
'style': 'display: none;',
|
|
|
|
'html': 'undo'
|
|
|
|
}).appendTo(span);
|
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-12-02 22:12:59 -06:00
|
|
|
tr = $('<tr/>').appendTo(table);
|
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
|
|
|
|
|
|
|
td = $('<td/>', {
|
|
|
|
'style': 'text-align: right; vertical-align: top;',
|
|
|
|
'html': 'Description:'
|
|
|
|
}).appendTo(tr);
|
|
|
|
|
|
|
|
td = $('<td/>', {
|
|
|
|
'colspan': 2
|
|
|
|
}).appendTo(tr);
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
span = $('<span/>', { 'name': 'description' }).appendTo(td);
|
|
|
|
|
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
|
|
|
$('<textarea/>', {
|
|
|
|
'name': 'description',
|
|
|
|
'rows': 5,
|
|
|
|
'style': 'width: 100%'
|
2010-11-15 11:10:55 -06:00
|
|
|
}).appendTo(span);
|
|
|
|
|
|
|
|
span.append(' ');
|
|
|
|
|
|
|
|
$('<span/>', {
|
|
|
|
'name': 'undo',
|
|
|
|
'class': 'ui-state-highlight ui-corner-all',
|
|
|
|
'style': 'display: none;',
|
|
|
|
'html': 'undo'
|
|
|
|
}).appendTo(span);
|
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-12-02 22:12:59 -06:00
|
|
|
tr = $('<tr/>').appendTo(table);
|
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
|
|
|
|
|
|
|
td = $('<td/>', {
|
|
|
|
'style': 'text-align: right; vertical-align: top;',
|
|
|
|
'html': 'Rule status:'
|
|
|
|
}).appendTo(tr);
|
|
|
|
|
|
|
|
td = $('<td/>', {
|
|
|
|
'colspan': 2
|
|
|
|
}).appendTo(tr);
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
span = $('<span/>', { 'name': 'ipaenabledflag' }).appendTo(td);
|
|
|
|
|
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
|
|
|
$('<input/>', {
|
|
|
|
'type': 'radio',
|
|
|
|
'name': 'ipaenabledflag',
|
|
|
|
'value': 'TRUE'
|
2010-11-15 11:10:55 -06:00
|
|
|
}).appendTo(span);
|
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-11-15 11:10:55 -06:00
|
|
|
span.append('Active');
|
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
|
|
|
|
|
|
|
$('<input/>', {
|
|
|
|
'type': 'radio',
|
|
|
|
'name': 'ipaenabledflag',
|
|
|
|
'value': 'FALSE'
|
2010-11-15 11:10:55 -06:00
|
|
|
}).appendTo(span);
|
|
|
|
|
|
|
|
span.append('Inactive');
|
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-11-15 11:10:55 -06:00
|
|
|
span.append(' ');
|
|
|
|
|
|
|
|
$('<span/>', {
|
|
|
|
'name': 'undo',
|
|
|
|
'class': 'ui-state-highlight ui-corner-all',
|
|
|
|
'style': 'display: none;',
|
|
|
|
'html': 'undo'
|
|
|
|
}).appendTo(span);
|
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
|
|
|
};
|
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
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.hbacrule_accesstime_widget = function (spec) {
|
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 || {};
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var that = IPA.widget(spec);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
that.text = spec.text;
|
|
|
|
that.options = spec.options || [];
|
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-11-09 14:22:31 -06:00
|
|
|
that.init = function() {
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2010-12-06 13:51:49 -06:00
|
|
|
that.widget_init();
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
that.table = IPA.table_widget({
|
2010-11-15 11:10:55 -06:00
|
|
|
'id': 'accesstime-table',
|
|
|
|
'name': 'table', 'label': that.label
|
|
|
|
});
|
|
|
|
|
|
|
|
that.table.create_column({
|
|
|
|
'name': that.name,
|
|
|
|
'label': that.label,
|
|
|
|
'primary_key': true
|
|
|
|
});
|
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-12-06 13:51:49 -06:00
|
|
|
that.table.init();
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
that.create = function(container) {
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.widget_create(container);
|
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-11-15 11:10:55 -06:00
|
|
|
var span = $('<span/>', { 'name': 'text' }).appendTo(container);
|
|
|
|
|
|
|
|
span.append(that.text);
|
|
|
|
|
|
|
|
for (var i=0; i<that.options.length; i++) {
|
|
|
|
var option = that.options[i];
|
|
|
|
|
|
|
|
$('<input/>', {
|
|
|
|
'type': 'radio',
|
|
|
|
'name': that.name,
|
|
|
|
'value': option.value
|
|
|
|
}).appendTo(container);
|
|
|
|
|
|
|
|
container.append(option.label);
|
|
|
|
}
|
|
|
|
|
|
|
|
container.append(' ');
|
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-11-15 11:10:55 -06:00
|
|
|
$('<span/>', {
|
|
|
|
'name': 'undo',
|
|
|
|
'class': 'ui-state-highlight ui-corner-all',
|
|
|
|
'style': 'display: none;',
|
|
|
|
'html': 'undo'
|
|
|
|
}).appendTo(container);
|
|
|
|
|
|
|
|
container.append('<br/>');
|
|
|
|
|
|
|
|
span = $('<span/>', { 'name': 'table' }).appendTo(container);
|
|
|
|
|
|
|
|
that.table.create(span);
|
|
|
|
|
|
|
|
var buttons = $('span[name=buttons]', span);
|
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
|
|
|
|
|
|
|
$('<input/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'name': 'remove',
|
|
|
|
'value': 'Remove '+that.label
|
|
|
|
}).appendTo(buttons);
|
|
|
|
|
|
|
|
$('<input/>', {
|
|
|
|
'type': 'button',
|
|
|
|
'name': 'add',
|
|
|
|
'value': 'Add '+that.label
|
|
|
|
}).appendTo(buttons);
|
|
|
|
};
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
that.setup = function(container) {
|
|
|
|
|
|
|
|
that.widget_setup(container);
|
|
|
|
|
|
|
|
var span = $('span[name="table"]', that.container);
|
|
|
|
that.table.setup(span);
|
|
|
|
|
|
|
|
var button = $('input[name=remove]', span);
|
2011-01-12 18:51:22 -06:00
|
|
|
button.replaceWith(IPA.button({
|
2010-11-15 11:10:55 -06:00
|
|
|
'label': button.val(),
|
|
|
|
'icon': 'ui-icon-trash',
|
|
|
|
'click': function() { that.remove(that.container); }
|
|
|
|
}));
|
|
|
|
|
|
|
|
button = $('input[name=add]', span);
|
2011-01-12 18:51:22 -06:00
|
|
|
button.replaceWith(IPA.button({
|
2010-11-15 11:10:55 -06:00
|
|
|
'label': button.val(),
|
|
|
|
'icon': 'ui-icon-plus',
|
2011-01-12 13:47:29 -06:00
|
|
|
'click': function() { that.add(that.container); }
|
2010-11-15 11:10:55 -06:00
|
|
|
}));
|
|
|
|
|
|
|
|
var input = $('input[name="'+that.name+'"]', that.container);
|
|
|
|
input.change(function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.show_undo();
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
var undo = that.get_undo();
|
2010-11-15 11:10:55 -06:00
|
|
|
undo.click(function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.reset();
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.save = function() {
|
2010-11-15 11:10:55 -06:00
|
|
|
var value = $('input[name="'+that.name+'"]:checked', that.container).val();
|
2011-01-12 13:47:29 -06:00
|
|
|
if (value === '') {
|
2010-11-18 20:17:14 -06:00
|
|
|
return that.table.save();
|
2010-11-04 21:42:37 -05:00
|
|
|
} else {
|
2010-11-15 11:10:55 -06:00
|
|
|
return [];
|
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-11-15 11:10:55 -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
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
that.load = function(record) {
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
that.values = record[that.name] || [];
|
2010-11-18 20:17:14 -06:00
|
|
|
that.reset();
|
2010-11-15 11:10:55 -06:00
|
|
|
};
|
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
that.update = function() {
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
that.set_category(that.container, that.values && that.values.length ? '' : 'all');
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
that.table.tbody.empty();
|
2010-12-09 14:20:40 -06:00
|
|
|
for (var i=0; that.values && i<that.values.length; i++) {
|
2010-11-15 11:10:55 -06:00
|
|
|
var record = {};
|
2010-12-09 14:20:40 -06:00
|
|
|
record[that.name] = that.values[i];
|
2010-12-01 14:51:39 -06:00
|
|
|
that.table.add_record(record);
|
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-11-04 21:42:37 -05:00
|
|
|
};
|
|
|
|
|
2010-12-09 14:20:40 -06:00
|
|
|
that.set_category = function(container, value) {
|
2010-11-15 11:10:55 -06:00
|
|
|
$('input[name="'+that.name+'"][value="'+value+'"]', that.container).get(0).checked = true;
|
|
|
|
};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.add = function() {
|
2010-11-04 21:42:37 -05:00
|
|
|
|
|
|
|
var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
|
|
|
|
var title = 'Add '+that.label+' to '+that.entity_name+' '+pkey;
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var dialog = IPA.dialog({
|
2010-11-09 14:22:31 -06:00
|
|
|
'title': title
|
2010-11-04 21:42:37 -05:00
|
|
|
});
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
dialog.add_field(IPA.text_widget({
|
2010-11-04 21:42:37 -05:00
|
|
|
'name': that.name,
|
|
|
|
'label': that.label
|
|
|
|
}));
|
|
|
|
|
|
|
|
dialog.create = function() {
|
|
|
|
var table = $('<table/>').appendTo(dialog.container);
|
|
|
|
|
|
|
|
var tr = $('<tr/>').appendTo(table);
|
|
|
|
|
|
|
|
var td = $('<td/>', {
|
|
|
|
'style': 'vertical-align: top;'
|
|
|
|
}).appendTo(tr);
|
|
|
|
td.append(that.label+': ');
|
|
|
|
|
|
|
|
td = $('<td/>').appendTo(tr);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
|
|
|
var span = $('<span/>', { 'name': that.name }).appendTo(td);
|
|
|
|
|
2010-11-04 21:42:37 -05:00
|
|
|
$('<input/>', {
|
|
|
|
'type': 'text',
|
|
|
|
'name': that.name,
|
|
|
|
'size': 40
|
2010-11-15 11:10:55 -06:00
|
|
|
}).appendTo(span);
|
2010-11-04 21:42:37 -05:00
|
|
|
|
|
|
|
tr = $('<tr/>').appendTo(table);
|
|
|
|
|
|
|
|
td = $('<td/>', {
|
|
|
|
'style': 'vertical-align: top;'
|
|
|
|
}).appendTo(tr);
|
|
|
|
td.append('Example:');
|
|
|
|
|
|
|
|
td = $('<td/>').appendTo(tr);
|
|
|
|
|
|
|
|
td.append('<b>Every day between 0800 and 1400:</b><br/>');
|
|
|
|
td.append('periodic daily 0800-1400<br/><br/>');
|
|
|
|
|
|
|
|
td.append('<b>December 16, 2010 from 10:32 until 10:33:</b><br/>');
|
|
|
|
td.append('absolute 201012161032 ~ 201012161033<td/>');
|
|
|
|
};
|
|
|
|
|
|
|
|
function add(on_success, on_error) {
|
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-11-04 21:42:37 -05:00
|
|
|
var field = dialog.get_field(that.name);
|
2010-11-18 20:17:14 -06:00
|
|
|
var value = field.save()[0];
|
2010-11-04 21:42:37 -05:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var command = IPA.command({
|
2010-11-15 11:10:55 -06:00
|
|
|
'method': that.entity_name+'_add_'+that.name,
|
|
|
|
'args': [pkey],
|
|
|
|
'on_success': function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.refresh();
|
2010-11-04 21:42:37 -05:00
|
|
|
if (on_success) on_success();
|
|
|
|
},
|
2010-11-15 11:10:55 -06:00
|
|
|
'on_error': function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.refresh();
|
2010-11-04 21:42:37 -05:00
|
|
|
if (on_error) on_error();
|
|
|
|
}
|
2010-11-15 11:10:55 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
command.set_option(that.name, value);
|
|
|
|
|
|
|
|
command.execute();
|
2010-11-04 21:42:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
dialog.add_button('Add', function() {
|
2010-11-09 14:22:31 -06:00
|
|
|
add(
|
2010-12-09 14:20:40 -06:00
|
|
|
function() { dialog.reset(); }
|
2010-11-09 14:22:31 -06:00
|
|
|
);
|
2010-11-04 21:42:37 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
dialog.add_button('Add and Close', function() {
|
|
|
|
add(
|
|
|
|
function() { dialog.close(); },
|
|
|
|
function() { dialog.close(); }
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
dialog.add_button('Cancel', function() {
|
|
|
|
dialog.close();
|
|
|
|
});
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
dialog.init();
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
dialog.open(that.container);
|
2010-11-04 21:42:37 -05:00
|
|
|
};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.remove = function() {
|
2010-11-04 21:42:37 -05:00
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
var values = that.table.get_selected_values();
|
2010-11-04 21:42:37 -05:00
|
|
|
|
|
|
|
if (!values.length) {
|
|
|
|
alert('Select '+that.label+' to be removed.');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
|
|
|
|
var title = 'Remove '+that.label+' from '+that.entity_name+' '+pkey;
|
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var dialog = IPA.deleter_dialog({
|
2010-11-04 21:42:37 -05:00
|
|
|
'title': title,
|
|
|
|
'values': values
|
|
|
|
});
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
dialog.remove = function() {
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2011-01-12 18:51:22 -06:00
|
|
|
var batch = IPA.batch_command({
|
2010-11-15 11:10:55 -06:00
|
|
|
'on_success': function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.refresh();
|
2010-11-15 11:10:55 -06:00
|
|
|
dialog.close();
|
|
|
|
},
|
|
|
|
'on_error': function() {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.refresh();
|
2010-11-15 11:10:55 -06:00
|
|
|
dialog.close();
|
|
|
|
}
|
|
|
|
});
|
2010-11-04 21:42:37 -05:00
|
|
|
|
|
|
|
for (var i=0; i<values.length; i++) {
|
2011-01-12 18:51:22 -06:00
|
|
|
var command = IPA.command({
|
2010-11-15 11:10:55 -06:00
|
|
|
'method': that.entity_name+'_remove_'+that.name,
|
|
|
|
'args': [pkey]
|
2010-11-04 21:42:37 -05:00
|
|
|
});
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2010-11-04 21:42:37 -05:00
|
|
|
command.set_option(that.name, values[i]);
|
2010-11-15 11:10:55 -06:00
|
|
|
|
2010-11-04 21:42:37 -05:00
|
|
|
batch.add_command(command);
|
|
|
|
}
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
batch.execute();
|
2010-11-04 21:42:37 -05:00
|
|
|
};
|
|
|
|
|
2010-11-09 14:22:31 -06:00
|
|
|
dialog.init();
|
|
|
|
|
2010-11-15 11:10:55 -06:00
|
|
|
dialog.open(that.container);
|
2010-11-09 14:22:31 -06:00
|
|
|
};
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
that.refresh = function() {
|
2010-11-09 14:22:31 -06:00
|
|
|
|
|
|
|
function on_success(data, text_status, xhr) {
|
2010-11-18 20:17:14 -06:00
|
|
|
that.load(data.result.result);
|
2010-11-09 14:22:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
function on_error(xhr, text_status, error_thrown) {
|
2010-11-15 11:10:55 -06:00
|
|
|
var summary = $('span[name=summary]', that.table.tfoot).empty();
|
|
|
|
summary.append('<p>Error: '+error_thrown.name+'</p>');
|
|
|
|
summary.append('<p>'+error_thrown.title+'</p>');
|
|
|
|
summary.append('<p>'+error_thrown.message+'</p>');
|
2010-11-09 14:22:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
|
2011-01-12 18:51:22 -06:00
|
|
|
IPA.cmd('show', [pkey], {'rights': true}, on_success, on_error, that.entity_name);
|
2010-11-04 21:42:37 -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 that;
|
2011-01-14 11:16:25 -06:00
|
|
|
};
|