From 739e5e5e5dc68e5e128792447f8195beeff68c77 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Tue, 5 Aug 2008 09:31:50 +0000 Subject: Minor changes, converted some of the buttons to links, added a link to expand/collapse the 'Add' section at the bottom of the widgets. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@682646 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/resources/cloud-gadget.html | 61 ++++++++++++++++------ 1 file changed, 44 insertions(+), 17 deletions(-) (limited to 'java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html') diff --git a/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html b/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html index dc8aa672b8..619df54ede 100644 --- a/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html +++ b/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html @@ -32,14 +32,14 @@

- - + >Add +  Delete    - + Start +  Stop
-

- + @@ -71,9 +72,20 @@ var processCollection = new Reference("processCollection"); var gadget = gadget(window, document); + if (gadget.showStatus == null) { + gadget.showStatus = true; + } + if (gadget.showConfigurations == null) { + gadget.showConfigurations = true; + } - var newNodeForm = elementByID(gadget, 'newNodeForm'); + var cloudCompositeForm = elementByID(gadget, 'cloudCompositeForm'); var compositesElement = elementByID(gadget, 'composites'); + var newNodeElement = elementByID(gadget, 'newNode'); + var newNodeForm = elementByID(gadget, 'newNodeForm'); + + var nodeNames; + var deployedComposites = new Array(); function getNodes() { cloudComposite.get("", getNodesResponse); @@ -95,8 +107,6 @@ return name.substring(i + 1); } - var nodeNames; - function getNodesResponse(feed) { nodeNames = new Array(); if (feed != null) { @@ -111,7 +121,7 @@ composites += 'Composite'; } if (gadget.showContributions) { - composites += 'Contribution'; + composites += 'Contribution'; } if (gadget.showConfigurations) { composites += 'Node Config'; @@ -210,13 +220,14 @@ } function deleteNode() { - var composites = array(gadget.cloudCompositeForm.composites); + var composites = array(cloudCompositeForm.composites); for (var i = 0; i < composites.length; i++) { if (composites[i].checked) { var id = composites[i].value; cloudComposite.del(id, deleteNodeResponse); } } + return false; } function deleteNodeResponse() { @@ -268,7 +279,7 @@ } function startNode() { - var composites = array(gadget.cloudCompositeForm.composites); + var composites = array(cloudCompositeForm.composites); for (var i = 0; i < composites.length; i++) { if (composites[i].checked) { var id = nodeNames[i]; @@ -279,12 +290,13 @@ processCollection.post(entry, startNodeResponse); } } + return false; } function startNodeResponse() { processCollection.get("", getProcessesResponse); - var composites = array(gadget.cloudCompositeForm.composites); + var composites = array(cloudCompositeForm.composites); for (var i = 0; i < composites.length; i++) { if (composites[i].checked) { composites[i].checked = false; @@ -293,19 +305,20 @@ } function stopNode() { - var composites = array(gadget.cloudCompositeForm.composites); + var composites = array(cloudCompositeForm.composites); for (var i = 0; i < composites.length; i++) { if (composites[i].checked) { var id = nodeNames[i]; processCollection.del(id, stopNodeResponse); } } + return false; } function stopNodeResponse() { processCollection.get("", getProcessesResponse); - var composites = array(gadget.cloudCompositeForm.composites); + var composites = array(cloudCompositeForm.composites); for (var i = 0; i < composites.length; i++) { if (composites[i].checked) { composites[i].checked = false; @@ -313,8 +326,6 @@ } } - var deployedComposites = new Array(); - function getComposites() { domainComposite.get("", getCompositesResponse); } @@ -371,6 +382,22 @@ return array(uris); } + function toggleNewNode() { + var visibility = newNodeElement.style.visibility; + if (visibility == 'hidden') { + newNodeElement.style.visibility = 'visible'; + } else { + newNodeElement.style.visibility = 'hidden'; + } + return false; + } + + elementByID(gadget, 'deleteNodeLink').onclick = deleteNode; + elementByID(gadget, 'addNodeLink').onclick = toggleNewNode; + elementByID(gadget, 'startNodeLink').onclick = startNode; + elementByID(gadget, 'stopNodeLink').onclick = stopNode; + elementByID(gadget, 'addNodeButton').onclick = addNode; + getNodes(); getComposites(); suggest(newNodeForm.compositeNamespace, suggestCompositeNamespaces); -- cgit v1.2.3