summaryrefslogtreecommitdiffstats
path: root/install/ui/src
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/src')
-rw-r--r--install/ui/src/freeipa/host.js7
-rw-r--r--install/ui/src/freeipa/util.js17
-rw-r--r--install/ui/src/freeipa/widget.js15
3 files changed, 38 insertions, 1 deletions
diff --git a/install/ui/src/freeipa/host.js b/install/ui/src/freeipa/host.js
index 692441f6b..5b886b639 100644
--- a/install/ui/src/freeipa/host.js
+++ b/install/ui/src/freeipa/host.js
@@ -112,6 +112,13 @@ return {
$type: 'checkbox',
acl_param: 'krbticketflags',
flags: ['w_if_no_aci']
+ },
+ {
+ name: 'ipaassignedidview',
+ $type: 'link',
+ label: '@i18n:objects.idview.ipaassignedidview',
+ ui_formatter: 'dn',
+ other_entity: 'idview'
}
]
},
diff --git a/install/ui/src/freeipa/util.js b/install/ui/src/freeipa/util.js
index 0032c8ace..adebe2cdb 100644
--- a/install/ui/src/freeipa/util.js
+++ b/install/ui/src/freeipa/util.js
@@ -241,6 +241,13 @@ define([
return els;
}
+ function get_val_from_dn(dn, pos) {
+ if (!dn) return '';
+ pos = pos === undefined ? 0 : pos;
+ var val = dn.split(',')[pos].split('=')[1];
+ return val;
+ }
+
/**
* Module with utility functions
* @class
@@ -362,7 +369,15 @@ define([
* @param {string} text
* @return {Array} array of jQuery elements
*/
- beautify_message: beautify_message
+ beautify_message: beautify_message,
+
+ /**
+ * Return value of part of DN on specified position
+ * @param {string} dn Distinguished name
+ * @param {Number} [position=0] Zero-based DN part position
+ * @return {string}
+ */
+ get_val_from_dn: get_val_from_dn
};
return util;
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index c7a082b18..b9ab82cbc 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -2457,6 +2457,20 @@ IPA.datetime_formatter = function(spec) {
};
/**
+ * Format DN into single pkey
+ * @class
+ * @extends IPA.formatter
+ */
+IPA.dn_formatter = function(spec) {
+
+ var that = IPA.formatter(spec);
+ that.format = function(value) {
+ return util.get_val_from_dn(value);
+ };
+ return that;
+};
+
+/**
* Column for {@link IPA.table_widget}
*
* Handles value rendering.
@@ -6180,6 +6194,7 @@ exp.register = function() {
f.register('boolean', IPA.boolean_formatter);
f.register('boolean_status', IPA.boolean_status_formatter);
f.register('datetime', IPA.datetime_formatter);
+ f.register('dn', IPA.dn_formatter);
};
phases.on('registration', exp.register);