summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-02-10 16:48:17 -0500
committerAdam Young <ayoung@redhat.com>2011-02-11 15:04:31 -0500
commitd14ef576c3bd1df3bb29033bdaf85ed0053d889d (patch)
tree117870e3a53a3ed8cea45a2cc0bdbf5c158408ce /install
parent6f6d50f37f21db2a5591fa44c962eea04b82f596 (diff)
downloadfreeipa-d14ef576c3bd1df3bb29033bdaf85ed0053d889d.tar.gz
freeipa-d14ef576c3bd1df3bb29033bdaf85ed0053d889d.tar.xz
freeipa-d14ef576c3bd1df3bb29033bdaf85ed0053d889d.zip
column formatting Allow optional formatting for columns Provide Data formate for host modificaiton
date format
Diffstat (limited to 'install')
-rw-r--r--install/ui/aci.js17
-rw-r--r--install/ui/host.js30
-rw-r--r--install/ui/widget.js8
3 files changed, 49 insertions, 6 deletions
diff --git a/install/ui/aci.js b/install/ui/aci.js
index 494bd9a5..89caec04 100644
--- a/install/ui/aci.js
+++ b/install/ui/aci.js
@@ -227,21 +227,28 @@ IPA.target_section = function(spec) {
that.add_field(that.attribute_table);
+ /*TODO these next two functions are work arounds for missing attribute
+ permissions for the filter text. Remove them once that has been fixed */
that.filter_text.update = function(){
var value = that.filter_text.values && that.filter_text.values.length ?
that.filter_text.values[0] : '';
- $('input[name="'+that.filter_text.name+'"]', that.filter_text.container).val(value);
+ $('input[name="'+that.filter_text.name+'"]',
+ that.filter_text.container).val(value);
var label = $('label[name="'+that.filter_text.name+'"]',
that.filter_text.container);
var input = $('input[name="'+that.filter_text.name+'"]',
that.filter_text.container);
-
- label.css('display', 'none');
- input.css('display', 'inline');
-
+ label.css('display', 'none');
+ input.css('display', 'inline');
};
+ that.filter_text.save = function(){
+ var input = $('input[name="'+that.filter_text.name+'"]',
+ that.filter_text.container);
+ var value = $.trim(input.val());
+ return value === '' ? [] : [value];
+ };
var target_types = [
{
diff --git a/install/ui/host.js b/install/ui/host.js
index 86a5b820..7f56aeee 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -103,6 +103,32 @@ IPA.host_add_dialog = function (spec) {
return that;
};
+/* Take an LDAP format date in UTC and format it */
+IPA.utc_date_column_format = function(value){
+ if (!value) {
+ return "";
+ }
+ if (value.length != "20101119025910Z".length){
+ return value;
+ }
+ /* We only handle GMT */
+ if (value.charAt(value.length -1) !== 'Z'){
+ return value;
+ }
+
+ var date = new Date();
+
+ date.setUTCFullYear(
+ value.substring(0, 4),
+ value.substring(4, 6),
+ value.substring(6, 8));
+ date.setUTCHours(
+ value.substring(8, 10),
+ value.substring(10, 12),
+ value.substring(12, 14));
+ var formated = date.toString();
+ return formated;
+};
IPA.host_search_facet = function (spec) {
@@ -115,7 +141,9 @@ IPA.host_search_facet = function (spec) {
that.create_column({name:'fqdn'});
that.create_column({name:'description'});
//TODO use the value of this field to set enrollment status
- that.create_column({name:'krblastpwdchange', label:'Enrolled?'});
+ that.create_column({name:'krblastpwdchange', label:'Enrolled?',
+ format:IPA.utc_date_column_format
+ });
that.create_column({name:'nshostlocation'});
that.search_facet_init();
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 1bff1579..78a59468 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -1005,6 +1005,9 @@ IPA.column = function (spec) {
var that = {};
+ if (spec.format){
+ that.format = spec.format;
+ }
that.name = spec.name;
that.label = spec.label;
that.primary_key = spec.primary_key;
@@ -1025,8 +1028,13 @@ IPA.column = function (spec) {
container.empty();
var value = record[that.name];
+ if (that.format && value){
+ value = that.format(value);
+ }
+
value = value ? value.toString() : '';
+
container.append(value);
}