summaryrefslogtreecommitdiffstats
path: root/install/static/hostgroup.js
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2010-08-23 22:32:23 -0400
committerAdam Young <ayoung@redhat.com>2010-08-26 13:15:00 -0400
commit49584d6efc6a10fa0b76ce81b2638d424f2208a8 (patch)
tree08c87c7d7bd2ee0fef6e5045948a977a5c61cdc9 /install/static/hostgroup.js
parent02479babb9cd5fdd0673175fde22e40f3a1b10b4 (diff)
downloadfreeipa-49584d6efc6a10fa0b76ce81b2638d424f2208a8.tar.gz
freeipa-49584d6efc6a10fa0b76ce81b2638d424f2208a8.tar.xz
freeipa-49584d6efc6a10fa0b76ce81b2638d424f2208a8.zip
hashchange
We now catch the hashchange event and use that to drive most of the site. To trigger page transitions, modify location.hash. Params start with # not ?. Removed user-group.inc. converted tabs to spaces trivial imlementation of add and details for netgroup and hostgroup lots of bug fixes based on routing problems and the refactorings.
Diffstat (limited to 'install/static/hostgroup.js')
-rw-r--r--install/static/hostgroup.js57
1 files changed, 35 insertions, 22 deletions
diff --git a/install/static/hostgroup.js b/install/static/hostgroup.js
index 64eeb3afc..290460d81 100644
--- a/install/static/hostgroup.js
+++ b/install/static/hostgroup.js
@@ -1,35 +1,48 @@
function setupHostgroup(facet){
if (facet == "details"){
- setupHostgroupDetails();
+ hostgroupDetailsForm.setup();
+ }else if (facet == "add"){
+ hostgroupBuilder.setup();
}else{
- setupHostgroupSearch();
+ hostgroupSearchForm.setup();
}
}
-function setupHostgroupDetails(){
- var detailsForm = new DetailsForm();
-}
+var hostgroup_details_list =
+ [['identity', 'Hostgroup Details', [
+ ['cn', 'Hostgroup Name'],
+ ['description', 'Description']]]];
-function setupHostgroupSearch(){
+var hostgroupDetailsForm = new DetailsForm("hostgroup",hostgroup_details_list,"cn","sampledata/hostgroupshow.json") ;
- var columns = [
- {title:"Hostgroup",column:"cn",render: function(current,cell){
- renderDetailColumn(current,cell,current[this.column],"hostgroup");
- }},
- {title:"Description", column:"description",render: renderSimpleColumn}];
- var hostgroupSearchForm = new SearchForm("hostgroup", "find", columns);
- $("#query").unbind();
+function hostgroupAddOptionsFunction (){
+ var options = {
+ name: $('#pkey').val(),
+ description: $('#description').val()
+ };
+ return options;
+}
- $("#query").click(function(){
- sampleData = "sampledata/hostgrouplist.json";
- executeSearch(hostgroupSearchForm);
- });
- $("#new").unbind();
- $("#new").click( function() {
- alert("New Hostgroup...");
- });
+var hostgroupAddProperties =
+ [{title: 'Hostgroup Name', id: 'pkey', type: 'text'},
+ {title: 'Description', id: 'description', type: 'text'}];
-}
+var hostgroupBuilder = new EntityBuilder("hostgroup",hostgroupAddProperties,hostgroupAddOptionsFunction);
+
+
+var hostgroupSearchColumns = [
+ {
+ title:"Hostgroup",
+ column:"cn",
+ render: function(current,cell){
+ renderPkeyColumn(hostgroupDetailsForm, current,cell);
+ }
+ },
+ {title:"Description", column:"description",render: renderSimpleColumn}];
+
+var hostgroupSearchForm =
+ new SearchForm("hostgroup", "find", hostgroupSearchColumns,
+ "sampledata/hostgrouplist.json");