mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-13 01:31:56 -06:00
Web UI search optimization
This patch optimizes options used in commands executed by search pages. 1) Removed --all from _find and _show commands used by search pages. All displayed attributes should be already included in default attributes. 2) Removed search_all_attributes - Not needed since introduction of paging. 3) Added --no-members options to search _show commmands. Members are not displayed on search pages and such change drastically improves performance. It reduces computations on server and amount of data transferred to Web UI. https://fedorahosted.org/freeipa/ticket/3706
This commit is contained in:
parent
b7f10d9fe6
commit
881290b010
@ -217,6 +217,20 @@ exp.entity = IPA.entity = function(spec) {
|
||||
return that;
|
||||
};
|
||||
|
||||
that.has_members = function() {
|
||||
var members = that.metadata.attribute_members;
|
||||
var has = false;
|
||||
if (members) {
|
||||
for (var member in members) {
|
||||
if (members.hasOwnProperty(member)) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return has;
|
||||
};
|
||||
|
||||
that.builder = spec.builder || IPA.entity_builder(that);
|
||||
|
||||
that.entity_init = that.init;
|
||||
|
@ -1082,7 +1082,6 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) {
|
||||
|
||||
that.pagination = spec.pagination === undefined ? true : spec.pagination;
|
||||
that.search_all_entries = spec.search_all_entries;
|
||||
that.search_all_attributes = spec.search_all_attributes;
|
||||
that.sort_enabled = spec.sort_enabled === undefined ? true : spec.sort_enabled;
|
||||
that.selectable = spec.selectable === undefined ? true : spec.selectable;
|
||||
that.select_changed = IPA.observer();
|
||||
@ -1312,7 +1311,7 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) {
|
||||
|
||||
that.create_get_records_command = function(pkeys, on_success, on_error) {
|
||||
|
||||
var batch = IPA.batch_command({
|
||||
var batch = IPA.batch_command({
|
||||
name: that.get_records_command_name(),
|
||||
on_success: on_success,
|
||||
on_error: on_error
|
||||
@ -1324,10 +1323,13 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) {
|
||||
var command = IPA.command({
|
||||
entity: that.table.entity.name,
|
||||
method: 'show',
|
||||
args: [ pkey ],
|
||||
options: { all: true }
|
||||
args: [pkey]
|
||||
});
|
||||
|
||||
if (that.table.entity.has_members()) {
|
||||
command.set_options({no_members: true});
|
||||
}
|
||||
|
||||
batch.add_command(command);
|
||||
}
|
||||
|
||||
@ -1353,7 +1355,6 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) {
|
||||
label: entity.metadata.label,
|
||||
entity: entity,
|
||||
pagination: true,
|
||||
search_all_attributes: that.search_all_attributes,
|
||||
scrollable: true,
|
||||
selectable: that.selectable && !that.read_only
|
||||
});
|
||||
|
@ -44,7 +44,6 @@ var spec = {
|
||||
{
|
||||
$type: 'search',
|
||||
row_enabled_attribute: 'ipaenabledflag',
|
||||
search_all_attributes: true,
|
||||
columns: [
|
||||
'cn',
|
||||
{
|
||||
|
@ -239,10 +239,7 @@ IPA.search_facet = function(spec, no_init) {
|
||||
name: that.get_search_command_name(),
|
||||
entity: that.managed_entity.name,
|
||||
method: 'find',
|
||||
args: args,
|
||||
options: {
|
||||
all: that.search_all_attributes
|
||||
}
|
||||
args: args
|
||||
});
|
||||
|
||||
if (that.pagination) {
|
||||
|
@ -42,7 +42,6 @@ var spec = {
|
||||
{
|
||||
$type: 'search',
|
||||
row_enabled_attribute: 'ipaenabledflag',
|
||||
search_all_attributes: true,
|
||||
columns: [
|
||||
'cn',
|
||||
'ipaselinuxuser',
|
||||
|
Loading…
Reference in New Issue
Block a user