mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-26 17:01:14 -06:00
webui: add link from host to idview
https://fedorahosted.org/freeipa/ticket/4535 Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
parent
0e76bc1cb6
commit
00d598bab0
@ -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'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -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;
|
||||
|
@ -2456,6 +2456,20 @@ IPA.datetime_formatter = function(spec) {
|
||||
return that;
|
||||
};
|
||||
|
||||
/**
|
||||
* 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}
|
||||
*
|
||||
@ -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);
|
||||
|
@ -376,6 +376,7 @@
|
||||
"apply_hostgroups_title": "Apply ID View ${primary_key} on hosts of ${entity}",
|
||||
"apply_hosts": "Apply to hosts",
|
||||
"apply_hosts_title": "Apply ID view ${primary_key} on ${entity}",
|
||||
"ipaassignedidview": "Assigned ID View",
|
||||
"overrides_tab": "${primary_key} overrides:",
|
||||
"unapply_hostgroups": "Un-apply from host groups",
|
||||
"unapply_hostgroups_all_title": "Un-apply ID Views from hosts of hostgroups",
|
||||
|
@ -520,6 +520,7 @@ class i18n_messages(Command):
|
||||
"apply_hostgroups_title": _("Apply ID View ${primary_key} on hosts of ${entity}"),
|
||||
"apply_hosts": _("Apply to hosts"),
|
||||
"apply_hosts_title": _("Apply ID view ${primary_key} on ${entity}"),
|
||||
"ipaassignedidview": _("Assigned ID View"),
|
||||
"overrides_tab": _("${primary_key} overrides:"),
|
||||
"unapply_hostgroups": _("Un-apply from host groups"),
|
||||
"unapply_hostgroups_all_title": _("Un-apply ID Views from hosts of hostgroups"),
|
||||
|
Loading…
Reference in New Issue
Block a user