summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2010-08-19 22:39:40 -0400
committerAdam Young <ayoung@redhat.com>2010-08-19 22:39:40 -0400
commit37d302d6830ee73d6dada132210711d7c0c3b8be (patch)
tree38488f42ab7ae5a8cb503a5f6b912b36f589c61b /install
parent12ee9365a7a08c7a45887b98f17a44c64d7eb5f0 (diff)
downloadfreeipa-37d302d6830ee73d6dada132210711d7c0c3b8be.tar.gz
freeipa-37d302d6830ee73d6dada132210711d7c0c3b8be.tar.xz
freeipa-37d302d6830ee73d6dada132210711d7c0c3b8be.zip
Started pulling the details functionality into the details form object. DOing this in hosts for now to avoid conflicts on details.js
Diffstat (limited to 'install')
-rw-r--r--install/static/host.js53
1 files changed, 45 insertions, 8 deletions
diff --git a/install/static/host.js b/install/static/host.js
index b6881d836..3ea609b13 100644
--- a/install/static/host.js
+++ b/install/static/host.js
@@ -6,27 +6,65 @@ function setupHost(facet){
}
}
-function setupHostDetails(){
- var detailsForm = new DetailsForm();
+function setupHostDetails(host){
+ hostDetailsForm.setup(host);
}
-function setupHostSearch(){
- sampleData = "sampledata/hostlist.json";
+var host_details_list =
+ [['identity', 'Host Details', [
+ ['fqdn', 'Fully Qualified Domain Name'],
+ ['"krbprincipalname', 'Kerberos Principal'],
+ ['serverhostname', 'Host Name']]]];
+
+
+function DetailsForm(obj, details_list, pkeyCol, sampleData ){
+
+ this.obj = obj;
+ this.details_list = details_list;
+ this.sampleData = sampleData;
+ this.pkeyCol = pkeyCol;
+
+ this.setup= function(key){
+ window.location.hash="#tab="+this.obj+"user&facet=details&pkey="+key;
+
+ //re initialize global parse of parameters
+ qs = ipa_parse_qs();
+
+ showDetails();
+ $('h1').text(":RESET:key");
+
+ ipa_details_init(this.obj);
+ ipa_details_create(this.details_list, $('#details'));
+ ipa_details_load(key, on_win, null, this.sampleData);
+ }
+
+}
+
+var hostDetailsForm = new DetailsForm("host",host_details_list,"fqdn","sampledata/hostgroup.json") ;
+
+function renderDetailColumn(form,current,cell){
+ $("<a/>",{
+ href:"#tab="+this.obj+"&facet=details&pkey="+current.fqdn,
+ html: "" +current[form.pkeyCol],
+ click: function(){ form.setup(current[form.pkeyCol])},
+ }).appendTo(cell);
+}
+
+function setupHostSearch(){
var columns = [
{title:"Host",column:"fqdn",render: function(current,cell){
- renderDetailColumn(current,cell,current[this.column],"group");
+ renderDetailColumn(hostDetailsForm, current,cell);
}},
{title:"Comment", column: "description", render: renderSimpleColumn},
{title:"Enrolled?", render: renderUnknownColumn},
{title:"Manages?", render: renderUnknownColumn}
];
- var hostSearchForm = new SearchForm("host", "find", columns);
+ var hostSearchForm = new SearchForm("host", "find", columns, "sampledata/hostlist.json");
$("#query").unbind();
$("#query").click(function(){
- sampleData = "sampledata/hostlist.json";
executeSearch(hostSearchForm);
});
@@ -34,5 +72,4 @@ function setupHostSearch(){
$("#new").click( function() {
alert("New Host...");
});
-
}