diff options
author | Endi S. Dewata <edewata@redhat.com> | 2010-11-02 20:16:55 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-11-04 14:22:32 -0400 |
commit | d99ebc0f3798c84e612c79c43eb85c31b20ab1ce (patch) | |
tree | f2a758dfc9028d32f00236340b409469c73848a4 /install/static/layouts | |
parent | 05a16f50d7fe8c01408ec445e6b5ad26ff65d9d5 (diff) | |
download | freeipa-d99ebc0f3798c84e612c79c43eb85c31b20ab1ce.tar.gz freeipa-d99ebc0f3798c84e612c79c43eb85c31b20ab1ce.tar.xz freeipa-d99ebc0f3798c84e612c79c43eb85c31b20ab1ce.zip |
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.
Diffstat (limited to 'install/static/layouts')
-rw-r--r-- | install/static/layouts/Makefile.am | 22 | ||||
-rw-r--r-- | install/static/layouts/default/Makefile.am | 25 | ||||
-rwxr-xr-x | install/static/layouts/default/hbac-details-accesstime.html | 46 | ||||
-rwxr-xr-x | install/static/layouts/default/hbac-details-general.html | 45 | ||||
-rwxr-xr-x | install/static/layouts/default/hbac-details-host.html | 75 | ||||
-rwxr-xr-x | install/static/layouts/default/hbac-details-service.html | 75 | ||||
-rwxr-xr-x | install/static/layouts/default/hbac-details-sourcehost.html | 75 | ||||
-rwxr-xr-x | install/static/layouts/default/hbac-details-user.html | 75 |
8 files changed, 438 insertions, 0 deletions
diff --git a/install/static/layouts/Makefile.am b/install/static/layouts/Makefile.am new file mode 100644 index 000000000..9e1ee7b74 --- /dev/null +++ b/install/static/layouts/Makefile.am @@ -0,0 +1,22 @@ +AUTOMAKE_OPTIONS = 1.7 + +NULL = + +SUBDIRS = \ + default \ + $(NULL) + +appdir = $(IPA_DATA_DIR)/static/layouts +app_DATA = \ + $(NULL) + +EXTRA_DIST = \ + $(app_DATA) \ + $(NULL) + +MAINTAINERCLEANFILES = \ + *~ \ + Makefile.in + $(NULL) + +distclean: diff --git a/install/static/layouts/default/Makefile.am b/install/static/layouts/default/Makefile.am new file mode 100644 index 000000000..904fad171 --- /dev/null +++ b/install/static/layouts/default/Makefile.am @@ -0,0 +1,25 @@ +AUTOMAKE_OPTIONS = 1.7 + +NULL = + +SUBDIRS = \ + $(NULL) + +appdir = $(IPA_DATA_DIR)/static/layouts/default +app_DATA = \ + hbac-details-accesstime.html \ + hbac-details-general.html \ + hbac-details-host.html \ + hbac-details-service.html \ + hbac-details-sourcehost.html \ + hbac-details-user.html \ + $(NULL) + +EXTRA_DIST = \ + $(app_DATA) \ + $(NULL) + +MAINTAINERCLEANFILES = \ + *~ \ + Makefile.in + $(NULL) diff --git a/install/static/layouts/default/hbac-details-accesstime.html b/install/static/layouts/default/hbac-details-accesstime.html new file mode 100755 index 000000000..4122c76a6 --- /dev/null +++ b/install/static/layouts/default/hbac-details-accesstime.html @@ -0,0 +1,46 @@ +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>When</title> + + <link rel="stylesheet" type="text/css" href="jquery-ui.css" /> + <link rel="stylesheet" type="text/css" href="ipa.css" /> +</head> +<body> +<div id="contents"> + Rule applies when access is being requested at: + <input type="radio" name="accesstime" value="all"/>Any Time + <input type="radio" name="accesstime" value=""/>Specified Times + <br/> + + <div id="hbac-accesstime"> + <table class="search-table"> + <thead> + <tr> + <th style="width: 25px;"> + <input type="checkbox" name="select"/> + </th> + <th> + <span style="float: left;">Access Time</span> + <span name="buttons" style="float: right;"> + <input type="button" name="remove" value="Remove Access Times"/> + <input type="button" name="add" value="Add Access Times"/> + </span> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <input type="checkbox" name="select" value="time"/> + </td> + <td> + <span name="accesstime">time</span> + </td> + </tr> + </tbody> + </table> + </div> +</div> +</body> +</html>
\ No newline at end of file diff --git a/install/static/layouts/default/hbac-details-general.html b/install/static/layouts/default/hbac-details-general.html new file mode 100755 index 000000000..81b2a4ae6 --- /dev/null +++ b/install/static/layouts/default/hbac-details-general.html @@ -0,0 +1,45 @@ +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>General</title> + + <link rel="stylesheet" type="text/css" href="jquery-ui.css" /> + <link rel="stylesheet" type="text/css" href="ipa.css" /> +</head> +<body> +<div id="contents"> + <table style="width: 100%; border: 0 solid black;"> + <tr> + <td style="width: 100px; text-align: right;"> + Name: + </td> + <td> + <input type="text" name="cn" size="30"/> + </td> + <td style="text-align: right;"> + Rule type: + <input type="radio" name="accessruletype" value="allow"/>Allow + <input type="radio" name="accessruletype" value="deny"/>Deny + </td> + </tr> + <tr> + <td style="text-align: right; vertical-align: top;"> + Description: + </td> + <td colspan="2"> + <textarea name="description" rows="5" style="width: 100%;" cols="40"></textarea> + </td> + </tr> + <tr> + <td style="text-align: right; vertical-align: top;"> + Rule status: + </td> + <td colspan="2"> + <input type="radio" name="ipaenabledflag" value="TRUE"/>Active + <input type="radio" name="ipaenabledflag" value="FALSE"/>Inactive + </td> + </tr> + </table> +</div> +</body> +</html> diff --git a/install/static/layouts/default/hbac-details-host.html b/install/static/layouts/default/hbac-details-host.html new file mode 100755 index 000000000..a20e8115a --- /dev/null +++ b/install/static/layouts/default/hbac-details-host.html @@ -0,0 +1,75 @@ +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Accessing</title> + + <link rel="stylesheet" type="text/css" href="jquery-ui.css" /> + <link rel="stylesheet" type="text/css" href="ipa.css" /> +</head> +<body> +<div id="contents"> + Rule applies when access is requested to: + <input type="radio" name="hostcategory" value="all"/>Any Host + <input type="radio" name="hostcategory" value=""/>Specified Hosts and Groups + <br/> + + <div id="hbac-memberhost_host"> + <table class="search-table"> + <thead> + <tr> + <th style="width: 25px;"> + <input type="checkbox" name="select"/> + </th> + <th> + <span style="float: left;">Host</span> + <span name="buttons" style="float: right;"> + <input type="button" name="remove" value="Remove Hosts"/> + <input type="button" name="add" value="Add Hosts"/> + </span> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <input type="checkbox" name="select" value="host"/> + </td> + <td> + <span name="memberhost_host">host</span> + </td> + </tr> + </tbody> + </table> + </div> + + <div id="hbac-memberhost_hostgroup"> + <table class="search-table"> + <thead> + <tr> + <th style="width: 25px;"> + <input type="checkbox" name="select"/> + </th> + <th> + <span style="float: left;">Host Group</span> + <span name="buttons" style="float: right;"> + <input type="button" name="remove" value="Remove Host Groups"/> + <input type="button" name="add" value="Add Host Groups"/> + </span> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <input type="checkbox" name="select" value="hostgroups"/> + </td> + <td> + <span name="memberhost_hostgroup">hostgroups</span> + </td> + </tr> + </tbody> + </table> + </div> +</div> +</body> +</html>
\ No newline at end of file diff --git a/install/static/layouts/default/hbac-details-service.html b/install/static/layouts/default/hbac-details-service.html new file mode 100755 index 000000000..380cb1bb4 --- /dev/null +++ b/install/static/layouts/default/hbac-details-service.html @@ -0,0 +1,75 @@ +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Via Service</title> + + <link rel="stylesheet" type="text/css" href="jquery-ui.css" /> + <link rel="stylesheet" type="text/css" href="ipa.css" /> +</head> +<body> +<div id="contents"> + Rule applies when access is requested via: + <input type="radio" name="servicecategory" value="all"/>Any Service + <input type="radio" name="servicecategory" value=""/>Specified Services and Groups + <br/> + + <div id="hbac-memberservice_hbacsvc"> + <table class="search-table"> + <thead> + <tr> + <th style="width: 25px;"> + <input type="checkbox" name="select"/> + </th> + <th> + <span style="float: left;">Service</span> + <span name="buttons" style="float: right;"> + <input type="button" name="remove" value="Remove Services"/> + <input type="button" name="add" value="Add Services"/> + </span> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <input type="checkbox" name="select" value="service"/> + </td> + <td> + <span name="memberservice_hbacsvc">service</span> + </td> + </tr> + </tbody> + </table> + </div> + + <div id="hbac-memberservice_hbacsvcgroup"> + <table class="search-table"> + <thead> + <tr> + <th style="width: 25px;"> + <input type="checkbox" name="select"/> + </th> + <th> + <span style="float: left;">Service Group</span> + <span name="buttons" style="float: right;"> + <input type="button" name="remove" value="Remove Service Groups"/> + <input type="button" name="add" value="Add Service Groups"/> + </span> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <input type="checkbox" name="select" value="services"/> + </td> + <td> + <span name="memberservice_hbacsvcgroup">services</span> + </td> + </tr> + </tbody> + </table> + </div> +</div> +</body> +</html>
\ No newline at end of file diff --git a/install/static/layouts/default/hbac-details-sourcehost.html b/install/static/layouts/default/hbac-details-sourcehost.html new file mode 100755 index 000000000..12e934c0d --- /dev/null +++ b/install/static/layouts/default/hbac-details-sourcehost.html @@ -0,0 +1,75 @@ +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>From</title> + + <link rel="stylesheet" type="text/css" href="jquery-ui.css" /> + <link rel="stylesheet" type="text/css" href="ipa.css" /> +</head> +<body> +<div id="contents"> + Rule applies when access is being initiated from: + <input type="radio" name="sourcehostcategory" value="all"/>Any Host + <input type="radio" name="sourcehostcategory" value=""/>Specified Hosts and Groups + <br/> + + <div id="hbac-sourcehost_host"> + <table class="search-table"> + <thead> + <tr> + <th style="width: 25px;"> + <input type="checkbox" name="select"/> + </th> + <th> + <span style="float: left;">Host</span> + <span name="buttons" style="float: right;"> + <input type="button" name="remove" value="Remove Hosts"/> + <input type="button" name="add" value="Add Hosts"/> + </span> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <input type="checkbox" name="select" value="host"/> + </td> + <td> + <span name="sourcehost_host">host</span> + </td> + </tr> + </tbody> + </table> + </div> + + <div id="hbac-sourcehost_hostgroup"> + <table class="search-table"> + <thead> + <tr> + <th style="width: 25px;"> + <input type="checkbox" name="select"/> + </th> + <th> + <span style="float: left;">Host Group</span> + <span name="buttons" style="float: right;"> + <input type="button" name="remove" value="Remove Host Groups"/> + <input type="button" name="add" value="Add Host Groups"/> + </span> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <input type="checkbox" name="select" value="hosts"/> + </td> + <td> + <span name="sourcehost_hostgroup">hosts</span> + </td> + </tr> + </tbody> + </table> + </div> +</div> +</body> +</html>
\ No newline at end of file diff --git a/install/static/layouts/default/hbac-details-user.html b/install/static/layouts/default/hbac-details-user.html new file mode 100755 index 000000000..ef41b6f8d --- /dev/null +++ b/install/static/layouts/default/hbac-details-user.html @@ -0,0 +1,75 @@ +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Who</title> + + <link rel="stylesheet" type="text/css" href="jquery-ui.css" /> + <link rel="stylesheet" type="text/css" href="ipa.css" /> +</head> +<body> +<div id="contents"> + Rule applies when access is requested by: + <input type="radio" name="usercategory" value="all"/>Anyone + <input type="radio" name="usercategory" value=""/>Specified Users and Groups + <br/> + + <div id="hbac-memberuser_user"> + <table class="search-table"> + <thead> + <tr> + <th style="width: 25px;"> + <input type="checkbox" name="select"/> + </th> + <th> + <span style="float: left;">User</span> + <span name="buttons" style="float: right;"> + <input type="button" name="remove" value="Remove Users"/> + <input type="button" name="add" value="Add Users"/> + </span> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <input type="checkbox" name="select" value="user"/> + </td> + <td> + <span name="memberuser_user">user</span> + </td> + </tr> + </tbody> + </table> + </div> + + <div id="hbac-memberuser_group"> + <table class="search-table"> + <thead> + <tr> + <th style="width: 25px;"> + <input type="checkbox" name="select"/> + </th> + <th> + <span style="float: left;">User Group</span> + <span name="buttons" style="float: right;"> + <input type="button" name="remove" value="Remove User Groups"/> + <input type="button" name="add" value="Add User Groups"/> + </span> + </th> + </tr> + </thead> + <tbody> + <tr> + <td> + <input type="checkbox" name="select" value="users"/> + </td> + <td> + <span name="memberuser_group">users</span> + </td> + </tr> + </tbody> + </table> + </div> +</div> +</body> +</html>
\ No newline at end of file |