From 49584d6efc6a10fa0b76ce81b2638d424f2208a8 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Mon, 23 Aug 2010 22:32:23 -0400 Subject: 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. --- install/static/host.js | 50 ++++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) (limited to 'install/static/host.js') diff --git a/install/static/host.js b/install/static/host.js index b6881d83..b249c9b5 100644 --- a/install/static/host.js +++ b/install/static/host.js @@ -1,38 +1,32 @@ function setupHost(facet){ if (facet == "details"){ - setupHostDetails(); + hostDetailsForm.setup(); + }else if (facet == "add"){ + hostBuilder.setup(); }else{ - setupHostSearch(); + hostSearchForm.setup(); } } -function setupHostDetails(){ - var detailsForm = new DetailsForm(); -} - -function setupHostSearch(){ +var hostAddProperties = [{title: 'Domain Name', id: 'pkey', type: 'text'}]; +var hostBuilder = new EntityBuilder("host",hostAddProperties); - sampleData = "sampledata/hostlist.json"; - var columns = [ - {title:"Host",column:"fqdn",render: function(current,cell){ - renderDetailColumn(current,cell,current[this.column],"group"); - }}, - {title:"Comment", column: "description", render: renderSimpleColumn}, - {title:"Enrolled?", render: renderUnknownColumn}, - {title:"Manages?", render: renderUnknownColumn} - ]; - var hostSearchForm = new SearchForm("host", "find", columns); +var host_details_list = [['host', 'Host Details', [ + ['fqdn', 'Fully Qualified Domain Name'], + ['krbprincipalname', 'Kerberos Principal'], + ['serverhostname', 'Server Host Name'] +]]]; + +var hostDetailsForm = new DetailsForm("host",host_details_list,"fqdn","sampledata/hostshow.json") ; - $("#query").unbind(); - $("#query").click(function(){ - sampleData = "sampledata/hostlist.json"; - executeSearch(hostSearchForm); - }); - $("#new").unbind(); - $("#new").click( function() { - alert("New Host..."); - }); - -} +var hostDetailsColumns = [ + {title:"Host",column:"fqdn",render: function(current,cell){ + renderPkeyColumn(hostDetailsForm,current,cell); + }}, + {title:"Comment", column: "description", render: renderSimpleColumn}, + {title:"Enrolled?", render: renderUnknownColumn}, + {title:"Manages?", render: renderUnknownColumn} +]; +var hostSearchForm = new SearchForm("host", "find", hostDetailsColumns,"sampledata/hostlist.json"); -- cgit