mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Netgroup associations
netgroup->user,group,host,hostgroup
-- Added facets to netgroup
-- added links into lists for associations
This commit is contained in:
@@ -218,8 +218,15 @@ function AssociationList(obj,facet,assignFacet,associationColumns,facets) {
|
||||
var row = $("<tr/>").appendTo($('#searchResultsTable thead:last'));
|
||||
for (var k = 0; k < associationColumns.length ;k++){
|
||||
var column = this.associationColumns[k].column;
|
||||
var link =
|
||||
"#tab="+this.associationColumns[k].title
|
||||
+"&facet=details"
|
||||
+"&pkey="+userData.result.result[column][j];
|
||||
$("<td/>",{
|
||||
html: userData.result.result[column][j]
|
||||
html: $("<a />",{
|
||||
href:link,
|
||||
html:userData.result.result[column][j]
|
||||
})
|
||||
}).appendTo(row);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ function HostgroupsForms(){
|
||||
/**
|
||||
Facets
|
||||
*/
|
||||
this.hostListColumns = [ {title:"Host",column:"member_host" }];
|
||||
this.hostListColumns = [ {title:"host",column:"member_host" }];
|
||||
this.obj="hostgroup";
|
||||
this.hosts = new AssociationList(
|
||||
this.obj,
|
||||
|
||||
@@ -1,29 +1,7 @@
|
||||
function setupNetgroup(facet){
|
||||
if (facet == "details"){
|
||||
netgroupDetailsForm.setup();
|
||||
}else if(facet == "add"){
|
||||
netgroupBuilder.setup();
|
||||
}else{
|
||||
netgroupSearchForm.setup();
|
||||
}
|
||||
netgroupForms.setup(facet);
|
||||
}
|
||||
|
||||
|
||||
var netgroup_details_list =
|
||||
[['identity', 'Netgroup Details', [
|
||||
['cn', 'Netgroup Name'],
|
||||
['description', 'Description'],
|
||||
['nisdomainname', 'NIS Domain']]]];
|
||||
|
||||
|
||||
var netgroupDetailsForm = new DetailsForm("netgroup",netgroup_details_list,"cn", ["details","hosts","groups","users"]) ;
|
||||
|
||||
|
||||
var netgroupAddProperties =
|
||||
[{title: 'Netgroup Name', id: 'pkey', type: 'text'},
|
||||
{title: 'Description', id: 'description', type: 'text'}];
|
||||
|
||||
|
||||
function netgroupAddOptionsFunction (){
|
||||
var options = {
|
||||
name: $('#pkey').val(),
|
||||
@@ -32,14 +10,98 @@ function netgroupAddOptionsFunction (){
|
||||
return options;
|
||||
}
|
||||
|
||||
var netgroupBuilder = new EntityBuilder("netgroup",netgroupAddProperties,netgroupAddOptionsFunction);
|
||||
var netgroupForms = new NetgroupForms();
|
||||
|
||||
function NetgroupForms(){
|
||||
this.obj='netgroup';
|
||||
this.pkeycol = 'cn';
|
||||
this.facets = ["details","users","assignusers","groups","assigngroups","hosts","assignhosts","hostgroups","assignhostgroups"];
|
||||
|
||||
this.netgroupSearchColumns = [
|
||||
{title:"Netgroup",column:"cn",render: function(current,cell){
|
||||
renderPkeyColumn2('netgroup', 'cn', current,cell);
|
||||
}},
|
||||
{title:"Description", column:"description",render: renderSimpleColumn}];
|
||||
|
||||
|
||||
var netgroupSearchColumns = [
|
||||
{title:"Netgroup",column:"cn",render: function(current,cell){
|
||||
renderPkeyColumn(netgroupDetailsForm, current,cell);
|
||||
}},
|
||||
{title:"Description", column:"description",render: renderSimpleColumn}];
|
||||
this.details_list =
|
||||
[['identity', 'Netgroup Details', [
|
||||
['cn', 'Netgroup Name'],
|
||||
['description', 'Description'],
|
||||
['nisdomainname', 'NIS Domain']]]];
|
||||
|
||||
var netgroupSearchForm =
|
||||
new SearchForm("netgroup", "find", netgroupSearchColumns);
|
||||
this.details = new DetailsForm(this.obj,this.details_list,this.pkeycol,
|
||||
this.facets) ;
|
||||
|
||||
|
||||
|
||||
this.add_properties =
|
||||
[{title: 'Netgroup Name', id: 'pkey', type: 'text'},
|
||||
{title: 'Description', id: 'description', type: 'text'}];
|
||||
|
||||
this.add = new EntityBuilder("netgroup",this.add_properties,
|
||||
netgroupAddOptionsFunction);
|
||||
this.search = new SearchForm("netgroup", "find", this.netgroupSearchColumns);
|
||||
|
||||
this.userListColumns = [ {title:"user",column:"memberuser_user", }];
|
||||
this.users = new AssociationList(
|
||||
this.obj, "users", "assignusers", this.userListColumns, this.facets );
|
||||
|
||||
this.assignusers = new AssociationForm(
|
||||
this.obj, "user", "assignuser", this.facets, "uid",
|
||||
function(){
|
||||
return 'Add Hosts to to netgroup : ' + qs['pkey'] ;
|
||||
},
|
||||
BulkAssociator);
|
||||
|
||||
|
||||
this.groupListColumns = [ {title:"group",column:"memberuser_group", }];
|
||||
this.groups = new AssociationList(
|
||||
this.obj, "groups", "assigngroups", this.groupListColumns, this.facets );
|
||||
|
||||
this.assigngroups = new AssociationForm(
|
||||
this.obj, "group", "assigngroup", this.facets, "cn",
|
||||
function(){
|
||||
return 'Add Hosts to to netgroup : ' + qs['pkey'] ;
|
||||
},
|
||||
BulkAssociator);
|
||||
|
||||
|
||||
|
||||
this.hostListColumns = [ {title:"host",column:"memberhost_host", }];
|
||||
|
||||
this.hosts = new AssociationList(
|
||||
this.obj, "hosts", "assignhosts", this.hostListColumns, this.facets );
|
||||
|
||||
this.assignhosts = new AssociationForm(
|
||||
this.obj, "host", "assignhosts", this.facets, "fqdn",
|
||||
function(){
|
||||
return 'Add Hosts to to netgroup : ' + qs['pkey'] ;
|
||||
},
|
||||
BulkAssociator);
|
||||
|
||||
|
||||
this.hostgroupListColumns = [ {title:"hostgroup",column:"memberhost_hostgroup", }];
|
||||
|
||||
this.hostgroups = new AssociationList(
|
||||
this.obj, "hostgroups", "assignhostgroups", this.hostgroupListColumns, this.facets );
|
||||
|
||||
this.assignhostgroups = new AssociationForm(
|
||||
this.obj, "hostgroup", "assignhostgroups", this.facets, "cn",
|
||||
function(){
|
||||
return 'Add Hostgroups to to netgroup : ' + qs['pkey'] ;
|
||||
},
|
||||
BulkAssociator);
|
||||
|
||||
|
||||
|
||||
this.unspecified = this.search;
|
||||
this.setup = function(facet){
|
||||
if (this[facet]){
|
||||
this[facet].setup();
|
||||
}else{
|
||||
this.unspecified.setup();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
40
install/static/sampledata/netgroup_add_member.json
Normal file
40
install/static/sampledata/netgroup_add_member.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"error": null,
|
||||
"id": 0,
|
||||
"result": {
|
||||
"completed": 3,
|
||||
"failed": {
|
||||
"memberhost": {
|
||||
"host": [],
|
||||
"hostgroup": []
|
||||
},
|
||||
"memberuser": {
|
||||
"group": [],
|
||||
"user": []
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"cn": [
|
||||
"net-live"
|
||||
],
|
||||
"description": [
|
||||
"live servers"
|
||||
],
|
||||
"dn": "ipauniqueid=2e08b2c2-baac-11df-a0cf-525400674dcd,cn=ng,cn=alt,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
|
||||
"memberhost_host": [
|
||||
"live3.pbs.org",
|
||||
"live2.pbs.org",
|
||||
"live1.pbs.org"
|
||||
],
|
||||
"memberhost_hostgroup": [
|
||||
"host-live"
|
||||
],
|
||||
"memberuser_group": [
|
||||
"muppets"
|
||||
],
|
||||
"nisdomainname": [
|
||||
"ayoung.boston.devel.redhat.com"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,25 @@
|
||||
"description": [
|
||||
"live servers"
|
||||
],
|
||||
"dn": "ipauniqueid=51451097-abef-11df-ad3a-525400674dcd,cn=ng,cn=alt,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
|
||||
"dn": "ipauniqueid=2e08b2c2-baac-11df-a0cf-525400674dcd,cn=ng,cn=alt,dc=ayoung,dc=boston,dc=devel,dc=redhat,dc=com",
|
||||
"memberhost_host": [
|
||||
"live3.pbs.org",
|
||||
"live2.pbs.org",
|
||||
"live1.pbs.org",
|
||||
"www1.pbs.org",
|
||||
"www2.pbs.org",
|
||||
"www3.pbs.org"
|
||||
],
|
||||
"memberhost_hostgroup": [
|
||||
"host-live"
|
||||
],
|
||||
"memberuser_group": [
|
||||
"muppets"
|
||||
],
|
||||
"memberuser_user": [
|
||||
"kfrog",
|
||||
"count123"
|
||||
],
|
||||
"nisdomainname": [
|
||||
"ayoung.boston.devel.redhat.com"
|
||||
]
|
||||
|
||||
@@ -190,7 +190,7 @@ var userGroupMembershipForm = new AssociationForm("user","group","groupmembershi
|
||||
|
||||
/*Group Membership*/
|
||||
var groupMembershipColumns = [
|
||||
{title:"Group", column:"memberof_group"},
|
||||
{title:"group", column:"memberof_group"},
|
||||
];
|
||||
|
||||
function populateUserEnrollments(userData){
|
||||
|
||||
Reference in New Issue
Block a user