Files
freeipa/install/static/hostgroup.js
T
Adam Young dde1577270 associations
-Refactored the associations code into a set of objects that are configured by the entities
    -Added support for associations that can be done in a single rpc
    -hostgroup to host and group to user associations working

    -Restructed sampledata so that the file is matched automatically by the RPC method name
    -The new ipa_cmd/sampledata scheme insists on there being sample data for any commands or the ipa_command fails.
    -Added sampledata files for all the calls we make
    -renamed several of the sampledata files to match their rpc calls

    -Started a pattern of refactoring where all the  forms for the entity fall under a single object
2010-09-07 10:08:19 -04:00

83 lines
2.0 KiB
JavaScript

function setupHostgroup(facet){
hostgroupForms.setup(facet);
}
var hostgroup_details_list =
[['identity', 'Hostgroup Details', [
['cn', 'Hostgroup Name'],
['description', 'Description']]]];
var hostgroupFacets = ["details","hosts","assignhosts"];
function hostgroupAddOptionsFunction (){
var options = {
name: $('#pkey').val(),
description: $('#description').val()
};
return options;
}
var hostgroupForms = new HostgroupsForms();
function HostgroupsForms(){
this.setup = function(facet){
if (this[facet]){
this[facet].setup();
}else{
this.unspecified.setup();
}
}
/**
* used to initialize the search
*/
this.hostgroupSearchColumns = [
{
title:"Hostgroup",
column:"cn",
render: function(current,cell){
renderPkeyColumn2('hostgroup', 'cn', current,cell);
}
},
{title:"Description", column:"description",render: renderSimpleColumn}];
this.hostgroupAddProperties =
[{title: 'Hostgroup Name', id: 'pkey', type: 'text'},
{title: 'Description', id: 'description', type: 'text'}];
/**
Facets
*/
this.hostListColumns = [ {title:"Host",column:"member_host" }];
this.obj="hostgroup";
this.hosts = new AssociationList(
this.obj,
"hosts",
"assignhosts",
this.hostListColumns, hostgroupFacets );
this.assignhosts = new AssociationForm(
this.obj,
"host",
"assignhosts",
hostgroupFacets,
"fqdn",
function(){
return 'Add Hosts to to hostgroup : ' + qs['pkey'] ;
},
BulkAssociator);
this.details = new DetailsForm("hostgroup",hostgroup_details_list,"cn",hostgroupFacets) ;
this.add = new EntityBuilder("hostgroup",this.hostgroupAddProperties,hostgroupAddOptionsFunction);
this.search = new SearchForm("hostgroup", "find", this.hostgroupSearchColumns);
this.unspecified = this.search;
}