mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add automember rebuild command to the web UI
Design: http://www.freeipa.org/page/V3/Automember_rebuild_membership https://fedorahosted.org/freeipa/ticket/3928
This commit is contained in:
committed by
Petr Vobornik
parent
6c9b3b02a4
commit
b7c7eaf8d9
@@ -699,12 +699,55 @@ IPA.automember.default_group_widget = function(spec) {
|
||||
return that;
|
||||
};
|
||||
|
||||
IPA.automember.rebuild_action = function(spec) {
|
||||
|
||||
spec = spec || {};
|
||||
spec.name = spec.name || 'automember_rebuild';
|
||||
spec.label = spec.label || '@i18n:actions.automember_rebuild';
|
||||
|
||||
var that = IPA.action(spec);
|
||||
|
||||
that.execute_action = function(facet) {
|
||||
var entity = facet.entity.name;
|
||||
if (facet.name == 'search') {
|
||||
var entries = facet.get_selected_values();
|
||||
} else {
|
||||
entries = facet.get_pkeys();
|
||||
}
|
||||
|
||||
var options = {};
|
||||
if (entries.length > 0) {
|
||||
options[entity + 's'] = entries;
|
||||
} else if (entity == 'user') {
|
||||
options['type'] = 'group';
|
||||
} else {
|
||||
options['type'] = 'hostgroup';
|
||||
}
|
||||
|
||||
var command = IPA.command({
|
||||
entity: 'automember',
|
||||
method: 'rebuild',
|
||||
options: options,
|
||||
on_success: function() {
|
||||
IPA.notify_success('@i18n:actions.automember_rebuild_success');
|
||||
},
|
||||
on_error: function() {
|
||||
}
|
||||
});
|
||||
|
||||
command.execute();
|
||||
};
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
exp.entity_spec = make_spec();
|
||||
|
||||
exp.register = function() {
|
||||
var e = reg.entity;
|
||||
var w = reg.widget;
|
||||
var f = reg.field;
|
||||
var a = reg.action;
|
||||
|
||||
e.register({
|
||||
type: 'automember',
|
||||
@@ -713,6 +756,7 @@ exp.register = function() {
|
||||
});
|
||||
w.register('automember_condition', IPA.automember.condition_widget);
|
||||
f.register('automember_condition', IPA.automember.condition_field);
|
||||
a.register('automember_rebuild', exp.rebuild_action);
|
||||
};
|
||||
|
||||
phases.on('registration', exp.register);
|
||||
|
||||
@@ -63,7 +63,16 @@ return {
|
||||
label: '@i18n:objects.host.enrolled',
|
||||
formatter: 'boolean'
|
||||
}
|
||||
]
|
||||
],
|
||||
actions: [
|
||||
'select',
|
||||
{
|
||||
$type: 'automember_rebuild',
|
||||
name: 'automember_rebuild',
|
||||
label: '@i18n:actions.automember_rebuild'
|
||||
}
|
||||
],
|
||||
header_actions: ['select_action', 'automember_rebuild']
|
||||
},
|
||||
{
|
||||
$type: 'details',
|
||||
@@ -144,6 +153,12 @@ return {
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
'select',
|
||||
{
|
||||
$type: 'automember_rebuild',
|
||||
name: 'automember_rebuild',
|
||||
label: '@i18n:actions.automember_rebuild'
|
||||
},
|
||||
'host_unprovision',
|
||||
{
|
||||
$type: 'set_otp',
|
||||
@@ -165,6 +180,7 @@ return {
|
||||
'cert_revoke',
|
||||
'cert_restore'
|
||||
],
|
||||
header_actions: ['select_action', 'automember_rebuild'],
|
||||
state: {
|
||||
evaluators: [
|
||||
IPA.host.has_password_evaluator,
|
||||
|
||||
@@ -67,6 +67,12 @@ return {
|
||||
'title'
|
||||
],
|
||||
actions: [
|
||||
'select',
|
||||
{
|
||||
$type: 'automember_rebuild',
|
||||
name: 'automember_rebuild',
|
||||
label: '@i18n:actions.automember_rebuild'
|
||||
},
|
||||
{
|
||||
$type: 'batch_disable',
|
||||
hide_cond: ['self-service']
|
||||
@@ -76,6 +82,7 @@ return {
|
||||
hide_cond: ['self-service']
|
||||
}
|
||||
],
|
||||
header_actions: ['select_action', 'automember_rebuild'],
|
||||
control_buttons: [
|
||||
{
|
||||
name: 'disable',
|
||||
@@ -240,9 +247,14 @@ return {
|
||||
'enable',
|
||||
'disable',
|
||||
'delete',
|
||||
'reset_password'
|
||||
'reset_password',
|
||||
{
|
||||
$type: 'automember_rebuild',
|
||||
name: 'automember_rebuild',
|
||||
label: '@i18n:actions.automember_rebuild'
|
||||
}
|
||||
],
|
||||
header_actions: ['select_action', 'enable', 'disable', 'delete'],
|
||||
header_actions: ['select_action', 'enable', 'disable', 'delete', 'automember_rebuild'],
|
||||
state: {
|
||||
evaluators: [
|
||||
{
|
||||
|
||||
@@ -14,10 +14,12 @@
|
||||
},
|
||||
"actions": {
|
||||
"apply": "Apply",
|
||||
"confirm": "Are you sure you want to proceed with the action.",
|
||||
"delete_confirm": "Are you sure you want to delete ${object}",
|
||||
"disable_confirm": "Are you sure you want to disable ${object}",
|
||||
"enable_confirm": "Are you sure you want to enable ${object}",
|
||||
"automember_rebuild": "Rebuild auto membership",
|
||||
"automember_rebuild_success": "Automember rebuild membership task completed",
|
||||
"confirm": "Are you sure you want to proceed with the action?",
|
||||
"delete_confirm": "Are you sure you want to delete ${object}?",
|
||||
"disable_confirm": "Are you sure you want to disable ${object}?",
|
||||
"enable_confirm": "Are you sure you want to enable ${object}?",
|
||||
"title": "Actions"
|
||||
},
|
||||
"association": {
|
||||
|
||||
@@ -149,10 +149,12 @@ class i18n_messages(Command):
|
||||
},
|
||||
"actions": {
|
||||
"apply": _("Apply"),
|
||||
"confirm": _("Are you sure you want to proceed with the action."),
|
||||
"delete_confirm": _("Are you sure you want to delete ${object}"),
|
||||
"disable_confirm": _("Are you sure you want to disable ${object}"),
|
||||
"enable_confirm": _("Are you sure you want to enable ${object}"),
|
||||
"automember_rebuild": _("Rebuild auto membership"),
|
||||
"automember_rebuild_success": _("Automember rebuild membership task completed"),
|
||||
"confirm": _("Are you sure you want to proceed with the action?"),
|
||||
"delete_confirm": _("Are you sure you want to delete ${object}?"),
|
||||
"disable_confirm": _("Are you sure you want to disable ${object}?"),
|
||||
"enable_confirm": _("Are you sure you want to enable ${object}?"),
|
||||
"title": _("Actions"),
|
||||
},
|
||||
"association": {
|
||||
|
||||
Reference in New Issue
Block a user