summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2010-07-15 22:22:18 -0400
committerAdam Young <ayoung@redhat.com>2010-07-15 22:22:18 -0400
commitf06d54a1005588825899d227a9d9a0b3f055b0ed (patch)
tree434f47f46f5a5a44391b05d0f50e7cc968f2c450
parent6bf4d2e4fa8a9a23f50b0c6a35373fa5b3e300cb (diff)
downloadfreeipa-f06d54a1005588825899d227a9d9a0b3f055b0ed.tar.gz
freeipa-f06d54a1005588825899d227a9d9a0b3f055b0ed.tar.xz
freeipa-f06d54a1005588825899d227a9d9a0b3f055b0ed.zip
Starting point for netgroups and hostgroups.
-rw-r--r--install/static/hostgroup.js63
-rw-r--r--install/static/index.xhtml2
-rw-r--r--install/static/navigation.js6
-rw-r--r--install/static/netgroup.js63
4 files changed, 132 insertions, 2 deletions
diff --git a/install/static/hostgroup.js b/install/static/hostgroup.js
new file mode 100644
index 000000000..4b546608a
--- /dev/null
+++ b/install/static/hostgroup.js
@@ -0,0 +1,63 @@
+function setupHostgroup(facet){
+ if (facet == "details"){
+ setupHostgroupDetails();
+ }else{
+ setupHostgroupSearch();
+ }
+}
+
+
+
+
+function setupHostgroupDetails(){
+ var detailsForm = new DetailsForm();
+}
+
+
+function setupHostgroupSearch(){
+
+ sampleData = "sampledata/hostgrouplist.json";
+
+ function renderHostgroupRow(hostgroup){
+ var row = document.createElement("tr");
+ var cell;
+
+ cell = row.insertCell(-1);
+ link = document.createElement("a");
+ link.href= "?tab=hostgroups&facet=details"
+ link.innerHTML = hostgroup.fqdn;
+ cell.appendChild(link);
+
+ cell = row.insertCell(1);
+ link = document.createElement("a");
+ link.href= "?tab=hostgroups&facet=details"
+ link.innerHTML = hostgroup.description;
+ cell.appendChild(link);
+
+ cell = row.insertCell(-1);
+ link = document.createElement("a");
+ link.href= "#"
+ link.innerHTML = "Delete";
+ cell.appendChild(link);
+
+ return row;
+ }
+
+ var columns
+ = [["Hostgroup","fqdn"],
+ ["Description", "description" ]];
+
+
+ var searchForm = new SearchForm("hostgroup_find", columns,'?tab=hostgroup', renderHostgroupRow);
+
+ $("#query").click(function(){
+ executeSearch(searchForm);
+ });
+ $("#new").click( function() {
+ alert("New Hostgroup...");
+ });
+
+
+}
+
+ \ No newline at end of file
diff --git a/install/static/index.xhtml b/install/static/index.xhtml
index e4d7ae2e4..49bade43a 100644
--- a/install/static/index.xhtml
+++ b/install/static/index.xhtml
@@ -24,6 +24,8 @@
<script type="text/javascript" src="user.js" />
<script type="text/javascript" src="group.js" />
<script type="text/javascript" src="host.js" />
+ <script type="text/javascript" src="hostgroup.js" />
+ <script type="text/javascript" src="netgroup.js" />
<script type="text/javascript">
$(document).ready(function(){
diff --git a/install/static/navigation.js b/install/static/navigation.js
index d57e2b66c..a3c528fef 100644
--- a/install/static/navigation.js
+++ b/install/static/navigation.js
@@ -20,8 +20,10 @@ function buildNavigation(){
{name:"Users",tab:"users", setup: setupUser},
{name:"Groups",tab:"groups",setup: setupGroup},
{name:"Hosts",tab:"hosts", setup: setupHost},
- {name:"Hostgroups",tab:"hostgroups"},
- {name:"Netgroups",tab:"netgroups"}
+ {name:"Hostgroups",
+ tab:"hostgroups",
+ setup: setupHostgroup},
+ {name:"Netgroups",tab:"netgroups",setup: setupNetgroup}
]},
{name:"POLICY", tab:"policy"},
diff --git a/install/static/netgroup.js b/install/static/netgroup.js
new file mode 100644
index 000000000..ede918e0b
--- /dev/null
+++ b/install/static/netgroup.js
@@ -0,0 +1,63 @@
+function setupNetgroup(facet){
+ if (facet == "details"){
+ setupNetgroupDetails();
+ }else{
+ setupNetgroupSearch();
+ }
+}
+
+
+
+
+function setupNetgroupDetails(){
+ var detailsForm = new DetailsForm();
+}
+
+
+function setupNetgroupSearch(){
+
+ sampleData = "sampledata/netgrouplist.json";
+
+ function renderNetgroupRow(netgroup){
+ var row = document.createElement("tr");
+ var cell;
+
+ cell = row.insertCell(-1);
+ link = document.createElement("a");
+ link.href= "?tab=netgroups&facet=details"
+ link.innerHTML = netgroup.fqdn;
+ cell.appendChild(link);
+
+ cell = row.insertCell(1);
+ link = document.createElement("a");
+ link.href= "?tab=netgroups&facet=details"
+ link.innerHTML = netgroup.description;
+ cell.appendChild(link);
+
+ cell = row.insertCell(-1);
+ link = document.createElement("a");
+ link.href= "#"
+ link.innerHTML = "Delete";
+ cell.appendChild(link);
+
+ return row;
+ }
+
+ var columns
+ = [["Netgroup","fqdn"],
+ ["Description", "description" ]];
+
+
+ var searchForm = new SearchForm("netgroup_find", columns,'?tab=netgroup', renderNetgroupRow);
+
+ $("#query").click(function(){
+ executeSearch(searchForm);
+ });
+ $("#new").click( function() {
+ alert("New Netgroup...");
+ });
+
+
+}
+
+ \ No newline at end of file