summaryrefslogtreecommitdiffstats
path: root/install/static/netgroup.js
blob: 5659fbd2192987be9b78ef5438dc5e9c2f891c70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function setupNetgroup(facet){
    if (facet == "details"){
        netgroupDetailsForm.setup();
    }else  if(facet == "add"){
        netgroupBuilder.setup();
    }else{
        netgroupSearchForm.setup();
    }
}


var netgroup_details_list =
    [['identity', 'Netgroup Details', [
        ['cn', 'Netgroup Name'],
        ['description', 'Description'],
        ['nisdomainname', 'NIS Domain']]]];


var netgroupDetailsForm = new DetailsForm("netgroup",netgroup_details_list,"cn","sampledata/netgroupshow.json") ;


var netgroupAddProperties =
    [{title: 'Netgroup Name', id: 'pkey', type: 'text'},
     {title: 'Description', id: 'description', type: 'text'}];


function netgroupAddOptionsFunction (){
    var options = {
        name: $('#pkey').val(),
        description: $('#description').val()
    };
    return options;
}


var netgroupBuilder = new EntityBuilder("netgroup",netgroupAddProperties,netgroupAddOptionsFunction);


var netgroupSearchColumns = [
    {title:"Netgroup",column:"cn",render:  function(current,cell){
        renderPkeyColumn(netgroupDetailsForm, current,cell);
    }},
    {title:"Description", column:"description",render: renderSimpleColumn}];

var netgroupSearchForm =
    new SearchForm("netgroup", "find", netgroupSearchColumns,"sampledata/netgrouplist.json");