mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Added extensible UI framework.
The entity definitions have been converted into classes. The entity init() method will use the builder to construct the facets and dialogs. The UI can be customized by creating a subclass of the original entity in extension.js and then overriding the init() method. Ticket #2043
This commit is contained in:
committed by
Petr Vobornik
parent
5db9fed8a5
commit
8ca348b99e
@@ -23,11 +23,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
IPA.entity_factories.permission = function() {
|
IPA.aci = {};
|
||||||
|
|
||||||
return IPA.entity_builder().
|
IPA.aci.permission_entity = function(spec) {
|
||||||
entity('permission').
|
|
||||||
facet_groups([ 'privilege' , 'settings' ]).
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.facet_groups([ 'privilege' , 'settings' ]).
|
||||||
search_facet({
|
search_facet({
|
||||||
columns:['cn']
|
columns:['cn']
|
||||||
}).
|
}).
|
||||||
@@ -78,15 +82,19 @@ IPA.entity_factories.permission = function() {
|
|||||||
label: IPA.messages.objects.permission.target
|
label: IPA.messages.objects.permission.target
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
IPA.entity_factories.privilege = function() {
|
IPA.aci.privilege_entity = function(spec) {
|
||||||
return IPA.entity_builder().
|
|
||||||
entity('privilege').
|
var that = IPA.entity(spec);
|
||||||
facet_groups([ 'role', 'settings', 'permission' ]).
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.facet_groups([ 'role', 'settings', 'permission' ]).
|
||||||
search_facet({
|
search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'cn',
|
'cn',
|
||||||
@@ -130,16 +138,19 @@ IPA.entity_factories.privilege = function() {
|
|||||||
name: 'description'
|
name: 'description'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
IPA.entity_factories.role = function() {
|
IPA.aci.role_entity = function(spec) {
|
||||||
return IPA.entity_builder().
|
|
||||||
entity('role').
|
var that = IPA.entity(spec);
|
||||||
facet_groups([ 'member', 'settings', 'privilege' ]).
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.facet_groups([ 'member', 'settings', 'privilege' ]).
|
||||||
search_facet({
|
search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'cn',
|
'cn',
|
||||||
@@ -176,15 +187,19 @@ IPA.entity_factories.role = function() {
|
|||||||
name: 'description'
|
name: 'description'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
IPA.entity_factories.selfservice = function() {
|
IPA.aci.selfservice_entity = function(spec) {
|
||||||
return IPA.entity_builder().
|
|
||||||
entity('selfservice').
|
var that = IPA.entity(spec);
|
||||||
search_facet({
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns:['aciname']}).
|
columns:['aciname']}).
|
||||||
details_facet({
|
details_facet({
|
||||||
sections:[{
|
sections:[{
|
||||||
@@ -204,15 +219,19 @@ IPA.entity_factories.selfservice = function() {
|
|||||||
object_type:'user',
|
object_type:'user',
|
||||||
name:'attrs'
|
name:'attrs'
|
||||||
}]
|
}]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
IPA.entity_factories.delegation = function() {
|
IPA.aci.delegation_entity = function(spec) {
|
||||||
return IPA.entity_builder().
|
|
||||||
entity('delegation').
|
var that = IPA.entity(spec);
|
||||||
search_facet({
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns:['aciname']}).
|
columns:['aciname']}).
|
||||||
details_facet({sections:[
|
details_facet({sections:[
|
||||||
{
|
{
|
||||||
@@ -261,8 +280,10 @@ IPA.entity_factories.delegation = function() {
|
|||||||
object_type: 'user',
|
object_type: 'user',
|
||||||
join: true
|
join: true
|
||||||
}]
|
}]
|
||||||
}).
|
});
|
||||||
build();
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -738,3 +759,9 @@ IPA.target_section = function(spec) {
|
|||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.register('permission', IPA.aci.permission_entity);
|
||||||
|
IPA.register('privilege', IPA.aci.privilege_entity);
|
||||||
|
IPA.register('role', IPA.aci.role_entity);
|
||||||
|
IPA.register('selfservice', IPA.aci.selfservice_entity);
|
||||||
|
IPA.register('delegation', IPA.aci.delegation_entity);
|
||||||
|
|||||||
@@ -23,13 +23,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
|
IPA.automount = {};
|
||||||
|
|
||||||
/**Automount*/
|
IPA.automount.location_entity = function(spec) {
|
||||||
|
|
||||||
IPA.entity_factories.automountlocation = function() {
|
var that = IPA.entity(spec);
|
||||||
return IPA.entity_builder().
|
|
||||||
entity({ name: 'automountlocation' }).
|
that.init = function(params) {
|
||||||
facet_groups([ 'automountmap', 'settings' ]).
|
|
||||||
|
params.builder.facet_groups([ 'automountmap', 'settings' ]).
|
||||||
search_facet({
|
search_facet({
|
||||||
title: IPA.metadata.objects.automountlocation.label,
|
title: IPA.metadata.objects.automountlocation.label,
|
||||||
columns:['cn']
|
columns:['cn']
|
||||||
@@ -52,14 +54,19 @@ IPA.entity_factories.automountlocation = function() {
|
|||||||
}).
|
}).
|
||||||
adder_dialog({
|
adder_dialog({
|
||||||
fields: [ 'cn' ]
|
fields: [ 'cn' ]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.entity_factories.automountmap = function() {
|
return that;
|
||||||
return IPA.entity_builder().
|
};
|
||||||
entity({ name: 'automountmap' }).
|
|
||||||
containing_entity('automountlocation').
|
IPA.automount.map_entity = function(spec) {
|
||||||
|
|
||||||
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.containing_entity('automountlocation').
|
||||||
facet_groups([ 'automountkey', 'settings' ]).
|
facet_groups([ 'automountkey', 'settings' ]).
|
||||||
nested_search_facet({
|
nested_search_facet({
|
||||||
facet_group: 'automountkey',
|
facet_group: 'automountkey',
|
||||||
@@ -135,14 +142,19 @@ IPA.entity_factories.automountmap = function() {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.entity_factories.automountkey = function() {
|
return that;
|
||||||
return IPA.entity_builder().
|
};
|
||||||
entity({ name: 'automountkey' }).
|
|
||||||
containing_entity('automountmap').
|
IPA.automount.key_entity = function(spec) {
|
||||||
|
|
||||||
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.containing_entity('automountmap').
|
||||||
details_facet({
|
details_facet({
|
||||||
sections: [
|
sections: [
|
||||||
{
|
{
|
||||||
@@ -188,8 +200,10 @@ IPA.entity_factories.automountkey = function() {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
fields:['automountkey','automountinformation']
|
fields:['automountkey','automountinformation']
|
||||||
}).
|
});
|
||||||
build();
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.automount_key_column = function(spec) {
|
IPA.automount_key_column = function(spec) {
|
||||||
@@ -275,3 +289,7 @@ IPA.get_option_values = function(){
|
|||||||
});
|
});
|
||||||
return values;
|
return values;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.register('automountlocation', IPA.automount.location_entity);
|
||||||
|
IPA.register('automountmap', IPA.automount.map_entity);
|
||||||
|
IPA.register('automountkey', IPA.automount.key_entity);
|
||||||
|
|||||||
@@ -23,8 +23,11 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js, widget.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js, widget.js */
|
||||||
|
|
||||||
/* DNS */
|
IPA.dns = {};
|
||||||
IPA.entity_factories.dnszone = function() {
|
|
||||||
|
IPA.dns.zone_entity = function(spec) {
|
||||||
|
|
||||||
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
if (!IPA.dns_enabled) {
|
if (!IPA.dns_enabled) {
|
||||||
var except = {
|
var except = {
|
||||||
@@ -33,9 +36,9 @@ IPA.entity_factories.dnszone = function() {
|
|||||||
throw except;
|
throw except;
|
||||||
}
|
}
|
||||||
|
|
||||||
return IPA.entity_builder().
|
that.init = function(params) {
|
||||||
entity('dnszone').
|
|
||||||
facet_groups([ 'dnsrecord', 'settings' ]).
|
params.builder.facet_groups([ 'dnsrecord', 'settings' ]).
|
||||||
search_facet({
|
search_facet({
|
||||||
title: IPA.metadata.objects.dnszone.label,
|
title: IPA.metadata.objects.dnszone.label,
|
||||||
columns: [ 'idnsname' ]
|
columns: [ 'idnsname' ]
|
||||||
@@ -140,8 +143,10 @@ IPA.entity_factories.dnszone = function() {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.dnszone_details_facet = function(spec) {
|
IPA.dnszone_details_facet = function(spec) {
|
||||||
@@ -429,7 +434,9 @@ IPA.dns_record_search_load = function (result) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.entity_factories.dnsrecord = function() {
|
IPA.dns.record_entity = function(spec) {
|
||||||
|
|
||||||
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
if (!IPA.dns_enabled) {
|
if (!IPA.dns_enabled) {
|
||||||
var except = {
|
var except = {
|
||||||
@@ -438,9 +445,9 @@ IPA.entity_factories.dnsrecord = function() {
|
|||||||
throw except;
|
throw except;
|
||||||
}
|
}
|
||||||
|
|
||||||
return IPA.entity_builder().
|
that.init = function(params) {
|
||||||
entity('dnsrecord').
|
|
||||||
containing_entity('dnszone').
|
params.builder.containing_entity('dnszone').
|
||||||
details_facet({
|
details_facet({
|
||||||
post_update_hook:function(data){
|
post_update_hook:function(data){
|
||||||
var result = data.result.result;
|
var result = data.result.result;
|
||||||
@@ -604,8 +611,10 @@ IPA.entity_factories.dnsrecord = function() {
|
|||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.dnsrecord_redirection_dialog = function(spec) {
|
IPA.dnsrecord_redirection_dialog = function(spec) {
|
||||||
@@ -710,3 +719,6 @@ IPA.dnsrecord_get_delete_values = function() {
|
|||||||
|
|
||||||
return value_array;
|
return value_array;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.register('dnszone', IPA.dns.zone_entity);
|
||||||
|
IPA.register('dnsrecord', IPA.dns.record_entity);
|
||||||
|
|||||||
@@ -29,16 +29,17 @@ IPA.entitle.unregistered = 'unregistered';
|
|||||||
IPA.entitle.online = 'online';
|
IPA.entitle.online = 'online';
|
||||||
IPA.entitle.offline = 'offline';
|
IPA.entitle.offline = 'offline';
|
||||||
|
|
||||||
IPA.entity_factories.entitle = function() {
|
IPA.entitle.entity = function(spec) {
|
||||||
|
|
||||||
var builder = IPA.entity_builder();
|
spec = spec || {};
|
||||||
|
|
||||||
builder.
|
var that = IPA.entity(spec);
|
||||||
entity({
|
|
||||||
factory: IPA.entitle.entity,
|
that.status = IPA.entitle.unregistered;
|
||||||
name: 'entitle'
|
|
||||||
}).
|
that.init = function(params) {
|
||||||
facet_groups([ 'account', 'certificates' ]).
|
|
||||||
|
params.builder.facet_groups([ 'account', 'certificates' ]).
|
||||||
details_facet({
|
details_facet({
|
||||||
factory: IPA.entitle.details_facet,
|
factory: IPA.entitle.details_facet,
|
||||||
label: IPA.messages.objects.entitle.account,
|
label: IPA.messages.objects.entitle.account,
|
||||||
@@ -171,18 +172,8 @@ IPA.entity_factories.entitle = function() {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
return builder.build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.entitle.entity = function(spec) {
|
|
||||||
|
|
||||||
spec = spec || {};
|
|
||||||
|
|
||||||
var that = IPA.entity(spec);
|
|
||||||
|
|
||||||
that.status = IPA.entitle.unregistered;
|
|
||||||
|
|
||||||
that.get_accounts = function(on_success, on_error) {
|
that.get_accounts = function(on_success, on_error) {
|
||||||
|
|
||||||
var command = IPA.command({
|
var command = IPA.command({
|
||||||
@@ -751,3 +742,5 @@ IPA.entitle.download_widget = function(spec) {
|
|||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.register('entitle', IPA.entitle.entity);
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ IPA.entity = function(spec) {
|
|||||||
that.redirect_facet = spec.redirect_facet;
|
that.redirect_facet = spec.redirect_facet;
|
||||||
that.containing_entity = null;
|
that.containing_entity = null;
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
};
|
||||||
|
|
||||||
that.get_containing_entity = function() {
|
that.get_containing_entity = function() {
|
||||||
return that.containing_entity ?
|
return that.containing_entity ?
|
||||||
IPA.get_entity(that.containing_entity) : null;
|
IPA.get_entity(that.containing_entity) : null;
|
||||||
@@ -523,10 +526,7 @@ IPA.entity_builder = function(){
|
|||||||
};
|
};
|
||||||
|
|
||||||
that.build = function(){
|
that.build = function(){
|
||||||
var item = entity;
|
return entity;
|
||||||
entity = null;
|
|
||||||
|
|
||||||
return item;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
|
|||||||
@@ -24,11 +24,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
IPA.entity_factories.group = function () {
|
IPA.group = {};
|
||||||
|
|
||||||
return IPA.entity_builder().
|
IPA.group.entity = function(spec) {
|
||||||
entity('group').
|
|
||||||
search_facet({
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'cn',
|
'cn',
|
||||||
'gidnumber',
|
'gidnumber',
|
||||||
@@ -117,8 +121,10 @@ IPA.entity_factories.group = function () {
|
|||||||
},
|
},
|
||||||
'gidnumber'
|
'gidnumber'
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.group_nonposix_checkbox_widget = function (spec) {
|
IPA.group_nonposix_checkbox_widget = function (spec) {
|
||||||
@@ -161,3 +167,5 @@ IPA.group_adder_dialog = function (spec) {
|
|||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.register('group', IPA.group.entity);
|
||||||
|
|||||||
@@ -23,10 +23,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
IPA.entity_factories.hbacrule = function() {
|
IPA.hbac = {};
|
||||||
return IPA.entity_builder().
|
|
||||||
entity('hbacrule').
|
IPA.hbac.rule_entity = function(spec) {
|
||||||
search_facet({
|
|
||||||
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
search_all: true,
|
search_all: true,
|
||||||
columns: [
|
columns: [
|
||||||
'cn',
|
'cn',
|
||||||
@@ -39,14 +44,19 @@ IPA.entity_factories.hbacrule = function() {
|
|||||||
}).
|
}).
|
||||||
adder_dialog({
|
adder_dialog({
|
||||||
fields: [ 'cn' ]
|
fields: [ 'cn' ]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.entity_factories.hbacsvc = function() {
|
return that;
|
||||||
return IPA.entity_builder().
|
};
|
||||||
entity('hbacsvc').
|
|
||||||
search_facet({
|
IPA.hbac.service_entity = function(spec) {
|
||||||
|
|
||||||
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'cn',
|
'cn',
|
||||||
'description'
|
'description'
|
||||||
@@ -99,15 +109,19 @@ IPA.entity_factories.hbacsvc = function() {
|
|||||||
name: 'description'
|
name: 'description'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
IPA.entity_factories.hbacsvcgroup = function() {
|
IPA.hbac.service_group_entity = function(spec) {
|
||||||
return IPA.entity_builder().
|
|
||||||
entity('hbacsvcgroup').
|
var that = IPA.entity(spec);
|
||||||
search_facet({
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'cn',
|
'cn',
|
||||||
'description'
|
'description'
|
||||||
@@ -159,8 +173,10 @@ IPA.entity_factories.hbacsvcgroup = function() {
|
|||||||
name: 'description'
|
name: 'description'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.hbacrule_details_facet = function(spec) {
|
IPA.hbacrule_details_facet = function(spec) {
|
||||||
@@ -557,3 +573,7 @@ IPA.hbacrule_details_facet = function(spec) {
|
|||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.register('hbacrule', IPA.hbac.rule_entity);
|
||||||
|
IPA.register('hbacsvc', IPA.hbac.service_entity);
|
||||||
|
IPA.register('hbacsvcgroup', IPA.hbac.service_group_entity);
|
||||||
|
|||||||
@@ -24,11 +24,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
IPA.entity_factories.host = function () {
|
IPA.host = {};
|
||||||
|
|
||||||
return IPA.entity_builder().
|
IPA.host.entity = function(spec) {
|
||||||
entity('host').
|
|
||||||
search_facet({
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'fqdn',
|
'fqdn',
|
||||||
'description',
|
'description',
|
||||||
@@ -166,8 +170,10 @@ IPA.entity_factories.host = function () {
|
|||||||
}).
|
}).
|
||||||
deleter_dialog({
|
deleter_dialog({
|
||||||
factory: IPA.host_deleter_dialog
|
factory: IPA.host_deleter_dialog
|
||||||
}).
|
});
|
||||||
build();
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.host_fqdn_section = function(spec) {
|
IPA.host_fqdn_section = function(spec) {
|
||||||
@@ -779,3 +785,5 @@ IPA.host_certificate_status_widget = function (spec) {
|
|||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.register('host', IPA.host.entity);
|
||||||
|
|||||||
@@ -22,12 +22,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
|
IPA.hostgroup = {};
|
||||||
|
|
||||||
IPA.entity_factories.hostgroup = function() {
|
IPA.hostgroup.entity = function(spec) {
|
||||||
|
|
||||||
return IPA.entity_builder().
|
var that = IPA.entity(spec);
|
||||||
entity('hostgroup').
|
|
||||||
search_facet({
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'cn',
|
'cn',
|
||||||
'description'
|
'description'
|
||||||
@@ -77,9 +80,10 @@ IPA.entity_factories.hostgroup = function() {
|
|||||||
name: 'description'
|
name: 'description'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
|
IPA.register('hostgroup', IPA.hostgroup.entity);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<script type="text/javascript" src="aci.js"></script>
|
<script type="text/javascript" src="aci.js"></script>
|
||||||
<script type="text/javascript" src="entitle.js"></script>
|
<script type="text/javascript" src="entitle.js"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="extension.js"></script>
|
||||||
<script type="text/javascript" src="develop.js"></script>
|
<script type="text/javascript" src="develop.js"></script>
|
||||||
<script type="text/javascript" src="webui.js"></script>
|
<script type="text/javascript" src="webui.js"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
/* REQUIRES: jquery.ordered-map.js */
|
/* REQUIRES: jquery.ordered-map.js */
|
||||||
/*global $:true, location:true */
|
/*global $:true, location:true */
|
||||||
|
|
||||||
var IPA = ( function () {
|
var IPA = function() {
|
||||||
|
|
||||||
var that = {
|
var that = {
|
||||||
jsonrpc_id: 0
|
jsonrpc_id: 0
|
||||||
@@ -172,12 +172,14 @@ var IPA = ( function () {
|
|||||||
batch.execute();
|
batch.execute();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
that.register = function(name, factory) {
|
||||||
|
that.entity_factories[name] = factory;
|
||||||
|
};
|
||||||
|
|
||||||
that.get_entities = function() {
|
that.get_entities = function() {
|
||||||
return that.entities.values;
|
return that.entities.values;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
that.get_entity = function(name) {
|
that.get_entity = function(name) {
|
||||||
var entity = that.entities.get(name);
|
var entity = that.entities.get(name);
|
||||||
if (!entity) {
|
if (!entity) {
|
||||||
@@ -185,9 +187,22 @@ var IPA = ( function () {
|
|||||||
if (!factory) {
|
if (!factory) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
entity = factory();
|
var builder = that.entity_builder();
|
||||||
|
|
||||||
|
builder.entity({
|
||||||
|
factory: factory,
|
||||||
|
name: name
|
||||||
|
});
|
||||||
|
|
||||||
|
entity = builder.build();
|
||||||
|
entity.init({
|
||||||
|
builder: builder
|
||||||
|
});
|
||||||
|
|
||||||
that.add_entity(entity);
|
that.add_entity(entity);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.expected){
|
if (e.expected){
|
||||||
/*expected exceptions thrown by builder just mean that
|
/*expected exceptions thrown by builder just mean that
|
||||||
@@ -256,7 +271,7 @@ var IPA = ( function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
}());
|
}();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call an IPA command over JSON-RPC.
|
* Call an IPA command over JSON-RPC.
|
||||||
|
|||||||
@@ -22,11 +22,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
IPA.entity_factories.netgroup = function() {
|
IPA.netgroup = {};
|
||||||
|
|
||||||
return IPA.entity_builder().
|
IPA.netgroup.entity = function(spec) {
|
||||||
entity('netgroup').
|
|
||||||
search_facet({
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'cn',
|
'cn',
|
||||||
'description'
|
'description'
|
||||||
@@ -76,6 +80,10 @@ IPA.entity_factories.netgroup = function() {
|
|||||||
name: 'description'
|
name: 'description'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
|
IPA.register('netgroup', IPA.netgroup.entity);
|
||||||
|
|||||||
@@ -23,11 +23,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
/**pwpolicy*/
|
IPA.pwpolicy = {};
|
||||||
IPA.entity_factories.pwpolicy = function() {
|
|
||||||
return IPA.entity_builder().
|
IPA.pwpolicy.entity = function(spec) {
|
||||||
entity('pwpolicy').
|
|
||||||
search_facet({
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns:['cn','cospriority']}).
|
columns:['cn','cospriority']}).
|
||||||
details_facet({
|
details_facet({
|
||||||
sections:[
|
sections:[
|
||||||
@@ -63,18 +67,21 @@ IPA.entity_factories.pwpolicy = function() {
|
|||||||
'cospriority'
|
'cospriority'
|
||||||
],
|
],
|
||||||
height: 300
|
height: 300
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
return that;
|
||||||
krbtpolicy
|
};
|
||||||
Does not have search
|
|
||||||
*/
|
IPA.krbtpolicy = {};
|
||||||
IPA.entity_factories.krbtpolicy = function() {
|
|
||||||
return IPA.entity_builder().
|
IPA.krbtpolicy.entity = function(spec) {
|
||||||
entity('krbtpolicy').
|
|
||||||
details_facet({
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.details_facet({
|
||||||
title: IPA.metadata.objects.krbtpolicy.label,
|
title: IPA.metadata.objects.krbtpolicy.label,
|
||||||
sections: [
|
sections: [
|
||||||
{
|
{
|
||||||
@@ -86,6 +93,11 @@ IPA.entity_factories.krbtpolicy = function() {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
needs_update: true
|
needs_update: true
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
|
IPA.register('pwpolicy', IPA.pwpolicy.entity);
|
||||||
|
IPA.register('krbtpolicy', IPA.krbtpolicy.entity);
|
||||||
|
|||||||
@@ -23,14 +23,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
|
IPA.config = {};
|
||||||
|
|
||||||
|
IPA.config.entity = function(spec) {
|
||||||
|
|
||||||
/* Configuration */
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
IPA.entity_factories.config = function(){
|
that.init = function(params) {
|
||||||
return IPA.entity_builder().
|
|
||||||
entity('config').
|
params.builder.details_facet({
|
||||||
details_facet({
|
|
||||||
title: IPA.metadata.objects.config.label,
|
title: IPA.metadata.objects.config.label,
|
||||||
sections: [
|
sections: [
|
||||||
{
|
{
|
||||||
@@ -80,6 +81,10 @@ IPA.entity_factories.config = function(){
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
needs_update: true
|
needs_update: true
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
|
IPA.register('config', IPA.config.entity);
|
||||||
|
|||||||
@@ -23,11 +23,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
IPA.entity_factories.service = function() {
|
IPA.service = {};
|
||||||
|
|
||||||
return IPA.entity_builder().
|
IPA.service.entity = function(spec) {
|
||||||
entity('service').
|
|
||||||
search_facet({
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns: [ 'krbprincipalname' ]
|
columns: [ 'krbprincipalname' ]
|
||||||
}).
|
}).
|
||||||
details_facet({
|
details_facet({
|
||||||
@@ -81,10 +85,11 @@ IPA.entity_factories.service = function() {
|
|||||||
adder_dialog({
|
adder_dialog({
|
||||||
factory: IPA.service_adder_dialog,
|
factory: IPA.service_adder_dialog,
|
||||||
height: 350
|
height: 350
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
IPA.service_adder_dialog = function(spec) {
|
IPA.service_adder_dialog = function(spec) {
|
||||||
|
|
||||||
@@ -341,3 +346,5 @@ IPA.service_certificate_status_widget = function (spec) {
|
|||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.register('service', IPA.service.entity);
|
||||||
|
|||||||
@@ -22,12 +22,15 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
|
IPA.sudo = {};
|
||||||
|
|
||||||
IPA.entity_factories.sudorule = function() {
|
IPA.sudo.rule_entity = function(spec) {
|
||||||
|
|
||||||
return IPA.entity_builder().
|
var that = IPA.entity(spec);
|
||||||
entity('sudorule').
|
|
||||||
search_facet({
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'cn',
|
'cn',
|
||||||
'ipaenabledflag',
|
'ipaenabledflag',
|
||||||
@@ -39,15 +42,19 @@ IPA.entity_factories.sudorule = function() {
|
|||||||
}).
|
}).
|
||||||
adder_dialog({
|
adder_dialog({
|
||||||
fields: [ 'cn' ]
|
fields: [ 'cn' ]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.entity_factories.sudocmd = function() {
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
return IPA.entity_builder().
|
IPA.sudo.command_entity = function(spec) {
|
||||||
entity('sudocmd').
|
|
||||||
search_facet({
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'sudocmd',
|
'sudocmd',
|
||||||
'description'
|
'description'
|
||||||
@@ -100,15 +107,19 @@ IPA.entity_factories.sudocmd = function() {
|
|||||||
name: 'description'
|
name: 'description'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.entity_factories.sudocmdgroup = function() {
|
return that;
|
||||||
return IPA.entity_builder().
|
};
|
||||||
entity('sudocmdgroup').
|
|
||||||
search_facet({
|
IPA.sudo.command_group_entity = function(spec) {
|
||||||
|
|
||||||
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
|
that.init = function(params) {
|
||||||
|
|
||||||
|
params.builder.search_facet({
|
||||||
columns: [
|
columns: [
|
||||||
'cn',
|
'cn',
|
||||||
'description'
|
'description'
|
||||||
@@ -160,11 +171,11 @@ IPA.entity_factories.sudocmdgroup = function() {
|
|||||||
name: 'description'
|
name: 'description'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).
|
});
|
||||||
build();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.sudo = {};
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
IPA.sudorule_details_facet = function(spec) {
|
IPA.sudorule_details_facet = function(spec) {
|
||||||
|
|
||||||
@@ -1186,3 +1197,7 @@ IPA.sudo.rule_association_adder_dialog = function(spec) {
|
|||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.register('sudorule', IPA.sudo.rule_entity);
|
||||||
|
IPA.register('sudocmd', IPA.sudo.command_entity);
|
||||||
|
IPA.register('sudocmdgroup', IPA.sudo.command_group_entity);
|
||||||
|
|||||||
@@ -23,19 +23,20 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
||||||
|
|
||||||
|
IPA.user = {};
|
||||||
|
|
||||||
IPA.entity_factories.user = function() {
|
IPA.user.entity = function(spec) {
|
||||||
|
|
||||||
|
var that = IPA.entity(spec);
|
||||||
|
|
||||||
var link = true;
|
var link = true;
|
||||||
if (IPA.nav && IPA.nav.name == 'self-service') {
|
if (IPA.nav && IPA.nav.name == 'self-service') {
|
||||||
link = false;
|
link = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var builder = IPA.entity_builder();
|
that.init = function(params) {
|
||||||
|
|
||||||
builder.
|
params.builder.search_facet({
|
||||||
entity('user').
|
|
||||||
search_facet({
|
|
||||||
columns: [
|
columns: [
|
||||||
'uid',
|
'uid',
|
||||||
'givenname',
|
'givenname',
|
||||||
@@ -105,7 +106,8 @@ IPA.entity_factories.user = function() {
|
|||||||
{
|
{
|
||||||
name: 'misc',
|
name: 'misc',
|
||||||
fields: ['carlicense']
|
fields: ['carlicense']
|
||||||
}]}).
|
}]
|
||||||
|
}).
|
||||||
association_facet({
|
association_facet({
|
||||||
name: 'memberof_group',
|
name: 'memberof_group',
|
||||||
associator: IPA.serial_associator,
|
associator: IPA.serial_associator,
|
||||||
@@ -167,8 +169,9 @@ IPA.entity_factories.user = function() {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return builder.build();
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
IPA.user_adder_dialog = function(spec) {
|
IPA.user_adder_dialog = function(spec) {
|
||||||
@@ -461,3 +464,5 @@ IPA.user_password_widget = function(spec) {
|
|||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.register('user', IPA.user.entity);
|
||||||
|
|||||||
Reference in New Issue
Block a user