cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] conga/luci/cluster form-macros resource-form-m ...
@ 2006-09-22 21:59 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2006-09-22 21:59 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-09-22 21:59:03

Modified files:
	luci/cluster   : form-macros resource-form-macros 
	                 resource_form_handlers.js 

Log message:
	more javascript ugliness

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.10&r2=1.11

--- conga/luci/cluster/form-macros	2006/09/22 20:58:59	1.64
+++ conga/luci/cluster/form-macros	2006/09/22 21:59:03	1.65
@@ -1182,7 +1182,7 @@
 		<tal:block metal:use-macro="here/resource-form-macros/macros/service-compose-macro" /> 
 	</div>
 
-	<h2 onclick="forms_to_xml()">Service Composition</h2>
+	<h2>Service Composition</h2>
 
 	<div class="service_comp_list" tal:attributes="id sinfo/root_uuid">
 
@@ -1235,10 +1235,13 @@
 			tal:condition="python: 'indent_ctr' in res and 'max_depth' in res"
 			tal:replace="structure python: '</div>' * (res['indent_ctr'] - res['max_depth'])" />
 	</div>
-	</div>
 	<form name="master">
+		<input type="button" class="hbSubmit"
+			value="Save changes"
+			onClick="forms_to_xml()" />
 		<input type="hidden" name="form_xml" />
 	</form>
+	</div>
 
 	<div class="invisible" id="global_resources_block">
 		<tal:block tal:repeat="gr global_resources">
--- conga/luci/cluster/resource-form-macros	2006/09/22 19:21:41	1.14
+++ conga/luci/cluster/resource-form-macros	2006/09/22 21:59:03	1.15
@@ -320,6 +320,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -403,6 +406,9 @@
 		
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -554,6 +560,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -673,6 +682,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -805,6 +817,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -886,6 +901,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -948,6 +966,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
@@ -1021,6 +1042,9 @@
 
 	<input name="pagetype" type="hidden" value="35" />
 
+	<input name="global" type="hidden"
+		tal:attributes="value resourceIsRef | nothing" />
+
 	<input name="parent_uuid" type="hidden"
 		tal:attributes="value res/parent_uuid | nothing" />
 
--- conga/luci/cluster/resource_form_handlers.js	2006/09/22 19:21:41	1.10
+++ conga/luci/cluster/resource_form_handlers.js	2006/09/22 21:59:03	1.11
@@ -8,7 +8,6 @@
 	if (!res || !replace)
 		return (-1);
 	var new_uuid = update_resource_form_uuid(res, form.parent_uuid.value, form.tree_level.value, form.uuid.value);
-	res.id = new_uuid;
 
 	var sopt = document.getElementById('gres_chooser');
 	if (sopt)
@@ -193,19 +192,44 @@
 }
 
 function delete_resource(form) {
-	/* XXX - remove names from used list, replace global resources */
 	if (!confirm('Are you sure you want to delete this resource?'))
 		return (-1);
 	var div = document.getElementById(form.uuid.value);
 	if (!div)
 		return (-1);
 	var pdiv = document.getElementById(form.parent_uuid.value);
-	div.parentNode.removeChild(div);
 	var pelem = pdiv.getElementsByTagName('p');
 	for (var i = 0 ; i < pelem.length ; i++) {
 		if (pelem[i].className.match(/expander/))
 			pelem[i].className += ' invisible';
 	}
+	div.parentNode.removeChild(div);
+
+	var globalres = document.getElementById('global_resources_block');
+	if (!globalres)
+		return (0);
+
+	var replace = new Object();
+	var f = div.getElementsByTagName('FORM');
+	for (var i = 0 ; i < f.length ; i++) {
+		if (!f[i].global || !f[i].global.value)
+			continue;
+		replace[f[i].parentNode.id] = f[i].parentNode;
+		if (f[i].parentNode.parentNode)
+			f[i].parentNode.parentNode.removeChild(f[i].parentNode);
+	}
+
+	var sopt = document.getElementById('gres_chooser');
+	if (!sopt)
+		return (-1);
+	sopt = sopt.options;
+	for (var i = 0 ; i < sopt.length ; i++) {
+		if (replace[sopt[i].value]) {
+			globalres.appendChild(replace[sopt[i].value]);
+			sopt[i].className = null;
+		}
+	}
+	return (0);
 }
 
 function update_resource_form_uuid(node, parent_uuid, indent_level, uuid) {



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Cluster-devel] conga/luci/cluster form-macros resource-form-m ...
@ 2006-10-02 20:21 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2006-10-02 20:21 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-10-02 20:21:47

Modified files:
	luci/cluster   : form-macros resource-form-macros 
	                 resource_form_handlers.js 

Log message:
	cleanup resources and services and fix some other bugs

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.74&r2=1.75
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.16&r2=1.17

--- conga/luci/cluster/form-macros	2006/09/28 20:20:12	1.74
+++ conga/luci/cluster/form-macros	2006/10/02 20:21:47	1.75
@@ -129,9 +129,11 @@
 
 
 <div metal:define-macro="clusteradd-form">
-	<script type="text/javascript" src="/luci/homebase/homebase_common.js">
+	<script type="text/javascript"
+		src="/luci/homebase/homebase_common.js">
 	</script>
-	<script type="text/javascript" src="/luci/homebase/validate_cluster_add.js">
+	<script type="text/javascript"
+		src="/luci/homebase/validate_cluster_add.js">
 	</script>
 
 	<tal:block tal:omit-tag=""
@@ -326,8 +328,12 @@
 	</ul>
 
 	<div id="configTabContent" tal:condition="python: configTabNum == 1">
-		<script type="text/javascript" src="/luci/homebase/homebase_common.js"></script>
-		<script type="text/javascript" src="/luci/cluster/validate_config_general.js"></script>
+		<script type="text/javascript"
+			src="/luci/homebase/homebase_common.js">
+		</script>
+		<script type="text/javascript"
+			src="/luci/cluster/validate_config_general.js">
+		</script>
 
 		<form name="basecluster" action="" method="post">
 			<input type="hidden" name="pagetype"
@@ -380,9 +386,11 @@
 			<input type="hidden" name="pagetype"
 				tal:attributes="value request/pagetype | request/form/pagetype"
 			/>
-		<script type="text/javascript" src="/luci/homebase/homebase_common.js">
+		<script type="text/javascript"
+			src="/luci/homebase/homebase_common.js">
 		</script>
-		<script type="text/javascript" src="/luci/cluster/validate_config_fence.js">
+		<script type="text/javascript"
+			src="/luci/cluster/validate_config_fence.js">
 		</script>
 
 		<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
@@ -426,9 +434,11 @@
 	</div>
 
 	<div id="configTabContent" tal:condition="python: configTabNum == 3">
-		<script type="text/javascript" src="/luci/homebase/homebase_common.js">
+		<script type="text/javascript"
+			src="/luci/homebase/homebase_common.js">
 		</script>
-		<script type="text/javascript" src="/luci/cluster/validate_config_multicast.js">
+		<script type="text/javascript"
+			src="/luci/cluster/validate_config_multicast.js">
 		</script>
 
 		<form name="multicast" action="" method="post">
@@ -491,8 +501,12 @@
 	</div>
 
 	<div id="configTabContent" tal:condition="python: configTabNum == 4">
-	<script type="text/javascript" src="/luci/homebase/homebase_common.js"></script>
-	<script type="text/javascript" src="/luci/cluster/validate_config_qdisk.js"></script>
+	<script type="text/javascript"
+		src="/luci/homebase/homebase_common.js">
+	</script>
+	<script type="text/javascript"
+		src="/luci/cluster/validate_config_qdisk.js">
+	</script>
 		<form name="quorum_partition" action="" method="post">
 			<input type="hidden" name="pagetype"
 				tal:attributes="value request/pagetype | request/form/pagetype"
@@ -702,9 +716,9 @@
 				onClick="validate_form(this.form);"
 			>
 		</div>
-			<script tal:condition="python: clusterinfo['is_quorumd'] != 'True'">
-				disableChildrenInput('quorumdisk');
-			</script>
+		<script tal:condition="python: clusterinfo['is_quorumd'] != 'True'">
+			disableChildrenInput('quorumdisk');
+		</script>
 		</form>
 	</div>
 </div>
@@ -1179,10 +1193,12 @@
 </div>
 
 <div metal:define-macro="nodeadd-form">
-	<script type="text/javascript" src="/luci/homebase/homebase_common.js">
+	<script type="text/javascript"
+		src="/luci/homebase/homebase_common.js">
 	</script>
 
-	<script type="text/javascript" src="/luci/homebase/validate_cluster_add.js">
+	<script type="text/javascript"
+		src="/luci/homebase/validate_cluster_add.js">
 	</script>
 
 	<input type="hidden" name="clusterName"
@@ -1348,11 +1364,18 @@
 	</div>
 
 	<div class="service_comp_list">
-		<form name="master">
+		<form name="master" method="post">
+		<tal:block
+			tal:define="global clusterinfo python: here.getClusterInfo(modelb, request)" />
 		<input type="button" value="Add a resource to this service"
 			onclick="add_child_resource(this.form);" />
+		<input type="hidden" name="pagetype"
+			tal:attributes="
+				value request/pagetype | request/form/pagetype | nothing" />
+		<input type="hidden" name="clustername"
+			tal:attributes="value clusterinfo/clustername" />
 		<input type="button" value="Submit"
-			onClick="forms_to_xml()" />
+			onClick="forms_to_xml(this.form)" />
 		<input type="hidden" name="uuid" value="toplevel" />
 		<input type="hidden" name="parent_uuid" value="_toplevel" />
 		<input type="hidden" name="tree_level" value="-1" />
@@ -1425,6 +1448,7 @@
 	<script type="text/javascript"
 		src="/luci/cluster/resource_form_handlers.js">
 	</script>
+
 	<tal:block tal:define="
 		global ricci_agent python: here.getRicciAgentForCluster(request);
 		global global_resources python: here.getResourcesInfo(modelb, request);
@@ -1447,7 +1471,7 @@
 			<td class="cluster service service_name">
 				<strong class="service_name">Service Name:</strong>
 				<span
-					tal:content="sinfo/name"
+					tal:content="sinfo/name | nothing"
 					tal:attributes="class python: running and 'running' or 'stopped'" />
 			</td>
 			<td class="cluster service service_action">
@@ -1515,11 +1539,18 @@
 		</div>
 	</div>
 	<div class="service_comp_list">
-		<form name="master">
+		<form name="master" method="post">
+		<tal:block
+			tal:define="global clusterinfo python: here.getClusterInfo(modelb, request)" />
+		<input type="hidden" name="pagetype"
+			tal:attributes="
+				value request/pagetype | request/form/pagetype | nothing" />
+		<input type="hidden" name="clustername"
+			tal:attributes="value clusterinfo/clustername" />
 		<input type="button" value="Add a resource to this service"
 			onclick="add_child_resource(this.form);" />
 		<input type="button" value="Save changes"
-			onClick="forms_to_xml()" />
+			onClick="forms_to_xml(this.form)" />
 		<input type="hidden" name="uuid" value="toplevel" />
 		<input type="hidden" name="parent_uuid" value="_toplevel" />
 		<input type="hidden" name="tree_level" value="-1" />
--- conga/luci/cluster/resource-form-macros	2006/09/27 22:24:11	1.17
+++ conga/luci/cluster/resource-form-macros	2006/10/02 20:21:47	1.18
@@ -83,14 +83,11 @@
 <div metal:define-macro="resourceremove-form">
 	<h2>Resources Remove Form</h2>
 
-	<tal:block
-		tal:define="
-				global cluname request/clustername;
-				global ragent python: here.getRicciAgentForCluster(request);
-				global edited request/edit | nothing;
-				global msg python: here.delResource(request, ragent)" />
-
-	<div tal:condition="msg" tal:content="msg" />
+	<tal:block tal:define="
+		ragent python: here.getRicciAgentForCluster(request);
+		msg python: here.delResource(request, ragent)">
+		<div tal:condition="msg" tal:content="msg" />
+	</tal:block>
 </div>
 
 <div metal:define-macro="resource-swap-form">
@@ -185,6 +182,9 @@
 
 <div metal:define-macro="resourceadd-form">
 	<script type="text/javascript"
+		src="/luci/homebase/homebase_common.js">
+	</script>
+	<script type="text/javascript"
 		src="/luci/cluster/resource_form_handlers.js">
 	</script>
 
@@ -225,46 +225,40 @@
 
 
 <div metal:define-macro="resourceprocess-form">
-	<tal:block
-		tal:define="
-			global cluname request/clustername;
-			global edited request/edit | nothing;
-			global ragent python: here.getRicciAgentForCluster(request)" />
-
-	<h2>Resource <span tal:replace="python: request['edit'] and 'Edited' or 'Added'" /></h2>
+	<h2>Resource <span tal:replace="python: ('edit' in request and request['edit']) and 'Edited' or 'Added'" /></h2>
 
-	<tal:block
-		tal:define="global msg python: here.addResource(request, ragent)" />
-	<div tal:condition="msg" tal:content="msg" />
+	<div tal:content="
+		python: here.addResource(request, here.getRicciAgentForCluster(request))" />
 </div>
 
 <div metal:define-macro="resourceconfig-form">
-	<script type="text/javascript"
-		src="/luci/cluster/resource_form_handlers.js">
-	</script>
-
-	<tal:block tal:define="
-		global restoedit request/resourcename | nothing" />
-
-	<tal:block tal:condition="restoedit"
+	<tal:block tal:condition="request/resourcename"
 		tal:define="
 			global msg python: here.appendModel(request, modelb);
 			global res python: here.getResourceInfo(modelb, request);
 			global type python: 'tag_name' in res and res['tag_name'] or ''">
 
-		<h2>Configure <span tal:replace="python: res['name']" /></h2>
+		<script type="text/javascript"
+			src="/luci/homebase/homebase_common.js">
+		</script>
+		<script type="text/javascript"
+			src="/luci/cluster/resource_form_handlers.js">
+		</script>
+
+		<h2>Configure <span tal:replace="res/name | string: resource" /></h2>
 
 		<div class="reschoose">
+
 		<span tal:omit-tag="" tal:condition="python: type == 'ip'">
-			<div metal:use-macro="here/resource-form-macros/macros/ip_macro"/>
+			<div metal:use-macro="here/resource-form-macros/macros/ip_macro" />
 		</span>
 
 		<span tal:omit-tag="" tal:condition="python: type == 'fs'">
-			<div metal:use-macro="here/resource-form-macros/macros/fs_macro"/>
+			<div metal:use-macro="here/resource-form-macros/macros/fs_macro" />
 		</span>
 
 		<span tal:omit-tag="" tal:condition="python: type == 'gfs'">
-			<div metal:use-macro="here/resource-form-macros/macros/gfs_macro"/>
+			<div metal:use-macro="here/resource-form-macros/macros/gfs_macro" />
 		</span>
 
 		<span tal:omit-tag="" tal:condition="python: type == 'nfsm'">
@@ -290,35 +284,20 @@
 	</tal:block>
 </div>
 
-<div class="rescfg" name="IP" tal:attributes="id res/name | nothing" metal:define-macro="ip_macro">
-<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
-	tal:define="
-		global edit python: True;
-		global editDisabled resourceIsRef | nothing;
-		global resName res/name | nothing;
-		global ip_address python: resName;
-		global monitor_link res/attrs/monitor_link | nothing;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
-
-<tal:block
-	tal:condition="python: ptype != '33'"
-	tal:define="
-		global edit python: False;
-		global monitor_link string:1;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+<div class="rescfg" name="IP"
+	tal:attributes="id res/name | nothing" metal:define-macro="ip_macro">
 
 	<p class="reshdr">IP Address Resource Configuration</p>
 
-	<form method="get"
-		tal:attributes="
-			action processURL | nothing;
-			name res/parent_uuid | nothing">
+	<form method="post"
+		tal:define="editDisabled resourceIsRef | nothing"
+		tal:attributes="name res/parent_uuid | nothing">
 
-	<input name="pagetype" type="hidden" value="35" />
+	<input name="edit" type="hidden"
+		tal:attributes="value python: ptype == '33' and True or False" />
+
+	<input name="pagetype" type="hidden"
+		tal:attributes="value python: ptype" />
 
 	<input name="global" type="hidden"
 		tal:attributes="value resourceIsRef | nothing" />
@@ -333,15 +312,13 @@
 		tal:attributes="value res/indent_ctr | string:0" />
 
 	<input name="clustername" type="hidden"
-		tal:attributes="value cluname | nothing" />
+		tal:attributes="
+			value request/clustername | request/form/clustername | nothing" />
 
 	<input name="oldname" type="hidden"
 		tal:attributes="value res/name | nothing" />
 
-	<input name="edit" type="hidden" value="1"
-		tal:condition="python: edit == True" />
-
-	<input name="type" type="hidden" value="ip"/>
+	<input name="type" type="hidden" value="ip" />
 
 	<table class="systemsTable">
 		<tr class="systemsTable">
@@ -350,7 +327,7 @@
 				<input size="15" name="ip_address" type="text" maxlength="15"
 					tal:attributes="
 						disabled python: editDisabled;
-						value ip_address | nothing" />
+						value res/name | nothing" />
 			</td>
 		</tr>
 		<tr class="systemsTable">
@@ -359,7 +336,7 @@
 				<input type="checkbox" name="monitorLink"
 					tal:attributes="
 						disabled python: editDisabled;
-						checked python: monitor_link == '1' and 'checked'" />
+						checked res/attrs/monitor_link | string: 1" />
 			</td>
 		</tr>
 	</table>
@@ -368,43 +345,20 @@
 	</form>
 </div>
 
-<div class="rescfg" name="FS" tal:attributes="id res/name | nothing" metal:define-macro="fs_macro">
-<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
-	tal:define="
-		global edit python: True;
-		global editDisabled resourceIsRef | nothing;
-		global resName res/name | nothing;
-		global mountPoint res/attrs/mountpoint | nothing;
-		global device res/attrs/device | nothing;
-		global fstype res/attrs/fstype | nothing;
-		global opt res/attrs/options | nothing;
-		global fsid res/attrs/fsid | nothing;
-		global force_unmount res/attrs/force_unmount | nothing;
-		global reboot_fail res/attrs/self_fence | nothing;
-		global fscheck res/attrs/force_fsck | nothing;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
-
-<tal:block tal:condition="python: ptype != '33'"
-	tal:define="
-		global edit python: False;
-		global force_unmount string:0;
-		global reboot_fail string:0;
-		global fstype string:0;
-		global fscheck string:0;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+<div class="rescfg" name="FS"
+	tal:attributes="id res/name | nothing" metal:define-macro="fs_macro">
 
 	<p class="reshdr">File System Resource Configuration</p>
 
-	<form method="get"
-		tal:attributes="
-			action processURL | nothing;
-			name res/parent_uuid | nothing">
+	<form method="post"
+		tal:attributes="name res/parent_uuid | nothing"
+		tal:define="editDisabled resourceIsRef | nothing">
+
+	<input name="edit" type="hidden"
+		tal:attributes="value python: ptype == '33' and True or False" />
 
-	<input name="pagetype" type="hidden" value="35" />
+	<input name="pagetype" type="hidden"
+		tal:attributes="value python: ptype" />
 
 	<input name="global" type="hidden"
 		tal:attributes="value resourceIsRef | nothing" />
@@ -419,14 +373,12 @@
 		tal:attributes="value res/indent_ctr | string:0" />
 
 	<input name="clustername" type="hidden"
-		tal:attributes="value cluname | nothing" />
+		tal:attributes="
+			value request/clustername | request/form/clustername | nothing" />
 
 	<input name="oldname" type="hidden"
 		tal:attributes="value res/name | nothing" />
 
-	<input name="edit" type="hidden" value="1"
-		tal:condition="python: edit == True" />
-
 	<input name="type" type="hidden" value="fs" />
 
 	<table class="systemsTable">
@@ -436,20 +388,23 @@
 				<input type="text" size="20" name="resourceName"
 					tal:attributes="
 						disabled python: editDisabled;
-						value resName | nothing"/>
+						value res/name | nothing"/>
 			</td>
 		</tr>
 
 		<tr class="systemsTable">
 			<td class="systemsTable">File system type</td>
 			<td class="systemsTable">
-				<select name="fstype">
+				<select name="fstype"
+					tal:define="fstype res/attrs/fstype | string: ext3"
+					tal:attributes="disabled python: editDisabled">
+
 					<option name="ext3" value="ext3"
 						tal:content="string: ext3"
-						tal:attributes="checked python: (edit == nothing or fstype == 'ext3') and 'checked'" />
+						tal:attributes="checked python: fstype == 'ext3' and 'checked'" />
 					<option name="ext2" value="ext2"
 						tal:content="string: ext2"
-						tal:attributes="checked python: (edit == True and fstype == 'ext2') and 'checked'" />
+						tal:attributes="checked python: fstype == 'ext2' and 'checked'" />
 				</select>
 			</td>
 		</tr>
@@ -458,7 +413,9 @@
 			<td class="systemsTable">Mount point</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="mountpoint"
-					tal:attributes="value mountPoint | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value res/attrs/mountpoint | nothing" />
 			</td>
 		</tr>
 
@@ -468,7 +425,7 @@
 				<input type="text" size="20" name="device"
 					tal:attributes="
 						disabled python: editDisabled;
-						value device | nothing" />
+						value res/attrs/device | nothing" />
 			</td>
 		</tr>
 
@@ -478,7 +435,7 @@
 				<input type="text" size="20" name="options"
 					tal:attributes="
 						disabled python: editDisabled;
-						value opt | nothing" />
+						value res/attrs/options | nothing" />
 			</td>
 		</tr>
 
@@ -488,7 +445,7 @@
 				<input type="text" size="20" name="fsid"
 					tal:attributes="
 						disabled python: editDisabled;
-						value fsid | nothing" />
+						value res/attrs/fsid | nothing" />
 			</td>
 		</tr>
 
@@ -498,7 +455,7 @@
 				<input type="checkbox" name="forceunmount"
 					tal:attributes="
 						disabled python: editDisabled;
-						checked python: force_unmount == '1' and 'checked'" />
+						checked res/attrs/force_unmount | nothing" />
 			</td>
 		</tr>
 
@@ -508,7 +465,7 @@
 				<input type="checkbox" name="selffence"
 					tal:attributes="
 						disabled python: editDisabled;
-						checked python: reboot_fail == '1' and 'checked'" />
+						checked res/attrs/self_fence |  nothing" />
 			</td>
 		</tr>
 
@@ -518,7 +475,7 @@
 				<input type="checkbox" name="checkfs"
 					tal:attributes="
 						disabled python: editDisabled;
-						checked python: fscheck == '1' and 'checked'" />
+						checked res/attrs/force_fsck | nothing" />
 			</td>
 		</tr>
 	</table>
@@ -527,38 +484,20 @@
 	</form>
 </div>
 
-<div class="rescfg" name="GFS" tal:attributes="id res/name | nothing" metal:define-macro="gfs_macro">
-<tal:block tal:condition="python: ptype == '33' or ptype =='24'"
-	tal:define="
-		global edit python: True;
-		global editDisabled resourceIsRef | nothing;
-		global resName res/name | nothing;
-		global mountPoint res/attrs/mountpoint | nothing;
-		global device res/attrs/device | nothing;
-		global fstype res/attrs/fstype | nothing;
-		global opt res/attrs/options | nothing;
-		global fsid res/attrs/fsid | nothing;
-		global force_unmount res/attrs/force_unmount | nothing;
-		global cluname request/clustername | nothing;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
-
-<tal:block tal:condition="python: ptype != '33'"
-	tal:define="
-		global edit python: False;
-		global force_unmount string:0;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+<div class="rescfg" name="GFS"
+	tal:attributes="id res/name | nothing" metal:define-macro="gfs_macro">
 
 	<p class="reshdr">GFS Resource Configuration</p>
 
-	<form method="get"
-		tal:attributes="
-			action processURL | nothing;
-			name res/parent_uuid | nothing">
+	<form method="post"
+		tal:attributes="name res/parent_uuid | nothing"
+		tal:define="editDisabled resourceIsRef | nothing">
 
-	<input name="pagetype" type="hidden" value="35" />
+	<input name="edit" type="hidden"
+		tal:attributes="value python: ptype == '33' and True or False" />
+
+	<input name="pagetype" type="hidden"
+		tal:attributes="value python: ptype" />
 
 	<input name="global" type="hidden"
 		tal:attributes="value resourceIsRef | nothing" />
@@ -573,14 +512,12 @@
 		tal:attributes="value res/indent_ctr | string:0" />
 
 	<input name="clustername" type="hidden"
-		tal:attributes="value cluname | nothing" />
+		tal:attributes="
+			value request/clustername | request/form/clustername | nothing" />
 
 	<input name="oldname" type="hidden"
 		tal:attributes="value res/name | nothing" />
 
-	<input name="edit" type="hidden" value="1"
-		tal:condition="python: edit == True" />
-
 	<input name="type" type="hidden" value="gfs" />
 
 	<table class="systemsTable">
@@ -590,7 +527,7 @@
 				<input type="text" size="20" name="resourceName"
 					tal:attributes="
 						disabled python: editDisabled;
-						value resName | nothing" />
+						value res/name | nothing" />
 			</td>
 		</tr>
 
@@ -600,7 +537,7 @@
 				<input type="text" size="20" name="mountpoint"
 					tal:attributes="
 						disabled python: editDisabled;
-						value mountpoint | nothing" />
+						value res/attrs/mountpoint | nothing" />
 			</td>
 		</tr>
 
@@ -610,7 +547,7 @@
 				<input type="text" size="20" name="device"
 					tal:attributes="
 						disabled python: editDisabled;
-						value device | nothing" />
+						value res/attrs/device | nothing" />
 			</td>
 		</tr>
 
@@ -620,7 +557,7 @@
 				<input type="text" size="20" name="options"
 					tal:attributes="
 						disabled python: editDisabled;
-						value opt | nothing" />
+						value res/attrs/options | nothing" />
 			</td>
 		</tr>
 
@@ -630,7 +567,7 @@
 				<input type="text" size="20" name="fsid"
 					tal:attributes="
 						disabled python: editDisabled;
-						value fsid | nothing" />
+						value res/attrs/fsid | nothing" />
 			</td>
 		</tr>
 
@@ -640,7 +577,7 @@
 				<input type="checkbox" name="forceunmount"
 					tal:attributes="
 						disabled python: editDisabled;
-						checked python: force_unmount == '1' and 'checked'" />
+						checked res/attrs/force_unmount | nothing" />
 			</td>
 		</tr>
 	</table>
@@ -649,38 +586,20 @@
 	</form>
 </div>
 
-<div class="rescfg" name="NFSM" tal:attributes="id res/name | nothing" metal:define-macro="nfsm_macro">
-<tal:block tal:condition="python: ptype == '33' or ptype =='24'"
-	tal:define="
-		global edit python: True;
-		global editDisabled resourceIsRef | nothing;
-		global resName res/name | nothing;
-		global mountpoint res/attrs/mountpoint | nothing;
-		global opt res/attrs/options | nothing;
-		global expath res/attrs/export | nothing;
-		global nfstype res/attrs/fstype | nothing;
-		global hostname res/attrs/host | nothing;
-		global force_unmount res/attrs/force_unmount | nothing;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
-
-<tal:block tal:condition="python: ptype != '33'"
-	tal:define="
-		global edit python: False;
-		global force_unmount string:0;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+<div class="rescfg" name="NFSM"
+	tal:attributes="id res/name | nothing" metal:define-macro="nfsm_macro">
 
 	<p class="reshdr">NFS Mount Resource Configuration</p>
 
-	<form method="get"
-		tal:attributes="
-			action processURL | nothing;
-			name res/parent_uuid | nothing">
+	<form method="post"
+		tal:attributes="name res/parent_uuid | nothing"
+		tal:define="editDisabled resourceIsRef | nothing">
+
+	<input name="edit" type="hidden"
+		tal:attributes="value python: ptype == '33' and True or False" />
 
-	<input name="pagetype" type="hidden" value="35" />
+	<input name="pagetype" type="hidden"
+		tal:attributes="value python: ptype" />
 
 	<input name="global" type="hidden"
 		tal:attributes="value resourceIsRef | nothing" />
@@ -695,14 +614,12 @@
 		tal:attributes="value res/indent_ctr | string:0" />
 
 	<input name="clustername" type="hidden"
-		tal:attributes="value cluname | nothing" />
+		tal:attributes="
+			value request/clustername | request/form/clustername | nothing" />
 
 	<input name="oldname" type="hidden"
 		tal:attributes="value res/name | nothing" />
 
-	<input name="edit" type="hidden" value="1"
-		tal:condition="python: edit == True" />
-
 	<input name="type" type="hidden" value="nfsm" />
 
 	<table class="systemsTable">
@@ -712,7 +629,7 @@
 				<input type="text" size="20" name="resourceName"
 					tal:attributes="
 						disabled python: editDisabled;
-						value resName | nothing" />
+						value res/name | nothing" />
 			</td>
 		</tr>
 
@@ -722,7 +639,7 @@
 				<input type="text" size="20" name="mountpoint"
 					tal:attributes="
 						disabled python: editDisabled;
-						value mountpoint | nothing" />
+						value res/attrs/mountpoint | nothing" />
 			</td>
 		</tr>
 
@@ -732,7 +649,7 @@
 				<input type="text" size="20" name="host"
 					tal:attributes="
 						disabled python: editDisabled;
-						value hostname | nothing" />
+						value res/attrs/host | nothing" />
 			</td>
 		</tr>
 
@@ -742,24 +659,25 @@
 				<input type="text" size="20" name="exportpath"
 					tal:attributes="
 						disabled python: editDisabled;
-						value expath | nothing" />
+						value res/attrs/readOnly | nothing" />
 			</td>
 		</tr>
 
 		<tr class="systemsTable">
 			<td class="systemsTable">NFS version</td>
-			<td class="systemsTable">
+			<td class="systemsTable"
+				tal:define="nfstype res/attrs/fstype | string: nfs">
 				<input type="radio" name="nfstype" value="nfs"
 					tal:attributes="
 						disabled python: editDisabled;
-						checked python: (edit == nothing or nfstype == 'nfs') and 'checked'" />
-				NFS (version 3)
+						content string: NFS (version 3);
+						checked python: nfstype == 'nfs' and 'checked'" />
 				<br/>
 				<input type="radio" name="nfstype" value="nfs4"
 					tal:attributes="
 						disabled python: editDisabled;
-						checked python: (edit == True and nfstype == 'nfs4') and 'checked'">
-				NFS4
+						content string: NFS4;
+						checked python: nfstype == 'nfs4' and 'checked'" />
 			</td>
 		</tr>
 
@@ -769,7 +687,7 @@
 				<input type="text" size="20" name="options"
 					tal:attributes="
 						disabled python: editDisabled;
-						value opt | nothing" />
+						value res/attrs/options | nothing" />
 			</td>
 		</tr>
 
@@ -779,7 +697,7 @@
 				<input type="checkbox" name="forceunmount"
 					tal:attributes="
 						disabled python: editDisabled;
-						checked python: force_unmount == '1' and 'checked'" />
+						checked res/attrs/force_unmount | nothing" />
 			</td>
 		</tr>
 	</table>
@@ -788,34 +706,20 @@
 	</form>
 </div>
 
-<div class="rescfg" name="NFSC" tal:attributes="id res/name | nothing" metal:define-macro="nfsc_macro">
-<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
-	tal:define="
-		global edit python: True;
-		global editDisabled resourceIsRef | nothing;
-		global resName res/name | nothing;
-		global target res/attrs/target | nothing;
-		global opt res/attrs/options | nothing;
-		global expath res/attrs/readOnly | nothing;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
-
-<tal:block tal:condition="python: ptype != '33'"
-	tal:define="
-		global edit python: False;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+<div class="rescfg" name="NFSC"
+	tal:attributes="id res/name | nothing" metal:define-macro="nfsc_macro">
 
 	<p class="reshdr">NFS Client Resource Configuration</p>
 
 	<form method="post"
-		tal:attributes="
-			action processURL | nothing;
-			name res/parent_uuid | nothing">
+		tal:attributes="name res/parent_uuid | nothing"
+		tal:define="editDisabled resourceIsRef | nothing">
+
+	<input name="edit" type="hidden"
+		tal:attributes="value python: ptype == '33' and True or False" />
 
-	<input name="pagetype" type="hidden" value="35" />
+	<input name="pagetype" type="hidden"
+		tal:attributes="value python: ptype" />
 
 	<input name="global" type="hidden"
 		tal:attributes="value resourceIsRef | nothing" />
@@ -830,15 +734,13 @@
 		tal:attributes="value res/indent_ctr | string:0" />
 
 	<input name="clustername" type="hidden"
-		tal:attributes="value cluname | nothing" />
+		tal:attributes="
+			value request/clustername | request/form/clustername | nothing" />
 
 	<input name="oldname" type="hidden"
 		tal:attributes="value res/name | nothing" />
 
-	<input name="edit" type="hidden" value="1"
-		tal:condition="python: edit == True" />
-
-	<input name="type" type="hidden" value="nfsc"/>
+	<input name="type" type="hidden" value="nfsc" />
 
 	<table class="systemsTable">
 		<tr class="systemsTable">
@@ -847,7 +749,7 @@
 				<input type="text" size="20" name="resourceName"
 					tal:attributes="
 						disabled python: editDisabled;
-						value resName | nothing" />
+						value res/name | nothing" />
 			</td>
 		</tr>
 
@@ -857,7 +759,7 @@
 				<input type="text" size="20" name="target"
 					tal:attributes="
 						disabled python: editDisabled;
-						value target | nothing"/>
+						value res/attrs/target | nothing"/>
 			</td>
 		</tr>
 
@@ -867,7 +769,7 @@
 				<input type="text" size="20" name="options"
 					tal:attributes="
 						disabled python: editDisabled;
-						value opt | nothing"/>
+						value res/attrs/options | nothing"/>
 			</td>
 		</tr>
 	</table>
@@ -876,30 +778,20 @@
 	</form>
 </div>
 
-<div class="rescfg" name="NFSX" tal:attributes="id res/name | nothing" metal:define-macro="nfsx_macro">
-<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
-	tal:define="
-		global edit python: True;
-		global editDisabled resourceIsRef | nothing;
-		global resName res/name | nothing;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
-
-<tal:block tal:condition="python: ptype != '33'"
-	tal:define="
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+<div class="rescfg" name="NFSX"
+	tal:attributes="id res/name | nothing" metal:define-macro="nfsx_macro">
 
 	<p class="reshdr">NFS Export Resource Configuration</p>
 
 	<form method="post"
-		tal:attributes="
-			action processURL | nothing;
-			name res/parent_uuid | nothing">
+		tal:attributes="name res/parent_uuid | nothing"
+		tal:define="editDisabled resourceIsRef | nothing">
+
+	<input name="edit" type="hidden"
+		tal:attributes="value python: ptype == '33' and True or False" />
 
-	<input name="pagetype" type="hidden" value="35" />
+	<input name="pagetype" type="hidden"
+		tal:attributes="value python: ptype" />
 
 	<input name="global" type="hidden"
 		tal:attributes="value resourceIsRef | nothing" />
@@ -914,14 +806,12 @@
 		tal:attributes="value res/indent_ctr | string:0" />
 
 	<input name="clustername" type="hidden"
-		tal:attributes="value cluname | nothing" />
+		tal:attributes="
+			value request/clustername | request/form/clustername | nothing" />
 
 	<input name="oldname" type="hidden"
 		tal:attributes="value res/name | nothing" />
 
-	<input name="edit" type="hidden" value="1"
-		tal:condition="python: edit == True" />
-
 	<input name="type" type="hidden" value="nfsx" />
 
 	<table class="systemsTable">
@@ -931,7 +821,7 @@
 				<input type="text" size="20" name="resourceName"
 					tal:attributes="
 						disabled python: editDisabled;
-						value resName | nothing" />
+						value res/name | nothing" />
 			</td>
 		</tr>
 	</table>
@@ -940,31 +830,20 @@
 	</form>
 </div>
 
-<div class="rescfg" name="SCR" tal:attributes="id res/name | nothing" metal:define-macro="scr_macro">
-<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
-	tal:define="
-		global edit string:true;
-		global editDisabled resourceIsRef | nothing;
-		global resName res/name | nothing;
-		global filename res/attrs/file | nothing;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
-
-<tal:block tal:condition="python: ptype != '33'"
-	tal:define="
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+<div class="rescfg" name="SCR"
+	tal:attributes="id res/name | nothing" metal:define-macro="scr_macro">
 
 	<p class="reshdr">Script Resource Configuration</p>
 
 	<form method="post"
-		tal:attributes="
-			action processURL | nothing;
-			name res/parent_uuid | nothing">
+		tal:define="editDisabled resourceIsRef | nothing"
+		tal:attributes="name res/parent_uuid | nothing">
 
-	<input name="pagetype" type="hidden" value="35" />
+	<input name="edit" type="hidden"
+		tal:attributes="value python: ptype == '33' and True or False" />
+
+	<input name="pagetype" type="hidden"
+		tal:attributes="value python: ptype" />
 
 	<input name="global" type="hidden"
 		tal:attributes="value resourceIsRef | nothing" />
@@ -979,14 +858,12 @@
 		tal:attributes="value res/indent_ctr | string:0" />
 
 	<input name="clustername" type="hidden"
-		tal:attributes="value cluname | nothing" />
+		tal:attributes="
+			value request/clustername | request/form/clustername | nothing" />
 
 	<input name="oldname" type="hidden"
 		tal:attributes="value res/name | nothing" />
 
-	<input name="edit" type="hidden" value="1"
-		tal:condition="python: edit == 'true'" />
-
 	<input name="type" type="hidden" value="scr" />
 
 	<table class="systemsTable">
@@ -996,7 +873,7 @@
 				<input type="text" size="20" name="resourceName"
 					tal:attributes="
 						disabled python: editDisabled;
-						value resName | nothing" />
+						value res/name | nothing" />
 			</td>
 		</tr>
 
@@ -1006,7 +883,7 @@
 				<input type="text" size="20" name="file"
 					tal:attributes="
 						disabled python: editDisabled;
-						value filename | nothing" />
+						value res/attrs/file | nothing" />
 			</td>
 		</tr>
 	</table>
@@ -1015,32 +892,20 @@
 	</form>
 </div>
 
-<div class="rescfg" name="SMB" tal:attributes="id res/name | nothing" metal:define-macro="smb_macro">
-<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
-	tal:define="
-		global edit python: True;
-		global editDisabled resourceIsRef | nothing;
-		global resName res/name | nothing;
-		global workgroup res/attrs/workgroup | nothing;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
-
-<tal:block tal:condition="python: ptype != '33'"
-	tal:define="
-		global edit python: False;
-		global cluname request/clustername;
-		tmp_URL context/cluster/index_html/absolute_url;
-		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+<div class="rescfg" name="SMB"
+	tal:attributes="id res/name | nothing" metal:define-macro="smb_macro">
 
 	<p class="reshdr">Samba Server Configuration</p>
 
 	<form method="post"
-		tal:attributes="
-			action processURL | nothing;
-			name res/parent_uuid | nothing">
+		tal:define="editDisabled resourceIsRef | nothing"
+		tal:attributes="name res/parent_uuid | nothing">
 
-	<input name="pagetype" type="hidden" value="35" />
+	<input name="edit" type="hidden"
+		tal:attributes="value python: ptype == '33' and True or False" />
+
+	<input name="pagetype" type="hidden"
+		tal:attributes="value python: ptype" />
 
 	<input name="global" type="hidden"
 		tal:attributes="value resourceIsRef | nothing" />
@@ -1055,14 +920,12 @@
 		tal:attributes="value res/indent_ctr | string:0" />
 
 	<input name="clustername" type="hidden"
-		tal:attributes="value cluname | nothing" />
+		tal:attributes="
+			value request/clustername | request/form/clustername | nothing" />
 
 	<input name="oldname" type="hidden"
 		tal:attributes="value res/name | nothing" />
 
-	<input name="edit" type="hidden" value="1"
-		tal:condition="python: edit == True" />
-
 	<input name="type" type="hidden" value="smb" />
 
 	<table class="systemsTable">
@@ -1072,7 +935,7 @@
 				<input type="text" size="20" name="resourceName"
 					tal:attributes="
 						disabled python: editDisabled;
-						value resName | nothing" />
+						value res/name | nothing" />
 			</td>
 		</tr>
 
@@ -1082,7 +945,7 @@
 				<input type="text" size="20" name="workgroup"
 					tal:attributes="
 						disabled python: editDisabled;
-						value workgroup | nothing" />
+						value res/attrs/workgroup | nothing" />
 			</td>
 		</tr>
 	</table>
--- conga/luci/cluster/resource_form_handlers.js	2006/09/29 21:41:43	1.16
+++ conga/luci/cluster/resource_form_handlers.js	2006/10/02 20:21:47	1.17
@@ -83,16 +83,17 @@
 
 	if (!form.ip_address || str_is_blank(form.ip_address.value)) {
 		errors.push('No IP address was given.');
-		set_form_error(form.ip_address);
+		set_form_err(form.ip_address);
 		return (errors);
 	}
 
 	var ipstr =	form.ip_address.value;
-	if (!isValidHost(ipstr)) {
-		errors.push('\"' + ipstr + '\" is an invalid IP address.');
-		set_form_error(form.ip_address);
+	var err = isValidHost(ipstr);
+	if (err) {
+		errors.push('Error: \"' + ipstr + '\": ' + err);
+		set_form_err(form.ip_address);
 	} else
-		clr_form_error(form.ip_address);
+		clr_form_err(form.ip_address);
 
 	return (errors);
 }
@@ -102,21 +103,21 @@
 
 	if (!form.mountpoint || str_is_blank(form.mounpoint.value)) {
 		errors.push('No mount point was given.');
-		set_form_error(form.mountpoint);
+		set_form_err(form.mountpoint);
 	} else
-		clr_form_error(form.mountpoint);
+		clr_form_err(form.mountpoint);
 
 	if (!form.host || str_is_blank(form.host.value)) {
 		errors.push('No NFS server host was given.');
-		set_form_error(form.host);
+		set_form_err(form.host);
 	} else
-		clr_form_error(form.host);
+		clr_form_err(form.host);
 
 	if (!form.exportpath || str_is_blank(form.exportpath.value)) {
 		errors.push('No NFS export path was given.');
-		set_form_error(form.exportpath);
+		set_form_err(form.exportpath);
 	} else
-		clr_form_error(form.exportpath);
+		clr_form_err(form.exportpath);
 	return (errors);
 }
 
@@ -220,11 +221,10 @@
 form_validators['scr'] = validate_script;
 form_validators['smb'] = validate_samba;
 
-function validate_form(form) {
+function check_form(form) {
 	var valfn = form_validators[form.type.value];
 	if (!valfn)
 		return (-1);
-
 	var errors = valfn(form);
 	if (form.type.value != 'ip') {
 		if (!form.resourceName || str_is_blank(form.resourceName.value)) {
@@ -234,6 +234,11 @@
 			clr_form_err(form.resourceName);
 	}
 
+	return (errors)
+}
+
+function validate_form(form) {
+	var errors = check_form(form);
 	if (error_dialog(errors))
 		return (-1);
 	form.submit();
@@ -372,20 +377,15 @@
 	pdiv.appendChild(child_div);
 }
 
-function forms_to_xml() {
-	var form = document.getElementsByTagName('form');
-	var master_form = null;
-	var form_xml = '';
+function forms_to_xml(master_form) {
 	var errors = new Array();
+	var form_xml = '';
 
+	var form = document.getElementsByTagName('form');
 	for (var i = 0 ; i < form.length ; i++) {
-		if (form[i].name == 'master') {
-			master_form = form[i];
+		if (form[i].name == 'master' || !form[i].uuid || !form[i].uuid.value)
 			continue;
-		} else if (!form[i].uuid || !form[i].uuid.value)
-			continue;
-
-		var err = validate_form(form[i]);
+		var err = check_form(form[i]);
 		if (err)
 			errors.concat(err);
 		var temp = form[i].innerHTML.match(/<input [^>]+>/ig).toString().replace(/>(,|$)/g, '/>');
@@ -395,13 +395,16 @@
 					form[i].parent_uuid.value + '">' + temp + '</form>';
 	}
 
-	if (error_dialog(errors))
-		return (-1);
+	if (!form_xml)
+		errors.push('No resource information was submitted.')
 
-	if (!master_form || !form_xml)
+	if (error_dialog(errors))
 		return (-1);
 
 	/* sort this out in the backend */
 	master_form.form_xml.value = form_xml;
-	master_form.submit();
+	alert(form_xml);
+	if (confirm('Save changes to this service?'))
+		master_form.submit();
+	return (0);
 }



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Cluster-devel] conga/luci/cluster form-macros resource-form-m ...
@ 2006-09-22 18:22 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2006-09-22 18:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-09-22 18:21:59

Modified files:
	luci/cluster   : form-macros resource-form-macros 
	                 resource_form_handlers.js 

Log message:
	- resources support
	- improved user interaction in places
	- better error handling in places

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.60&r2=1.61
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.8&r2=1.9

--- conga/luci/cluster/form-macros	2006/09/14 21:24:24	1.60
+++ conga/luci/cluster/form-macros	2006/09/22 18:21:59	1.61
@@ -31,7 +31,7 @@
 		tal:define="ragent python: here.getRicciAgent(clu);
 			global stat python: here.getClusterStatus(ragent);
 			global cstatus python: here.getClustersInfo(stat,request);
-			global cluster_status python: 'cluster ' + (cstatus['running'] == 'true' and 'running' or 'stopped');"
+			global cluster_status python: 'cluster ' + (('running' in cstatus and cstatus['running'] == 'true') and 'running' or 'stopped');"
  	/>
 
 	<table class="cluster" width="100%">
@@ -39,16 +39,16 @@
 		<td class="cluster cluster_name">
 			<strong class="cluster cluster_name">Cluster Name</strong>:
 			<a href=""
-				tal:attributes="href cstatus/clucfg;
+				tal:attributes="href cstatus/clucfg | nothing;
 								class python: 'cluster ' + cluster_status;"
-				tal:content="cstatus/clusteralias" />
+				tal:content="cstatus/clusteralias | string: [unknown]" />
 		</td>
 
 		<td class="cluster cluster_action">
 			<form method="post" onSubmit="return dropdown(this.gourl)">
 				<select name="gourl" id="cluster_action" class="cluster">
-					<option tal:condition="python: cstatus['running'] != 'true'" value="" class="cluster running">Start this cluster</option>
-					<option tal:condition="python: cstatus['running'] == 'true'" value="" class="cluster stopped">Stop this cluster</option>
+					<option tal:condition="python: 'running' in cstatus and cstatus['running'] != 'true'" value="" class="cluster running">Start this cluster</option>
+					<option tal:condition="python: 'running' in cstatus and cstatus['running'] == 'true'" value="" class="cluster stopped">Stop this cluster</option>
 					<option value="" class="cluster">Restart this cluster</option>
 				</select>
 				<input class="cluster" type="submit" value="Go" />
@@ -58,7 +58,9 @@
 
 	<tr class="cluster info_middle">
 		<td colspan="2" class="cluster cluster_quorum">
-			<ul class="cluster_quorum">
+			<ul class="cluster_quorum"
+				tal:condition="exists: cstatus/status">
+
 				<li><strong class="cluster">Status</strong>: <span tal:replace="cstatus/status"/></li>
 				<li><strong class="cluster">Total Cluster Votes</strong>: <span tal:replace="cstatus/votes"/></li>
 				<li><strong class="cluster">Minimum Required Quorum</strong>: <span tal:replace="cstatus/minquorum"/></li>
@@ -67,7 +69,9 @@
 	</tr>
 
 	<tr class="cluster info_bottom">
-		<td class="cluster cluster_nodes">
+		<td class="cluster cluster_nodes"
+			tal:condition="exists: cstatus/currentnodes">
+
 			<strong class="cluster">Nodes</strong>
 			<ul class="cluster">
 			<tal:block tal:repeat="nd cstatus/currentnodes">
@@ -86,11 +90,13 @@
 		<td class="cluster service cluster_services">
 			<strong class="cluster service">Services</strong>
 			<ul class="cluster service">
-			<tal:block tal:condition="python: len(cstatus['currentservices']) < 1">
+			<tal:block tal:condition="python: not 'currentservices' in cstatus or len(cstatus['currentservices']) < 1">
 				<li>No Services Defined</li>
 			</tal:block>
 
-			<tal:block tal:repeat="svc cstatus/currentservices">
+			<tal:block
+				tal:condition="exists: cstatus/currentservices"
+				tal:repeat="svc cstatus/currentservices">
 				<tal:block
 					tal:define="global svcclass python: svc['srunning'] == 'true' and 'running' or 'stopped'" />
 
@@ -161,28 +167,40 @@
 			<tbody class="systemsTable">
 				<tr class="systemsTable">
 					<td class="systemsTable">
-						<input class="hbInputSys" type="text" id="__SYSTEM0:Addr" name="__SYSTEM0:Addr" />
+						<input class="hbInputSys" type="text"
+							id="__SYSTEM0:Addr" name="__SYSTEM0:Addr" />
 					</td>
 					<td class="systemsTable">
-						<input type="password" id="__SYSTEM0:Passwd" name="__SYSTEM0:Passwd" class="hbInputPass" onChange="pwd0Change(adminform);" />
+						<input type="password"
+							id="__SYSTEM0:Passwd" name="__SYSTEM0:Passwd"
+							class="hbInputPass" autocomplete="off"
+							onChange="pwd0Change(adminform);" />
 					</td>
 				</tr>
 
 				<tr class="systemsTable">
 					<td class="systemsTable">
-						<input class="hbInputSys" type="text" id="__SYSTEM1:Addr" name="__SYSTEM1:Addr" />
+						<input class="hbInputSys" type="text"
+							id="__SYSTEM1:Addr" name="__SYSTEM1:Addr" />
 					</td>
 					<td class="systemsTable">
-						<input type="password" id="__SYSTEM1:Passwd" name="__SYSTEM1:Passwd" class="hbInputPass" onChange="pwd0Change(adminform);" />
+						<input type="password"
+							id="__SYSTEM1:Passwd" name="__SYSTEM1:Passwd"
+							class="hbInputPass" autocomplete="off"
+							onChange="pwd0Change(adminform);" />
 					</td>
 				</tr>
 
 				<tr class="systemsTable">
 					<td class="systemsTable">
-						<input class="hbInputSys" type="text" id="__SYSTEM2:Addr" name="__SYSTEM2:Addr" />
+						<input class="hbInputSys" type="text"
+							id="__SYSTEM2:Addr" name="__SYSTEM2:Addr" />
 					</td>
 					<td class="systemsTable">
-						<input type="password" id="__SYSTEM2:Passwd" name="__SYSTEM2:Passwd" class="hbInputPass" onChange="pwd0Change(adminform);" />
+						<input type="password"
+							id="__SYSTEM2:Passwd" name="__SYSTEM2:Passwd"
+							class="hbInputPass" autocomplete="off"
+							onChange="pwd0Change(adminform);" />
 					</td>
 				</tr>
 			</tbody>
@@ -975,10 +993,14 @@
 			<tbody class="systemsTable">
 				<tr class="systemsTable">
 					<td class="systemsTable">
-						<input class="hbInputSys" type="text" id="__SYSTEM0:Addr" name="__SYSTEM0:Addr" />
+						<input class="hbInputSys" type="text"
+							id="__SYSTEM0:Addr" name="__SYSTEM0:Addr" />
 					</td>
 					<td class="systemsTable">
-						<input type="password" id="__SYSTEM0:Passwd" name="__SYSTEM0:Passwd" class="hbInputPass" onChange="pwd0Change(adminform);" />
+						<input type="password"
+							id="__SYSTEM0:Passwd" name="__SYSTEM0:Passwd"
+							class="hbInputPass" autocomplete="off"
+							onChange="pwd0Change(adminform);" />
 					</td>
 				</tr>
 			</tbody>
@@ -1093,12 +1115,16 @@
 	</script>
 	<tal:block tal:define="
 		global ricci_agent python: here.getRicciAgentForCluster(request);
+		global global_resources python: here.getResourcesInfo(modelb, request);
 		global sstat python: here.getClusterStatus(ricci_agent);
 		global sinfo python: here.getServiceInfo(sstat, modelb,request);
 		global running sinfo/running | nothing;" />
 
 	<tal:block tal:replace="structure python: '<script type='+chr(0x22)+'text/javascript'+chr(0x22)+'>'" />
 		var uuid_list = <tal:block tal:replace="sinfo/uuid_list" />;
+		var global_resources = <tal:block tal:replace="python: map(lambda x: str(x['name']), global_resources) or 'null'" />;
+		var active_resources = <tal:block tal:replace="python: map(lambda x: str(x['name']), sinfo['resource_list']) or 'null'" />;
+		var resource_names = <tal:block tal:replace="python: (map(lambda x: str(x['name']), global_resources) + map(lambda x: str(x['name']), sinfo['resource_list'])) or 'null'" />;
 	<tal:block tal:replace="structure string: </script>" />
 
 	<table class="cluster service" width="100%">
@@ -1147,7 +1173,7 @@
 	<br/>
 
 	<div id="resskel" class="invisible">
-		<tal:block metal:use-macro="here/resource-form-macros/macros/resource-swap-form" />
+		<tal:block metal:use-macro="here/resource-form-macros/macros/service-compose-macro" /> 
 	</div>
 
 	<h2 onclick="forms_to_xml()">Service Composition</h2>
@@ -1160,12 +1186,12 @@
 			id python: res['uuid']">
 
 		<tal:block
-			tal:condition="python: res['max_depth'] > 0"
+			tal:condition="python: 'max_depth' in res and res['max_depth'] > 0"
 			tal:replace="structure python: '<div class=nothing>'" />
 
 		<tal:block tal:define="
 			global type res/type;
-			global ref res/ref_object | nothing" />
+			global resourceIsRef res/ref_object | nothing" />
 
 		<span tal:omit-tag="" tal:condition="python: type == 'IP Address: '">
 			<tal:block metal:use-macro="here/resource-form-macros/macros/ip_macro" />
@@ -1200,12 +1226,54 @@
 		</span>
 
 		<tal:block
+			tal:condition="python: 'indent_ctr' in res and 'max_depth' in res"
 			tal:replace="structure python: '</div>' * (res['indent_ctr'] - res['max_depth'])" />
 	</div>
 	</div>
 	<form name="master">
 		<input type="hidden" name="form_xml" />
 	</form>
+
+	<div class="invisible" id="global_resources_block">
+		<tal:block tal:repeat="gr global_resources">
+			<tal:block tal:define="
+				global res gr;
+				global type res/type;
+				global resourceIsRef python: True" />
+
+		<span tal:omit-tag="" tal:condition="python: type == 'IP Address: '">
+			<tal:block metal:use-macro="here/resource-form-macros/macros/ip_macro" />
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'fs'">
+			<tal:block metal:use-macro="here/resource-form-macros/macros/fs_macro" />
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'gfs'">
+			<tal:block metal:use-macro="here/resource-form-macros/macros/gfs_macro" />
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'nfsm'">
+			<tal:block metal:use-macro="here/resource-form-macros/macros/nfsm_macro" />
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'nfsx'">
+			<tal:block metal:use-macro="here/resource-form-macros/macros/nfsx_macro" />
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'nfsc'">
+			<tal:block metal:use-macro="here/resource-form-macros/macros/nfsc_macro" />
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'smb'">
+			<tal:block metal:use-macro="here/resource-form-macros/macros/smb_macro" />
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'Script: '">
+			<tal:block metal:use-macro="here/resource-form-macros/macros/scr_macro" />
+		</span>
+		</tal:block>
+	</div>
 </div>
 
 <div metal:define-macro="service-form">
--- conga/luci/cluster/resource-form-macros	2006/09/19 17:50:28	1.12
+++ conga/luci/cluster/resource-form-macros	2006/09/22 18:21:59	1.13
@@ -8,7 +8,8 @@
 	<p class="hbSubmit">
 		<input class="hbSubmit" type="button"
 			onClick="validate_form(this.form);"
-			tal:attributes="value python: sinfo and 'Apply' or 'Submit'" />
+			value="Submit"
+			tal:condition="not: sinfo" />
 
 		<tal:block tal:condition="sinfo">
 			<input class="hbSubmit" type="button" value="Add a child"
@@ -23,7 +24,7 @@
 
 	<tal:block tal:condition="exists:res">
 		<tal:block tal:define="
-			global expclass python: ((res['max_depth'] == 0 and 'invisible ' or '') + 'expander')" />
+			global expclass python: (((not 'max_depth' in res or res['max_depth'] == 0) and 'invisible ' or '') + 'expander')" />
 	</tal:block>
 
 	<p tal:attributes="class expclass">
@@ -93,7 +94,7 @@
 </div>
 
 <div metal:define-macro="resource-swap-form">
-	<p class="reshdr">
+	<p>
 		<strong class="reshdr">Select a Resource Type</strong>
 	</p>
 
@@ -101,7 +102,7 @@
 		<form>
 		<select onChange="swap_div_elem(this.form.parentNode,
 									this.options[this.selectedIndex].value);">
-			<option name="blank" value="blank" checked>Select a Resource</option>
+			<option name="blank" value="blank" checked>Select a resource type</option>
 			<option name="IP" value="IP">IP address</option>
 			<option name="FS" value="FS">File system</option>
 			<option name="GFS" value="GFS">GFS file system</option>
@@ -127,6 +128,61 @@
 	</div>
 </div>
 
+<div metal:define-macro="service-compose-macro">
+	<p class="reshdr">
+		<strong class="reshdr">Add a new local resource</strong>
+		<form>
+		<select onChange="swap_div_elem(this.form.parentNode,
+							this.options[this.selectedIndex].value);">
+			<option checked="checked">Select a resource type</option>
+			<option name="IP" value="IP">IP address</option>
+			<option name="FS" value="FS">File system</option>
+			<option name="GFS" value="GFS">GFS file system</option>
+			<option name="NFSM" value="NFSM">NFS mount</option>
+			<option name="NFSC" value="NFSC">NFS client</option>
+			<option name="NFSX" value="NFSX">NFS export</option>
+			<option name="SCR" value="SCR">Script</option>
+			<option name="SMB" value="SMB">Samba</option>
+		</select>
+		</form>
+	</p>
+
+	<p style="margin-left: +5em;margin-top:1em;"><strong>or</strong></p>
+	<p class="reshdr">
+		<strong class="reshdr">Use an existing global resource</strong>
+		<br/>
+		<form>
+		<input type="hidden" name="parent_uuid" value="" />
+		<input type="hidden" name="tree_level" value="" />
+		<select name="gres_chooser"
+			onChange="swap_in_global_res('global_resources_block',
+						this.options[this.selectedIndex].value,
+						this.form.parentNode.parentNode, this.form);">
+			<option checked="checked">Select a resource name</option>
+			<tal:block
+				tal:repeat="gres global_resources">
+				<option
+					tal:condition="python: 'name' in gres and 'type' in gres and gres['name'] and gres['type']"
+					tal:attributes="value gres/name"
+					tal:content="python: gres['name'] + ' (' + gres['type'].split(':')[0] + ')'" />
+			</tal:block>
+		</select>
+		</form>
+	</p>
+
+	<div name="invisible" class="invisible">
+		<div name="">&nbsp;</div>
+		<div metal:use-macro="here/resource-form-macros/macros/ip_macro" />
+		<div metal:use-macro="here/resource-form-macros/macros/fs_macro" />
+		<div metal:use-macro="here/resource-form-macros/macros/gfs_macro" />
+		<div metal:use-macro="here/resource-form-macros/macros/nfsm_macro" />
+		<div metal:use-macro="here/resource-form-macros/macros/nfsx_macro" />
+		<div metal:use-macro="here/resource-form-macros/macros/nfsc_macro" />
+		<div metal:use-macro="here/resource-form-macros/macros/smb_macro" />
+		<div metal:use-macro="here/resource-form-macros/macros/scr_macro" />
+	</div>
+</div>
+
 <div metal:define-macro="resourceadd-form">
 	<script type="text/javascript"
 		src="/luci/cluster/resource_form_handlers.js">
@@ -234,10 +290,11 @@
 	</tal:block>
 </div>
 
-<div class="rescfg" name="IP" metal:define-macro="ip_macro">
+<div class="rescfg" name="IP" tal:attributes="id res/name | nothing" metal:define-macro="ip_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit python: True;
+		global editDisabled resourceIsRef | nothing;
 		global resName res/name | nothing;
 		global ip_address python: resName;
 		global monitor_link res/attrs/monitor_link | nothing;
@@ -276,8 +333,7 @@
 		tal:attributes="value cluname | nothing" />
 
 	<input name="oldname" type="hidden"
-		tal:attributes="value res/name | nothing"
-		tal:condition="python: edit == True" />
+		tal:attributes="value res/name | nothing" />
 
 	<input name="edit" type="hidden" value="1"
 		tal:condition="python: edit == True" />
@@ -289,7 +345,9 @@
 			<td class="systemsTable">IP address</td>
 			<td class="systemsTable">
 				<input size="15" name="ip_address" type="text" maxlength="15"
-					tal:attributes="value ip_address | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value ip_address | nothing" />
 			</td>
 		</tr>
 		<tr class="systemsTable">
@@ -297,6 +355,7 @@
 			<td class="systemsTable">
 				<input type="checkbox" name="monitorLink"
 					tal:attributes="
+						disabled python: editDisabled;
 						checked python: monitor_link == '1' and 'checked'" />
 			</td>
 		</tr>
@@ -306,10 +365,11 @@
 	</form>
 </div>
 
-<div class="rescfg" name="FS" metal:define-macro="fs_macro">
+<div class="rescfg" name="FS" tal:attributes="id res/name | nothing" metal:define-macro="fs_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit python: True;
+		global editDisabled resourceIsRef | nothing;
 		global resName res/name | nothing;
 		global mountPoint res/attrs/mountpoint | nothing;
 		global device res/attrs/device | nothing;
@@ -356,7 +416,6 @@
 		tal:attributes="value cluname | nothing" />
 
 	<input name="oldname" type="hidden"
-		tal:condition="python: edit == True"
 		tal:attributes="value res/name | nothing" />
 
 	<input name="edit" type="hidden" value="1"
@@ -368,9 +427,10 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
-				<input type="text" size="20"
-					name="resourceName"
-					tal:attributes="value resName | nothing"/>
+				<input type="text" size="20" name="resourceName"
+					tal:attributes="
+						disabled python: editDisabled;
+						value resName | nothing"/>
 			</td>
 		</tr>
 
@@ -400,7 +460,9 @@
 			<td class="systemsTable">Device</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="device"
-					tal:attributes="value device | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value device | nothing" />
 			</td>
 		</tr>
 
@@ -408,7 +470,9 @@
 			<td class="systemsTable">Options</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="options"
-					tal:attributes="value opt | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value opt | nothing" />
 			</td>
 		</tr>
 
@@ -416,7 +480,9 @@
 			<td class="systemsTable">File system ID</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="fsid"
-					tal:attributes="value fsid | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value fsid | nothing" />
 			</td>
 		</tr>
 
@@ -424,7 +490,9 @@
 			<td class="systemsTable">Force unmount</td>
 			<td class="systemsTable">
 				<input type="checkbox" name="forceunmount"
-					tal:attributes="checked python: force_unmount == '1' and 'checked'" />
+					tal:attributes="
+						disabled python: editDisabled;
+						checked python: force_unmount == '1' and 'checked'" />
 			</td>
 		</tr>
 
@@ -433,6 +501,7 @@
 			<td class="systemsTable">
 				<input type="checkbox" name="selffence"
 					tal:attributes="
+						disabled python: editDisabled;
 						checked python: reboot_fail == '1' and 'checked'" />
 			</td>
 		</tr>
@@ -442,6 +511,7 @@
 			<td class="systemsTable">
 				<input type="checkbox" name="checkfs"
 					tal:attributes="
+						disabled python: editDisabled;
 						checked python: fscheck == '1' and 'checked'" />
 			</td>
 		</tr>
@@ -451,10 +521,11 @@
 	</form>
 </div>
 
-<div class="rescfg" name="GFS" metal:define-macro="gfs_macro">
+<div class="rescfg" name="GFS" tal:attributes="id res/name | nothing" metal:define-macro="gfs_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype =='24'"
 	tal:define="
 		global edit python: True;
+		global editDisabled resourceIsRef | nothing;
 		global resName res/name | nothing;
 		global mountPoint res/attrs/mountpoint | nothing;
 		global device res/attrs/device | nothing;
@@ -496,7 +567,6 @@
 		tal:attributes="value cluname | nothing" />
 
 	<input name="oldname" type="hidden"
-		tal:condition="python: edit == True"
 		tal:attributes="value res/name | nothing" />
 
 	<input name="edit" type="hidden" value="1"
@@ -508,9 +578,10 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
-				<input type="text" size="20"
-					name="resourceName"
-					tal:attributes="value resName | nothing" />
+				<input type="text" size="20" name="resourceName"
+					tal:attributes="
+						disabled python: editDisabled;
+						value resName | nothing" />
 			</td>
 		</tr>
 
@@ -518,7 +589,9 @@
 			<td class="systemsTable">Mount point</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="mountpoint"
-					tal:attributes="value mountpoint | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value mountpoint | nothing" />
 			</td>
 		</tr>
 
@@ -526,7 +599,9 @@
 			<td class="systemsTable">Device</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="device"
-					tal:attributes="value device | nothing"/>
+					tal:attributes="
+						disabled python: editDisabled;
+						value device | nothing" />
 			</td>
 		</tr>
 
@@ -534,7 +609,9 @@
 			<td class="systemsTable">Options</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="options"
-					tal:attributes="value opt | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value opt | nothing" />
 			</td>
 		</tr>
 
@@ -542,7 +619,9 @@
 			<td class="systemsTable">File system ID</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="fsid"
-					tal:attributes="value fsid | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value fsid | nothing" />
 			</td>
 		</tr>
 
@@ -551,6 +630,7 @@
 			<td class="systemsTable">
 				<input type="checkbox" name="forceunmount"
 					tal:attributes="
+						disabled python: editDisabled;
 						checked python: force_unmount == '1' and 'checked'" />
 			</td>
 		</tr>
@@ -560,10 +640,11 @@
 	</form>
 </div>
 
-<div class="rescfg" name="NFSM" metal:define-macro="nfsm_macro">
+<div class="rescfg" name="NFSM" tal:attributes="id res/name | nothing" metal:define-macro="nfsm_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype =='24'"
 	tal:define="
 		global edit python: True;
+		global editDisabled resourceIsRef | nothing;
 		global resName res/name | nothing;
 		global mountpoint res/attrs/mountpoint | nothing;
 		global opt res/attrs/options | nothing;
@@ -605,7 +686,6 @@
 		tal:attributes="value cluname | nothing" />
 
 	<input name="oldname" type="hidden"
-		tal:condition="python: edit == True"
 		tal:attributes="value res/name | nothing" />
 
 	<input name="edit" type="hidden" value="1"
@@ -617,9 +697,10 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
-				<input type="text" size="20"
-					name="resourceName"
-					tal:attributes="value resName | nothing" />
+				<input type="text" size="20" name="resourceName"
+					tal:attributes="
+						disabled python: editDisabled;
+						value resName | nothing" />
 			</td>
 		</tr>
 
@@ -627,7 +708,9 @@
 			<td class="systemsTable">Mount point</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="mountpoint"
-					tal:attributes="value mountpoint | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value mountpoint | nothing" />
 			</td>
 		</tr>
 
@@ -635,7 +718,9 @@
 			<td class="systemsTable">Host</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="host"
-					tal:attributes="value hostname | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value hostname | nothing" />
 			</td>
 		</tr>
 
@@ -643,7 +728,9 @@
 			<td class="systemsTable">Export path</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="exportpath"
-					tal:attributes="value expath | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value expath | nothing" />
 			</td>
 		</tr>
 
@@ -651,11 +738,15 @@
 			<td class="systemsTable">NFS version</td>
 			<td class="systemsTable">
 				<input type="radio" name="nfstype" value="nfs"
-					tal:attributes="checked python: (edit == nothing or nfstype == 'nfs') and 'checked'" />
+					tal:attributes="
+						disabled python: editDisabled;
+						checked python: (edit == nothing or nfstype == 'nfs') and 'checked'" />
 				NFS (version 3)
 				<br/>
 				<input type="radio" name="nfstype" value="nfs4"
-					tal:attributes="checked python: (edit == True and nfstype == 'nfs4') and 'checked'">
+					tal:attributes="
+						disabled python: editDisabled;
+						checked python: (edit == True and nfstype == 'nfs4') and 'checked'">
 				NFS4
 			</td>
 		</tr>
@@ -664,7 +755,9 @@
 			<td class="systemsTable">Options</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="options"
-					tal:attributes="value opt | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value opt | nothing" />
 			</td>
 		</tr>
 
@@ -673,6 +766,7 @@
 			<td class="systemsTable">
 				<input type="checkbox" name="forceunmount"
 					tal:attributes="
+						disabled python: editDisabled;
 						checked python: force_unmount == '1' and 'checked'" />
 			</td>
 		</tr>
@@ -682,10 +776,11 @@
 	</form>
 </div>
 
-<div class="rescfg" name="NFSC" metal:define-macro="nfsc_macro">
+<div class="rescfg" name="NFSC" tal:attributes="id res/name | nothing" metal:define-macro="nfsc_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit python: True;
+		global editDisabled resourceIsRef | nothing;
 		global resName res/name | nothing;
 		global target res/attrs/target | nothing;
 		global opt res/attrs/options | nothing;
@@ -723,7 +818,6 @@
 		tal:attributes="value cluname | nothing" />
 
 	<input name="oldname" type="hidden"
-		tal:condition="python: edit == True"
 		tal:attributes="value res/name | nothing" />
 
 	<input name="edit" type="hidden" value="1"
@@ -735,9 +829,10 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
-				<input type="text" size="20"
-					name="resourceName"
-					tal:attributes="value resName | nothing" />
+				<input type="text" size="20" name="resourceName"
+					tal:attributes="
+						disabled python: editDisabled;
+						value resName | nothing" />
 			</td>
 		</tr>
 
@@ -745,7 +840,9 @@
 			<td class="systemsTable">Target</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="target"
-					tal:attributes="value target | nothing"/>
+					tal:attributes="
+						disabled python: editDisabled;
+						value target | nothing"/>
 			</td>
 		</tr>
 
@@ -753,7 +850,9 @@
 			<td class="systemsTable">Options</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="options"
-					tal:attributes="value opt | nothing"/>
+					tal:attributes="
+						disabled python: editDisabled;
+						value opt | nothing"/>
 			</td>
 		</tr>
 	</table>
@@ -762,10 +861,11 @@
 	</form>
 </div>
 
-<div class="rescfg" name="NFSX" metal:define-macro="nfsx_macro">
+<div class="rescfg" name="NFSX" tal:attributes="id res/name | nothing" metal:define-macro="nfsx_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit python: True;
+		global editDisabled resourceIsRef | nothing;
 		global resName res/name | nothing;
 		global cluname request/clustername;
 		tmp_URL context/cluster/index_html/absolute_url;
@@ -799,7 +899,6 @@
 		tal:attributes="value cluname | nothing" />
 
 	<input name="oldname" type="hidden"
-		tal:condition="python: edit == True"
 		tal:attributes="value res/name | nothing" />
 
 	<input name="edit" type="hidden" value="1"
@@ -811,9 +910,10 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
-				<input type="text" size="20"
-					name="resourceName"
-					tal:attributes="value resName | nothing" />
+				<input type="text" size="20" name="resourceName"
+					tal:attributes="
+						disabled python: editDisabled;
+						value resName | nothing" />
 			</td>
 		</tr>
 	</table>
@@ -822,10 +922,11 @@
 	</form>
 </div>
 
-<div class="rescfg" name="SCR" metal:define-macro="scr_macro">
+<div class="rescfg" name="SCR" tal:attributes="id res/name | nothing" metal:define-macro="scr_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit string:true;
+		global editDisabled resourceIsRef | nothing;
 		global resName res/name | nothing;
 		global filename res/attrs/file | nothing;
 		global cluname request/clustername;
@@ -860,7 +961,6 @@
 		tal:attributes="value cluname | nothing" />
 
 	<input name="oldname" type="hidden"
-		tal:condition="python: edit == 'true'"
 		tal:attributes="value res/name | nothing" />
 
 	<input name="edit" type="hidden" value="1"
@@ -872,9 +972,10 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
-				<input type="text" size="20"
-					name="resourceName"
-					tal:attributes="value resName | nothing" />
+				<input type="text" size="20" name="resourceName"
+					tal:attributes="
+						disabled python: editDisabled;
+						value resName | nothing" />
 			</td>
 		</tr>
 
@@ -882,7 +983,9 @@
 			<td class="systemsTable">Full path to script file</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="file"
-					tal:attributes="value filename | nothing" />
+					tal:attributes="
+						disabled python: editDisabled;
+						value filename | nothing" />
 			</td>
 		</tr>
 	</table>
@@ -891,10 +994,11 @@
 	</form>
 </div>
 
-<div class="rescfg" name="SMB" metal:define-macro="smb_macro">
+<div class="rescfg" name="SMB" tal:attributes="id res/name | nothing" metal:define-macro="smb_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit python: True;
+		global editDisabled resourceIsRef | nothing;
 		global resName res/name | nothing;
 		global workgroup res/attrs/workgroup | nothing;
 		global cluname request/clustername;
@@ -908,10 +1012,7 @@
 		tmp_URL context/cluster/index_html/absolute_url;
 		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
 
-	<p class="reshdr"
-		tal:condition="python: edit != 'true'">
-		Samba Server Configuration
-	</p>
+	<p class="reshdr">Samba Server Configuration</p>
 
 	<form method="post"
 		tal:attributes="
@@ -933,7 +1034,6 @@
 		tal:attributes="value cluname | nothing" />
 
 	<input name="oldname" type="hidden"
-		tal:condition="python: edit == True"
 		tal:attributes="value res/name | nothing" />
 
 	<input name="edit" type="hidden" value="1"
@@ -945,9 +1045,10 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
-				<input type="text" size="20"
-					name="resourceName"
-					tal:attributes="value resName | nothing" />
+				<input type="text" size="20" name="resourceName"
+					tal:attributes="
+						disabled python: editDisabled;
+						value resName | nothing" />
 			</td>
 		</tr>
 
@@ -955,7 +1056,9 @@
 			<td class="systemsTable">Workgroup</td>
 			<td class="systemsTable">
 				<input type="text" size="20" name="workgroup"
-					tal:attributes="value workgroup | nothing"/>
+					tal:attributes="
+						disabled python: editDisabled;
+						value workgroup | nothing" />
 			</td>
 		</tr>
 	</table>
--- conga/luci/cluster/resource_form_handlers.js	2006/09/14 21:24:24	1.8
+++ conga/luci/cluster/resource_form_handlers.js	2006/09/22 18:21:59	1.9
@@ -1,3 +1,24 @@
+function swap_in_global_res(container_id, res_id, replace, form) {
+	var container = document.getElementById(container_id);
+	if (!container)
+		return (-1);
+	var res = document.getElementById(res_id);
+	if (!res)
+		return (-1);
+	if (!replace)
+		return (-1);
+	var new_uuid = update_resource_form_uuid(res, form.parent_uuid.value, form.tree_level.value);
+	res.id = new_uuid;
+	if (form.gres_chooser && form.gres_chooser.options) {
+		var o = form.gres_chooser.options;
+		for (var i = 0 ; i < o.length ; i++) {
+			if (o[i].value == res_id)
+				o[i] = null;
+		}
+	}
+	return (replace.parentNode.replaceChild(res, replace));
+}
+
 function collapse_div(image) {
 	var span = null;
 	var pdiv = image.parentNode;
@@ -175,6 +196,7 @@
 }
 
 function delete_resource(form) {
+	/* XXX - remove names from used list, replace global resources */
 	if (!confirm('Are you sure you want to delete this resource?'))
 		return (-1);
 	var div = document.getElementById(form.uuid.value);
@@ -189,6 +211,38 @@
 	}
 }
 
+function update_resource_form_uuid(node, parent_uuid, indent_level) {
+	var forms = node.getElementsByTagName('form');
+	for (var i = 0 ; i < forms.length ; i++)
+		forms.name = parent_uuid;
+	var ielem = node.getElementsByTagName('input');
+	if (!ielem)
+		return (null);
+	var new_uuid = uuid_list.pop();
+	var used_new_uuid = 0;
+	for (var i = 0 ; i < ielem.length ; i++) {
+		if (ielem[i].getAttribute('name') == 'tree_level')
+			ielem[i].value = indent_level;
+		else if (ielem[i].getAttribute('name') == 'parent_uuid')
+			ielem[i].value = parent_uuid;
+		else if (ielem[i].getAttribute('name') == 'uuid') {
+			if (!new_uuid) {
+				alert('You have too many pending children. Update first.');
+				return (null);
+			}
+			ielem[i].value = new_uuid;
+			++used_new_uuid;
+		}
+	}
+
+	if (!used_new_uuid) {
+		uuid_list.push(new_uuid);
+		return (null);
+	}
+
+	return (new_uuid);
+}
+
 function add_child_resource(form) {
 	if (!form || !form.tree_level || !form.parent_uuid || !form.uuid ||
 		!is_valid_int(form.tree_level.value, 0, null))
@@ -221,29 +275,10 @@
 	var node = sdiv.cloneNode(1);
 	node.id = null;
 	node.className = null;
-	ielem = node.getElementsByTagName('input');
-	if (!ielem) {
-		return (-1);
-	}
 
-	forms = node.getElementsByTagName('form');
-	for (var i = 0 ; i < forms.length ; i++)
-		forms.name = form.uuid.value;
-
-	var new_uuid = uuid_list.pop();
-	for (var i = 0 ; i < ielem.length ; i++) {
-		if (ielem[i].getAttribute('name') == 'tree_level')
-			ielem[i].value = ilevel;
-		else if (ielem[i].getAttribute('name') == 'parent_uuid')
-			ielem[i].value = form.uuid.value;
-		else if (ielem[i].getAttribute('name') == 'uuid') {
-			if (!new_uuid) {
-				alert('You have too many pending children. Update first.');
-				return (-1);
-			}
-			ielem[i].value = new_uuid;
-		}
-	}
+	var new_uuid = update_resource_form_uuid(node, form.uuid.value, ilevel);
+	if (!new_uuid)
+		return (-1);
 
 	if (!child_div) {
 		var pelem = pdiv.getElementsByTagName('p');



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Cluster-devel] conga/luci/cluster form-macros resource-form-m ...
@ 2006-09-06 22:13 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2006-09-06 22:13 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-09-06 22:13:33

Modified files:
	luci/cluster   : form-macros resource-form-macros 
	                 resource_form_handlers.js 
	                 validate_config_qdisk.js 

Log message:
	more UI and JS validation bits

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.55&r2=1.56
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_config_qdisk.js.diff?cvsroot=cluster&r1=1.1&r2=1.2

--- conga/luci/cluster/form-macros	2006/09/05 21:25:44	1.55
+++ conga/luci/cluster/form-macros	2006/09/06 22:13:33	1.56
@@ -551,15 +551,18 @@
 					<th class="systemsTable">
 						<div class="systemsTableTop">Score</div>
 					</th>
+					<th>
+						&nbsp;
+					</th>
 				</tr>
 			</thead>
 
-			<tbody class="systemsTable" id='heuristicList'
+			<tbody class="systemsTable" id="heuristicList"
 				tal:define="global heuristics clusterinfo/hlist">
 
 				<tal:block tal:condition="python: not len(heuristics)">
 				<input type="hidden" name="num_heuristics" id="num_heuristics" value="0">
-				<tr class="systemsTable">
+				<tr class="systemsTable" id="heuristic0">
 					<td class="systemsTable">
 						<input class="qdname qdisk" type="text" name="heuristic0:hname" id="heuristic0:hname" value="">
 					</td>
@@ -572,6 +575,12 @@
 					<td class="systemsTable">
 						<input class="qdscore qdisk" type="text" name="heuristic0:hscore" id="heuristic0:hscore" value="">
 					</td>
+					<td class="systemsTable">
+						<img class="qdscore qdisk qdel_img"
+							id="heuristic0:hdel" name="heuristic0:hdel"
+							src="/luci/homebase/x.png"
+							onClick="delete_qdisk_heur(this, document.quorum_partition);">
+					</td>
 				</tr>
 				</tal:block>
 
@@ -584,6 +593,7 @@
 
 				<tr class="systemsTable"
 					tal:repeat="heuristic heuristics"
+					tal:attributes="id python: 'heuristic' + str(curHeur)"
 					tal:define="global curHeur python: curHeur + 1">
 
 					<td class="systemsTable">
@@ -614,6 +624,14 @@
 								id python: 'heuristic' + str(curHeur) + ':hscore';
 								name python: 'heuristic' + str(curHeur) + ':hscore';"/>
 					</td>
+					<td class="systemsTable">
+						<img class="qdscore qdisk qdel_img"
+							src="/luci/homebase/x.png"
+							onClick="delete_qdisk_heur(this, document.quorum_partition);"
+							tal:attributes="
+								id python: 'heuristic' + str(curHeur) + ':hdel';
+								name python: 'heuristic' + str(curHeur) + ':hdel';"/>
+					</td>
 				</tr>
 				</tal:block>
 			</tbody>
--- conga/luci/cluster/resource-form-macros	2006/09/05 21:25:44	1.6
+++ conga/luci/cluster/resource-form-macros	2006/09/06 22:13:33	1.7
@@ -265,8 +265,15 @@
 		</tr>
 	</table>
 
-	<input class="hbSubmit" name="submit" type="button" value="Submit"
-		onClick="validate(this.form);" />
+	<div class="hbSubmit">
+		<input class="hbSubmit" type="button" value="Submit"
+			onClick="validate(this.form);" />
+		<input class="hbSubmit" type="button" value="Add a child resource"
+			onClick="add_child_resource(this.form)" />
+		<input class="hbSubmit" value="Delete this resource"
+			onClick="delete_resource(this.form)" />
+	</div>
+
 	</form>
 </div>
 
@@ -369,7 +376,7 @@
 			</td>
 			<td class="systemsTable">
 				<input type="text" size="20" id="options" name="options"
-					tal:attributes="value opt | nothing"/>
+					tal:attributes="value opt | nothing" />
 			</td>
 		</tr>
 
@@ -379,7 +386,7 @@
 			</td>
 			<td class="systemsTable">
 				<input type="text" size="20" id="fsid" name="fsid"
-					tal:attributes="value fsid | nothing"/>
+					tal:attributes="value fsid | nothing" />
 			</td>
 		</tr>
 
@@ -416,8 +423,14 @@
 		</tr>
 	</table>
 
-	<input class="hbSubmit" type="button" value="Submit"
-		onClick="validate(this.form);" />
+	<div class="hbSubmit">
+		<input class="hbSubmit" type="button" value="Submit"
+			onClick="validate(this.form);" />
+		<input class="hbSubmit" type="button" value="Add a child resource"
+			onClick="add_child_resource(this.form)" />
+		<input class="hbSubmit" value="Delete this resource"
+			onClick="delete_resource(this.form)" />
+	</div>
 
 	</form>
 </div>
@@ -527,8 +540,14 @@
 		</tr>
 	</table>
 
-	<input type="button" value="Submit" class="hbSubmit"
-		onclick="validate(gfs_form);" />
+	<div class="hbSubmit">
+		<input class="hbSubmit" type="button" value="Submit"
+			onClick="validate(this.form);" />
+		<input class="hbSubmit" type="button" value="Add a child resource"
+			onClick="add_child_resource(this.form)" />
+		<input class="hbSubmit" value="Delete this resource"
+			onClick="delete_resource(this.form)" />
+	</div>
 
 	</form>
 </div>
@@ -651,8 +670,14 @@
 		</tr>
 	</table>
 
-	<input type="button" value="Submit" class="hbSubmit"
-		onclick="validate(this.form);"/>
+	<div class="hbSubmit">
+		<input class="hbSubmit" type="button" value="Submit"
+			onClick="validate(this.form);" />
+		<input class="hbSubmit" type="button" value="Add a child resource"
+			onClick="add_child_resource(this.form)" />
+		<input class="hbSubmit" value="Delete this resource"
+			onClick="delete_resource(this.form)" />
+	</div>
 
 	</form>
 </div>
@@ -726,8 +751,14 @@
 		</tr>
 	</table>
 
-	<input type="button" value="Submit" class="hbSubmit"
-		onclick="validate(this.form);" />
+	<div class="hbSubmit">
+		<input class="hbSubmit" type="button" value="Submit"
+			onClick="validate(this.form);" />
+		<input class="hbSubmit" type="button" value="Add a child resource"
+			onClick="add_child_resource(this.form)" />
+		<input class="hbSubmit" value="Delete this resource"
+			onClick="delete_resource(this.form)" />
+	</div>
 
 	</form>
 </div>
@@ -776,8 +807,14 @@
 		</tr>
 	</table>
 
-	<input type="button" value="Submit" class="hbSubmit"
-		onClick="validate(this.form);" />
+	<div class="hbSubmit">
+		<input class="hbSubmit" type="button" value="Submit"
+			onClick="validate(this.form);" />
+		<input class="hbSubmit" type="button" value="Add a child resource"
+			onClick="add_child_resource(this.form)" />
+		<input class="hbSubmit" value="Delete this resource"
+			onClick="delete_resource(this.form)" />
+	</div>
 
 	</form>
 </div>
@@ -837,8 +874,14 @@
 		</tr>
 	</table>
 
-	<input type="button" value="Submit" class="hbSubmit"
-		onClick="validate(scr_form);" />
+	<div class="hbSubmit">
+		<input class="hbSubmit" type="button" value="Submit"
+			onClick="validate(this.form);" />
+		<input class="hbSubmit" type="button" value="Add a child resource"
+			onClick="add_child_resource(this.form)" />
+		<input class="hbSubmit" value="Delete this resource"
+			onClick="delete_resource(this.form)" />
+	</div>
 
 	</form>
 </div>
@@ -900,8 +943,14 @@
 		</tr>
 	</table>
 
-	<input type="button" value="Submit" class="hbSubmit"
-		onClick="validate(smb_form);" />
+	<div class="hbSubmit">
+		<input class="hbSubmit" type="button" value="Submit"
+			onClick="validate(this.form);" />
+		<input class="hbSubmit" type="button" value="Add a child resource"
+			onClick="add_child_resource(this.form)" />
+		<input class="hbSubmit" value="Delete this resource"
+			onClick="delete_resource(this.form)" />
+	</div>
 
 	</form>
 </div>
--- conga/luci/cluster/resource_form_handlers.js	2006/08/10 23:06:20	1.3
+++ conga/luci/cluster/resource_form_handlers.js	2006/09/06 22:13:33	1.4
@@ -1,164 +1,129 @@
-/*swap_div switches between types of forms
- * based on a chooser within the document */
-function swap_div(container_id, element_id){
-  container_element = document.getElementById(container_id);
-  if (!container_element) {
-    alert('Can\'t find element with id = ' + container_id);
-    return (-1)
-  }
-  child_element = document.getElementById(element_id);
-  if (!child_element) {
-    alert('Can\'t find element with id = ' + element_id);
-    return (-1)
-  }
-  for(child in child_element.children){
-    alert(child);
-  }
-  temp = container_element.firstChild;
-  container_element.replaceChild(child_element, container_element.firstChild);
-  
-  invisible_div = document.getElementById('invisible');
-  if (!invisible_div) {
-    alert('No invisible div');
-    return (-1)
-  } 
-  
-  invisible_div.appendChild(temp);
-}
-
-/*In order to val a new resource type, 
- *create a form within the resource-form-macros 
- *with 'resource-name'_form as the 'name' 
- *attribute, and use:
- * onSubmit="valResource('resource-name'_form)"
- *val handler functions here and further
- *down within actual cluster code.*/
-
-function validate(form){
-  if(form.type.value != 'ip'){
-    if(form.resourceName.value.length == 0){
-      alert("Please enter a name for this resource. \n");
-      return;
-    }
-  }
-  /*Get the type of form from the first
-   *part of the name string*/
-  type = form.type.value;
-  /*use eval to access proper resource
-   *valer function as defined below*/
-  eval("val"+(type.toUpperCase())+"(form);");
-  /*TODO: val error checking!!!*/
-}
-
-/*Val an IP Resource*/
-function valIP(form){
-  /*first, check to make sure all input 
-   *fields have values*/
-  if (isNaN(parseInt(form.ip1.value)) ||
-     isNaN(parseInt(form.ip2.value)) ||
-     isNaN(parseInt(form.ip3.value)) ||
-     isNaN(parseInt(form.ip4.value)) ) {
-    error = "The IP Address contains illegal characters. \n";
-    alert(error);
-  }
-  else{
-    form.submit();
-  }
-}
-
-/*Val an NFS Mount Resource*/
-function valNFSM(form){
-  error = ""
-  /*check to make sure all input
-   *fields have values*/
-  if(form.mountpoint.value == "")
-    error += "Please enter a mount point.\n";
-  if(form.host.value == "")
-    error += "Please enter a host.\n";
-  if(form.exportpath.value == "")
-    error += "Please enter an export path.\n";
-  if(error != "")
-    alert(error);
-  else
-    form.submit();
-}
-
-/*Validate an NFS Export Resource*/
-function valNFSX(form){
-  form.submit();
-}
-
-/*Validate an NFS Client Resource*/
-function valNFSC(form){
-  error = ""
-  /*check to make sure all input
-   *fields have values*/
-  if(form.target.value == "")
-    error += "Please enter a target.\n";
-  if(error != "")
-    alert(error);
-  else
-    form.submit();
-}
-
-/*Validate an FS Resource*/
-function valFS(form){
-  error = ""
-  /*check to make sure all input
-   *fields have values*/
-  if(form.fsTypeSelect.value == "")
-    error += "Please Select a file system type.\n";
-  if(form.mountpoint.value == "")
-    error += "Please enter a mount point.\n";
-  if(form.device.value == "")
-    error += "Please enter a device.\n";
-  if(form.fsid.value == "")
-    error += "Please enter a file system id.\n";
-  if(error != "")
-    alert(error);
-  else
-    form.submit(); 
-}
-
-/*Validate a GFS Resource*/
-function valGFS(form){
-  error = ""
-  /*check to make sure all input
-   *fields have values*/
-  if(form.mountpoint.value == "")
-    error += "Please enter a mount point.\n";
-  if(form.device.value == "")
-    error += "Please enter a device.\n";
-  if(form.fsid.value == "")
-    error += "Please enter a file system id.\n";
-  if(error != "")
-    alert(error);
-  else
-    form.submit(); 
-}
-
-/*Validate a Script Resource*/
-function valSCR(form){
-  error = ""
-  /*check to make sure all input
-   *fields have values*/
-  if(form.file.value == "")
-    error += "Please enter a filename.\n";
-  if(error != "")
-    alert(error);
-  else
-    form.submit(); 
-}
-
-/*Validate a Samba Resource*/
-function valSMB(form){
-  error = ""
-  /*check to make sure all input
-   *fields have values*/
-  if(form.workgroup.value == "")
-    error += "Please enter a workgroup.\n";
-  if(error != "")
-    alert(error);
-  else
-    form.submit();   
+function swap_div(container_id, element_id) {
+	var container_element = document.getElementById(container_id);
+	if (!container_element)
+		return (-1);
+
+	var child_element = document.getElementById(element_id);
+	if (!child_element)
+		return (-1);
+
+	var invisible_div = document.getElementById('invisible');
+	if (!invisible_div)
+		return (-1);
+
+	var temp = container_element.firstChild;
+	container_element.replaceChild(child_element, container_element.firstChild);
+	invisible_div.appendChild(temp);
+}
+
+function validate_ip(form) {
+	var errors = new Array();
+	var ipstr =	form.ip1.value + '.' + form.ip2.value + '.' +
+				form.ip3.value + '.' + form.ip4.value;
+
+	if (!isValidHost(ipstr))
+		errors.push('\"' + ipstr '\" is an invalid IP address.');
+	return (errors);
+}
+
+function validate_nfs_mount(form) {
+	var errors = new Array();
+
+	if (!form.mountpoint || str_is_blank(form.mounpoint.value))
+		errors.push('No mount point was given.');
+
+	if (!form.host || str_is_blank(form.host.value))
+		errors.push('No NFS server host was given.');
+
+	if (!form.exportpath || str_is_blank(form.exportpath.value))
+		errors.push('No NFS export path was given.');
+	return (errors);
+}
+
+function validate_nfs_export(form) {
+	var errors = new Array();
+	return (errors);
+}
+
+function validate_nfs_client(form) {
+	var errors = new Array();
+
+	if (!form.target || str_is_blank(form.target.value))
+		errors.push('No NFS client target was given.');
+	return (errors);
+}
+
+function validate_filesystem(form) {
+	var errors = new Array();
+
+	if (!form.fsTypeSelect || str_is_blank(form.fsTypeSelect.value))
+		errors.push('No file system type was given.');
+
+	if (!form.mountpoint || str_is_blank(form.mountpoint.value))
+		errors.push('No file system mount point was given.');
+
+	if (!form.device || str_is_blank(form.device.value))
+		errors.push('No device containing the file system was given.');
+
+	if (!form.fsid || str_is_blank(form.fsid.value))
+		errors.push('No file system ID was given.');
+	return (errors);
+}
+
+function validate_gfs(form) {
+	my errors = new Array();
+
+	if (!form.mountpoint || str_is_blank(form.mountpoint.value))
+		errors.push('No file system mount point was given.');
+
+	if (!form.device || str_is_blank(form.device.value))
+		errors.push('No device containing file system was given.');
+
+	if (!form.fsid || str_is_blank(form.fsid.value))
+		errors.push('No file system ID was given.');
+	return (errors);
+}
+
+function validate_script(form) {
+	var errors = new Array();
+
+	if (!form.file || str_is_blank(form.file.value))
+		errors.push('No path to the script file was given.');
+	return (errors);
+}
+
+function validate_samba(form) {
+	var errors = new Array();
+
+	if (!form.workgroup || str_is_blank(form.workgroup.value))
+		errors.push('No workgroup was given');
+	return (errors);
+}
+
+var form_validators = new Array();
+form_validators['ip'] = validate_ip;
+form_validators['nfsm'] = validate_nfs_mount;
+form_validators['nfsx'] = validate_nfs_export;
+form_validators['nfsc'] = validate_nfs_client;
+form_validators['fs'] = validate_filesystem;
+form_validators['gfs'] = validate_gfs;
+form_validators['scr'] = validate_script;
+form_validators['smb'] = validate_samba;
+
+function validate(form) {
+	var valfn = form_validators[form.type.value];
+	if (!valfn)
+		return (-1);
+
+	if (error_dialog(valfn(form)))
+		return (-1);
+	form.submit();
+}
+
+function delete_resource(form) {
+	return (-1);
+}
+
+function add_child_resource(form) {
+	return (-1);
 }
--- conga/luci/cluster/validate_config_qdisk.js	2006/08/17 16:22:41	1.1
+++ conga/luci/cluster/validate_config_qdisk.js	2006/09/06 22:13:33	1.2
@@ -1,3 +1,74 @@
+var heuristic_names = [ ':hname', ':hprog', ':hinterval', ':hscore', ':hdel' ];
+
+function clear_heuristic(form, heur_num) {
+	var str_prefix = 'heuristic' + heur_num;
+	for (var i = 0 ; i < heuristic_names.length - 1 ; i++) {
+		var id = str_prefix + heuristic_names[i];
+		var elem = document.getElementById(id);
+		if (!elem)
+			continue;
+		elem.value = '';
+	}
+
+	return (0);
+}
+
+function delete_qdisk_heur(field, form) {
+	if (!field)
+		return (-1);
+
+	if (!form)
+		return (-1);
+
+	var num_heur = form.num_heuristics;
+	if (!num_heur)
+		return (-1);
+	num_heur = Number(num_heur.value);
+
+	var id = field.id;
+	var hnum = id.split(':')[0].substr(9);
+	if (!is_valid_int(hnum, 0, 9))
+		return (-1);
+	hnum = Number(hnum);
+
+	if (num_heur < 1) {
+		if (!confirm('Delete this qurorum disk heuristic?'))
+			return (-1);
+
+		return (clear_heuristic(form, hnum));
+	}
+
+	var heur_body = document.getElementById('heuristicList');
+	if (!heur_body)
+		return (-1);
+
+	if (!confirm('Delete qurorum disk heuristic ' + (hnum + 1) + '?'))
+		return (-1);
+
+	heur_body.deleteRow(hnum)
+
+	for (var i = hnum + 1 ; i <= num_heur ; i++) {
+		var tr = document.getElementById('heuristic' + i);
+		if (!tr)
+			continue;
+		var prefix_str = 'heuristic' + (i - 1);
+
+		tr.setAttribute('id', prefix_str);
+		tr.setAttribute('name', prefix_str);
+
+		for (var n = 0 ; n < heuristic_names.length ; n++) {
+			var elem = document.getElementById('heuristic' + i + heuristic_names[n]);
+			if (!elem)
+				continue;
+
+			elem.setAttribute('id', prefix_str + heuristic_names[n]);
+			elem.setAttribute('name', prefix_str + heuristic_names[n]);
+		}
+	}
+
+	form.num_heuristics.value = num_heur - 1;
+}
+
 function check_heuristic(hnum, form) {
 	var errors = new Array();
 
@@ -9,27 +80,27 @@
 	if (errors.length > 0)
 		return (errors);
 
-	hstr = 'heuristic' + hnum + ':';
+	var hstr = 'heuristic' + hnum;
 
-	hname = document.getElementById(hstr + 'hname');
+	var hname = document.getElementById(hstr + ':hname');
 	if (!hname || str_is_blank(hname.value))
 		errors.push('No name was given for heuristic ' + (hnum + 1));
 	else
 		hname = hname.value;
 
-	hpath = document.getElementById(hstr + 'hpath');
+	var hpath = document.getElementById(hstr + ':hpath');
 	if (!hpath || str_is_blank(hpath.value))
 		errors.push('No path was given for heuristic ' + (hnum + 1));
 	else
 		hpath = hpath.value;
 
-	hint = document.getElementById(hstr + 'hinterval');
+	var hint = document.getElementById(hstr + ':hinterval');
 	if (!hint || str_is_blank(hint.value))
 		errors.push('No interval was given for heuristic ' + (hnum + 1));
 	else
 		hint = hint.value;
 
-	hscore = document.getElementById(hstr + 'hscore');
+	var hscore = document.getElementById(hstr + ':hscore');
 	if (!hscore || str_is_blank(hscore.value))
 		errors.push('No score was given for heuristic ' + (hnum + 1));
 	else
@@ -60,12 +131,13 @@
 		return (error_dialog(errors));
 	}
 
+	var qpart = null;
 	if (form.quorumd[0].checked)
 		qpart = 0
 	else if (form.quorumd[1].checked)
 		qpart = 1;
 	else {
-		errors.push('You submitted an invalid value while specifying whether or not to use a quorum partition: ' + qpart + '.');
+		errors.push('You submitted an invalid value while specifying whether or not to use a quorum partition.');
 		return (error_dialog(errors));
 	}
 
@@ -102,17 +174,17 @@
 			errors.push('No device setting was given.');
 		else {
 			/* TODO: check this */
-			device = form.device.value;
+			var device = form.device.value;
 		}
 
 		if (!form.label || str_is_blank(form.label.value))
 			errors.push('No label setting was given.');
 		else {
 			/* TODO: check this */
-			label = form.device.label;
+			var label = form.device.label;
 		}
 
-		hnum = document.getElementById('num_heuristics');
+		var hnum = document.getElementById('num_heuristics');
 		if (hnum) {
 			hnum = Number(hnum.value);
 			if (hnum == 0)
@@ -135,10 +207,11 @@
 var oldInput = null;
 
 function addHeuristic(parent_name) {
-	parent = document.getElementById(parent_name);
-	if (!parent)
+	var parente = document.getElementById(parent_name);
+	if (!parente)
 		return;
-	hnum = document.getElementById('num_heuristics');
+
+	var hnum = document.getElementById('num_heuristics');
 	if (!hnum)
 		return;
 
@@ -147,69 +220,86 @@
 		alert('There is a maximum of 10 heuristics.');
 		return;
 	}
-	hstr = 'heuristic' + cur_hnum + ':';
 
-	name_td = document.createElement('td');
+	var hstr = 'heuristic' + cur_hnum;
+
+	var name_td = document.createElement('td');
 	name_td.className = 'systemsTable';
-	name_input = document.createElement('input');
+	var name_input = document.createElement('input');
 	name_input.className = 'qdname qdisk';
-	name_input.setAttribute('name', hstr + 'hname');
-	name_input.setAttribute('id', hstr + 'hname');
+	name_input.setAttribute('name', hstr + ':hname');
+	name_input.setAttribute('id', hstr + ':hname');
 	name_input.setAttribute('type', 'text');
 	name_td.appendChild(name_input);
 
-	path_td = document.createElement('td');
+	var path_td = document.createElement('td');
 	path_td.className = 'systemsTable';
-	path_input = document.createElement('input');
+	var path_input = document.createElement('input');
 	path_input.className = 'qdpath qdisk';
-	path_input.setAttribute('name', hstr + 'hprog');
-	path_input.setAttribute('id', hstr + 'hprog');
+	path_input.setAttribute('name', hstr + ':hprog');
+	path_input.setAttribute('id', hstr + ':hprog');
 	path_input.setAttribute('type', 'text');
 	path_td.appendChild(path_input);
 
-	interval_td = document.createElement('td');
+	var interval_td = document.createElement('td');
 	interval_td.className = 'systemsTable';
-	interval_input = document.createElement('input');
+	var interval_input = document.createElement('input');
 	interval_input.className = 'qdint qdisk';
-	interval_input.setAttribute('name', hstr + 'hinterval');
-	interval_input.setAttribute('id', hstr + 'hinterval');
+	interval_input.setAttribute('name', hstr + ':hinterval');
+	interval_input.setAttribute('id', hstr + ':hinterval');
 	interval_input.setAttribute('type', 'text');
 	interval_td.appendChild(interval_input);
 
-	score_td = document.createElement('td');
+	var score_td = document.createElement('td');
 	score_td.className = 'systemsTable';
-	score_input = document.createElement('input');
+	var score_input = document.createElement('input');
 	score_input.className = 'qdscore qdisk';
-	score_input.setAttribute('name', hstr + 'hscore');
-	score_input.setAttribute('id', hstr + 'hscore');
+	score_input.setAttribute('name', hstr + ':hscore');
+	score_input.setAttribute('id', hstr + ':hscore');
 	score_input.setAttribute('type', 'input');
 	score_td.appendChild(score_input);
 
-	tr = document.createElement('tr');
+	var del_td = document.createElement('td');
+	del_td.className = 'systemsTable';
+	var del_img = document.createElement('img');
+	del_img.className = 'qdscore qdisk qdel_img';
+	del_img.setAttribute('name', hstr + ':hdel');
+	del_img.setAttribute('id', hstr + ':hdel');
+	del_img.setAttribute('src', '/luci/homebase/x.png');
+	del_img.setAttribute('onClick', 'delete_qdisk_heur(this, document.quorum_partition)');
+	del_td.appendChild(del_img);
+
+	var tr = document.createElement('tr');
 	tr.className = 'systemsTable';
+	tr.setAttribute('id', 'heuristic' + cur_hnum);
 	tr.appendChild(name_td);
 	tr.appendChild(path_td);
 	tr.appendChild(interval_td);
 	tr.appendChild(score_td);
-	parent.appendChild(tr);
-	hnum.value++;
+	tr.appendChild(del_td);
+	parente.appendChild(tr);
+	hnum.value = cur_hnum;
 }
 
 function disableChildrenInput(parent_name) {
-	parent = document.getElementById(parent_name);
-	if (!parent)
+	var parente = document.getElementById(parent_name);
+	if (!parente)
 		return;
 
-	inputElem = parent.getElementsByTagName('input');
+	var inputElem = parente.getElementsByTagName('input');
 	if (!inputElem || inputElem.length < 1) {
 		oldInput = null;
 		return;
 	}
+
 	if (inputElem[0].disabled)
 		return;
+
 	oldInput = new Array(inputElem.length);
 	for (var i = 0 ; i < inputElem.length ; i++) {
-		e = inputElem[i];
+		var e = inputElem[i];
+		if (e.type == 'hidden')
+			continue;
 
 		e.disabled = true;
 		if (e.type == 'button')
@@ -220,22 +310,18 @@
 }
 
 function enableChildrenInput(parent_name) {
-	parent = document.getElementById(parent_name);
-	if (!parent)
+	var parente = document.getElementById(parent_name);
+	if (!parente)
 		return;
 
-	inputElem = parent.getElementsByTagName('input');
-	if (!inputElem || inputElem.length < 1) {
-		return;
-	}
-
-	if (!inputElem[0].disabled)
+	var inputElem = parente.getElementsByTagName('input');
+	if (!inputElem || inputElem.length < 1 || !inputElem[0].disabled)
 		return;
 
 	for (var i = 0 ; i < inputElem.length ; i++) {
-		e = inputElem[i];
+		var e = inputElem[i];
 		e.disabled = false;
-		if (e.type == 'button')
+		if (e.type == 'button' || e.type == 'hidden')
 			continue;
 		if (oldInput && oldInput[e.name])
 			e.value = oldInput[e.name];



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Cluster-devel] conga/luci/cluster form-macros resource-form-m ...
@ 2006-08-29 23:23 rmccabe
  0 siblings, 0 replies; 6+ messages in thread
From: rmccabe @ 2006-08-29 23:23 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-08-29 23:23:00

Modified files:
	luci/cluster   : form-macros resource-form-macros 

Log message:
	more ui work

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.51&r2=1.52
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.4&r2=1.5

--- conga/luci/cluster/form-macros	2006/08/28 23:04:59	1.51
+++ conga/luci/cluster/form-macros	2006/08/29 23:22:59	1.52
@@ -1,9 +1,9 @@
-<html>	
-		
-<head>	
+<html>
+
+<head>
 		<title tal:content="template/title">The title</title>
-</head>	
-	
+</head>
+
 <body>
 
 <div metal:define-macro="entry-form">
@@ -21,19 +21,16 @@
 		<tr><td>
 			<h2><span tal:content="isBusy/desc" /></h2>
 		</td></tr>
-
 	</table>
 </div>
 
 <div metal:define-macro="clusters-form">
-
 <div id="cluster_list">
-
 <div class="cluster" tal:repeat="clu clusystems">
 	<tal:block
-		tal:define="ragent python:here.getRicciAgent(clu);
-			global stat python:here.getClusterStatus(ragent);
-			global cstatus python:here.getClustersInfo(stat,request);
+		tal:define="ragent python: here.getRicciAgent(clu);
+			global stat python: here.getClusterStatus(ragent);
+			global cstatus python: here.getClustersInfo(stat,request);
 			global cluster_status python: 'cluster ' + (cstatus['running'] == 'true' and 'running' or 'stopped');"
  	/>
 
@@ -51,7 +48,7 @@
 			<form method="post" onSubmit="return dropdown(this.gourl)">
 				<select name="gourl" id="cluster_action" class="cluster">
 					<option tal:condition="python: cstatus['running'] != 'true'" value="" class="cluster running">Start this cluster</option>
-					<option tal:condition="python:cstatus['running'] == 'true'" value="" class="cluster stopped">Stop this cluster</option>
+					<option tal:condition="python: cstatus['running'] == 'true'" value="" class="cluster stopped">Stop this cluster</option>
 					<option value="" class="cluster">Restart this cluster</option>
 				</select>
 				<input class="cluster" type="submit" value="Go" />
@@ -86,10 +83,10 @@
 			</ul>
 		</td>
 
-		<td class="cluster_services">
-			<strong class="cluster">Services</strong>
-			<ul class="cluster">
-			<tal:block tal:condition="python:len(cstatus['currentservices']) < 1">
+		<td class="cluster service cluster_services">
+			<strong class="cluster service">Services</strong>
+			<ul class="cluster service">
+			<tal:block tal:condition="python: len(cstatus['currentservices']) < 1">
 				<li>No Services Defined</li>
 			</tal:block>
 
@@ -124,7 +121,7 @@
 	</script>
 
 	<tal:block tal:omit-tag=""
-		tal:define="global sessionObj python:request.SESSION.get('checkRet')" />
+		tal:define="global sessionObj python: request.SESSION.get('checkRet')" />
 
 	<form name="adminform" action="" method="post">
 		<input name="pagetype" id="pagetype" type="hidden" value="6" />
@@ -267,11 +264,11 @@
 
 <div metal:define-macro="clusterconfig-form">
 	<tal:comment tal:replace="nothing">
-		<span tal:define="global ricci_agent python:here.getRicciAgentForCluster(request)"/>
+		<span tal:define="global ricci_agent python: here.getRicciAgentForCluster(request)"/>
 	</tal:comment>
 
 	<tal:block
-		tal:define="global clusterinfo python:here.getClusterInfo(modelb, request)" /> 
+		tal:define="global clusterinfo python: here.getClusterInfo(modelb, request)" />
 
 	<span tal:omit-tag="" tal:define="global configTabNum python: 'tab' in request and int(request['tab']) or 1" />
 
@@ -307,7 +304,7 @@
 		<script type="text/javascript" src="/luci/cluster/validate_config_general.js"></script>
 		<form name="basecluster" action="" method="post">
 		<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
-			<thead class="systemsTable"> 
+			<thead class="systemsTable">
 				<tr class="systemsTable"><td class="systemsTable" colspan="1">
 					<div class="systemsTableTop">
 						<strong>General Properties</strong>
@@ -348,7 +345,7 @@
 		<script type="text/javascript" src="/luci/homebase/homebase_common.js"></script>
 		<script type="text/javascript" src="/luci/cluster/validate_config_fence.js"></script>
 		<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
-			<thead class="systemsTable"> 
+			<thead class="systemsTable">
 				<tr class="systemsTable"><td class="systemsTable" colspan="1">
 					<div class="systemsTableTop">
 						<strong>Fence Daemon Properties</strong>
@@ -390,7 +387,7 @@
 
 		<form name="multicast" action="" method="post">
 		<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
-			<thead class="systemsTable"> 
+			<thead class="systemsTable">
 				<tr class="systemsTable"><td class="systemsTable" colspan="1">
 					<div class="systemsTableTop">
 						<strong>Multicast Configuration</strong>
@@ -403,7 +400,7 @@
 					<td class="systemsTable">
 						<input type="radio" name="mcast" value="False"
 							onClick="disable_mcast('mcast_address');"
-							tal:attributes="checked python:clusterinfo['is_mcast'] != 'True'"
+							tal:attributes="checked python: clusterinfo['is_mcast'] != 'True'"
 						/>
 						Let cluster choose the multicast address
 					</td>
@@ -413,8 +410,8 @@
 					<td class="systemsTable">
 						<input type="radio" name="mcast" value="True"
 							onClick="enable_mcast('mcast_address');"
-							tal:attributes="checked python:clusterinfo['is_mcast'] == 'True'"
-						
+							tal:attributes="checked python: clusterinfo['is_mcast'] == 'True'"
+
 						/>
 						Specify the multicast address manually
 					</td>
@@ -451,7 +448,7 @@
 			/>
 		<div class="configTabContent">
 		<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
-			<thead class="systemsTable"> 
+			<thead class="systemsTable">
 				<tr class="systemsTable"><td class="systemsTable" colspan="1">
 					<div class="systemsTableTop">
 						<strong>Quorum Partition Configuration</strong>
@@ -463,14 +460,14 @@
 				<tr class="systemsTable" id="st_row"><td class="systemsTable" id="st_col">
 					<input type="radio" name="quorumd" value="False"
 						onClick="disableChildrenInput('quorumdisk');"
-						tal:attributes="checked python:clusterinfo['is_quorumd'] != 'True'"/>
+						tal:attributes="checked python: clusterinfo['is_quorumd'] != 'True'"/>
 					Do not use a Quorum Partition
 				</td></tr>
 
 				<tr class="systemsTable"><td class="systemsTable">
 					<input type="radio" name="quorumd" value="True"
 						onClick="enableChildrenInput('quorumdisk');"
-						tal:attributes="checked python:clusterinfo['is_quorumd'] == 'True'"/>
+						tal:attributes="checked python: clusterinfo['is_quorumd'] == 'True'"/>
 						Use a Quorum Partition
 				</td></tr>
 			</tbody>
@@ -534,7 +531,7 @@
 
 		<div class="configTabContent">
 		<table name="qdiskheur" class="systemsTable">
-			<thead class="systemsTable"> 
+			<thead class="systemsTable">
 				<tr class="systemsTable"><td class="systemsTable" colspan="1">
 					<div class="systemsTableTop">
 						<strong>Heuristics</strong>
@@ -635,7 +632,7 @@
 				onClick="validate_form(this.form);"
 			>
 		</div>
-			<script tal:condition="python:clusterinfo['is_quorumd'] != 'True'">
+			<script tal:condition="python: clusterinfo['is_quorumd'] != 'True'">
 				disableChildrenInput('quorumdisk');
 			</script>
 		</form>
@@ -643,8 +640,8 @@
 </div>
 
 <div metal:define-macro="clusterprocess-form">
-	<span tal:define="global r_agent python:here.getRicciAgentForCluster(request)"/> 
-	<span tal:define="res python:here.processClusterProps(r_agent, request)"/>
+	<span tal:define="global r_agent python: here.getRicciAgentForCluster(request)"/>
+	<span tal:define="res python: here.processClusterProps(r_agent, request)"/>
 </div>
 
 <div metal:define-macro="node-form">
@@ -655,9 +652,9 @@
 	</tal:comment>
 
 	<tal:block tal:define="
-		global ricci_agent python:here.getRicciAgentForCluster(request);
-		global nodestatus python:here.getClusterStatus(ricci_agent);
-		global nodeinfo python:here.getNodeInfo(modelb, nodestatus, request);
+		global ricci_agent python: here.getRicciAgentForCluster(request);
+		global nodestatus python: here.getClusterStatus(ricci_agent);
+		global nodeinfo python: here.getNodeInfo(modelb, nodestatus, request);
 		global status_class python: 'node_' + (nodeinfo['nodestate'] == '0' and 'active' or (nodeinfo['nodestate'] == '1' and 'inactive' or 'unknown'));
 		global cluster_node_status_str python: (nodeinfo['nodestate'] == '0' and 'Cluster member' or (nodeinfo['nodestate'] == '1' and 'Currently not a cluster participant' or 'This node is not responding'));"
 	/>
@@ -701,9 +698,10 @@
 
 		</tr>
 
-		<tr class="cluster node info_bottom">
+		<tr class="cluster node info_bottom"
+			tal:condition="python: nodeinfo['nodestate'] == '0' or nodeinfo['nodestate'] == '1'">
 			<td class="cluster node node_log" colspan="2">
-			     <a class="cluster node"
+				<a class="cluster node"
 					tal:attributes="href nodeinfo/logurl" onClick="return popup_log(this, 'notes')">
 					Show recent log activity for this node
 				</a>
@@ -711,7 +709,10 @@
 		</tr>
 	</table>
 
-    <hr/>
+	<hr/>
+
+	<tal:block
+		tal:condition="python: nodeinfo['nodestate'] == '0' or nodeinfo['nodestate'] == '1'">
 
 	<h3>Cluster daemons running on this node</h3>
 	<form name="daemon_form">
@@ -744,29 +745,28 @@
 		</tbody>
 	</table>
 	</form>
-
-    <hr/>
+	<hr/>
+	</tal:block>
 
 	<div>
-		<h3>Services on this Node:</h3>
+		<h3>Services on this Node</h3>
 		<ul class="cluster node">
-			<tal:block tal:condition="python:len(nodeinfo['currentservices']) == 0">
+			<tal:block tal:condition="python: len(nodeinfo['currentservices']) == 0">
 				<li>No cluster services are currently running here</li>
 			</tal:block>
 			<li class="cluster node cluster_service" tal:repeat="svc nodeinfo/currentservices">
-				<a tal:attributes="href svc/svcurl">
-					<font color="green"><span tal:replace="svc/servicename"/></font>
-				</a>
+				<a class="running" tal:attributes="href svc/svcurl"
+					tal:content="svc/servicename" />
 			</li>
 		</ul>
 	</div>
 
 	<hr/>
 
-    <div class="fdomblock">
+	<div class="fdomblock">
 		<h3>Failover Domain Membership</h3>
 		<ul class="cluster node">
-			<tal:block tal:condition="python:len(nodeinfo['fdoms']) == 0">
+			<tal:block tal:condition="python: len(nodeinfo['fdoms']) == 0">
 				<li>This node has no failover domain membership</li>
 			</tal:block>
 			<li class="cluster node node_fdom" tal:repeat="fdom nodeinfo/fdoms">
@@ -794,9 +794,9 @@
 
 <div metal:define-macro="nodes-form">
 <div id="node_list" tal:define="
-	global ricci_agent python:here.getRicciAgentForCluster(request);
-	global status python:here.getClusterStatus(ricci_agent);
-	global nds python:here.getNodesInfo(modelb,status,request)">
+	global ricci_agent python: here.getRicciAgentForCluster(request);
+	global status python: here.getClusterStatus(ricci_agent);
+	global nds python: here.getNodesInfo(modelb,status,request)">
 
 	<div tal:repeat="nd nds">
 		<tal:block
@@ -842,7 +842,7 @@
 				<td class="node node_services">
 					<strong class="cluster node">Services on this Node:</strong>
 					<ul class="cluster node">
-						<li tal:condition="python:len(nd['currentservices']) == 0">
+						<li tal:condition="python: len(nd['currentservices']) == 0">
 							No cluster services are currently running here
 						</li>
 						<li class="cluster_service cluster node"
@@ -904,9 +904,8 @@
 
 <div metal:define-macro="nodelogs-form">
 	<h2>Recent Log Activity for <span tal:replace="request/nodename"/></h2>
-  ---------------------------------------------------------------------------------------
-  <br/>
-  <span tal:replace="python:here.getLogsForNode(request)"/>
+	<hr/>
+	<span tal:replace="python: here.getLogsForNode(request)"/>
 </div>
 
 <div metal:define-macro="nodeadd-form">
@@ -974,7 +973,8 @@
 </div>
 
 <div metal:define-macro="nodeprocess-form">
-      <span tal:define="result python:here.nodeTaskProcess(modelb, request)"/>
+	<tal:block
+		tal:define="result python: here.nodeTaskProcess(modelb, request)"/>
 	<h2>Node Process Form</h2>
 </div>
 
@@ -985,9 +985,9 @@
 <div metal:define-macro="servicelist-form">
 	<tal:block tal:omit-tag=""
 		tal:define="
-			global ricci_agent python:here.getRicciAgentForCluster(request);
-			global svcstatus python:here.getClusterStatus(ricci_agent);
-			global svcinf python:here.getServicesInfo(svcstatus,modelb,request);
+			global ricci_agent python: here.getRicciAgentForCluster(request);
+			global svcstatus python: here.getClusterStatus(ricci_agent);
+			global svcinf python: here.getServicesInfo(svcstatus,modelb,request);
 			global svcs svcinf/services" />
 
 	<tal:block tal:repeat="svc svcs">
@@ -1015,7 +1015,7 @@
 			</tr>
 
 			<tr class="cluster service info_middle">
-				<td class="cluster service service_nodename"> 
+				<td class="cluster service service_nodename">
 					<div class="cluster service service_status">
 						<strong class="cluster service service_name">Status:</strong>
 						<tal:block tal:condition="running">
@@ -1046,29 +1046,29 @@
 </div>
 
 <div metal:define-macro="servicestart">
-	<span tal:define="global ricci_agent python:here.getRicciAgentForCluster(request)"/>
-	<span tal:define="result python:here.serviceStart(ricci_agent, request)"/>
+	<span tal:define="global ricci_agent python: here.getRicciAgentForCluster(request)"/>
+	<span tal:define="result python: here.serviceStart(ricci_agent, request)"/>
 	<!-- <span metal:use-macro="here/form-macros/macros/serviceconfig-form"/> -->
 </div>
 
 
 <div metal:define-macro="servicerestart">
-	<span tal:define="global ricci_agent python:here.getRicciAgentForCluster(request)"/>
-	<span tal:define="result python:here.serviceRestart(ricci_agent, request)"/>
+	<span tal:define="global ricci_agent python: here.getRicciAgentForCluster(request)"/>
+	<span tal:define="result python: here.serviceRestart(ricci_agent, request)"/>
 	<!-- <span metal:use-macro="here/form-macros/macros/serviceconfig-form"/> -->
 </div>
 
 <div metal:define-macro="servicestop">
-	<span tal:define="global ricci_agent python:here.getRicciAgentForCluster(request)"/>
-	<span tal:define="result python:here.serviceStop(ricci_agent,request)"/>
+	<span tal:define="global ricci_agent python: here.getRicciAgentForCluster(request)"/>
+	<span tal:define="result python: here.serviceStop(ricci_agent,request)"/>
 	<!-- <span metal:use-macro="here/form-macros/macros/serviceconfig-form"/> -->
 </div>
 
 <div metal:define-macro="serviceconfig-form">
 	<tal:block tal:define="
-		global ricci_agent python:here.getRicciAgentForCluster(request);
-		global sstat python:here.getClusterStatus(ricci_agent);
-		global sinfo python:here.getServiceInfo(sstat, modelb,request);
+		global ricci_agent python: here.getRicciAgentForCluster(request);
+		global sstat python: here.getClusterStatus(ricci_agent);
+		global sinfo python: here.getServiceInfo(sstat, modelb,request);
 		global running sinfo/running | nothing;" />
 
 	<table class="cluster service" width="100%">
@@ -1115,7 +1115,7 @@
 	<br/>
 	<h2>Service Composition</h2>
 	<ul tal:define="global svc_rcs sinfo/resource_list">
-	    <li tal:repeat="res svc_rcs">
+		<li tal:repeat="res svc_rcs">
 			<ul tal:define="
 				global type res/type;
 				global ref res/ref_object | nothing">
@@ -1124,29 +1124,29 @@
 					<span tal:omit-tag="" tal:define="global shared string:true"/>
 				</tal:block>
 
-				<div class="" tal:attributes="class python:'rc_indent' + str(res['indent_ctr'])">
-					<span tal:omit-tag="" tal:condition="python:type == 'IP Address: '">
+				<div class="" tal:attributes="class python: 'rc_indent' + str(res['indent_ctr'])">
+					<span tal:omit-tag="" tal:condition="python: type == 'IP Address: '">
 						<li metal:use-macro="here/resource-form-macros/macros/ip_macro"/>
 					</span>
-					<span tal:omit-tag="" tal:condition="python:type == 'fs'">
+					<span tal:omit-tag="" tal:condition="python: type == 'fs'">
 						<li metal:use-macro="here/resource-form-macros/macros/fs_macro"/>
 					</span>
-					<span tal:omit-tag="" tal:condition="python:type == 'gfs'">
+					<span tal:omit-tag="" tal:condition="python: type == 'gfs'">
 						<li metal:use-macro="here/resource-form-macros/macros/gfs_macro"/>
 					</span>
-					<span tal:omit-tag="" tal:condition="python:type == 'nfsm'">
+					<span tal:omit-tag="" tal:condition="python: type == 'nfsm'">
 						<li metal:use-macro="here/resource-form-macros/macros/nfsm_macro"/>
 					</span>
-					<span tal:omit-tag="" tal:condition="python:type == 'nfsx'">
+					<span tal:omit-tag="" tal:condition="python: type == 'nfsx'">
 						<li metal:use-macro="here/resource-form-macros/macros/nfsx_macro"/>
 					</span>
-					<span tal:omit-tag="" tal:condition="python:type == 'nfsc'">
+					<span tal:omit-tag="" tal:condition="python: type == 'nfsc'">
 						<li metal:use-macro="here/resource-form-macros/macros/nfsc_macro"/>
 					</span>
-					<span tal:omit-tag="" tal:condition="python:type == 'smb'">
+					<span tal:omit-tag="" tal:condition="python: type == 'smb'">
 						<li metal:use-macro="here/resource-form-macros/macros/smb_macro" />
 					</span>
-					<span tal:omit-tag="" tal:condition="python:type == 'Script: '">
+					<span tal:omit-tag="" tal:condition="python: type == 'Script: '">
 						<li metal:use-macro="here/resource-form-macros/macros/scr_macro" />
 					</span>
 				</div>
@@ -1192,68 +1192,69 @@
 </div>
 
 <div metal:define-macro="fdomlist-form">
-   <span tal:define="ragent python:here.getRicciAgentForCluster(request);
-              global sta python:here.getClusterStatus(ragent);
-              global fdominfo python:here.getFdomsInfo(modelb, request, sta);">
-   <span tal:repeat="fdom fdominfo">
-    <div class="fdomname">
-     <img src="fDom.png"/><h2>Failover Domain Name: <font color="blue"><a href="" tal:attributes="href fdom/cfgurl"><span tal:content="fdom/name"/></a></font></h2>
-    </div>
-    <div class="fdomordered">
-    <span tal:condition="python:fdom['ordered'] == True">
-     <h4>This Failover Domain is <i>Ordered</i></h4>
-    </span>
-    <span tal:condition="python:fdom['ordered'] == False">
-     <h4>This Failover Domain is <i>Unordered</i></h4>
-    </span>
-    </div>
-    <div class="fdomrestricted">
-    <span tal:condition="python:fdom['restricted'] == True">
-     <h4>This Failover Domain is <i>Restricted</i></h4>
-    </span>
-    <span tal:condition="python:fdom['restricted'] == False">
-     <h4>This Failover Domain is <i>Unrestricted</i></h4>
-    </span>
-    </div>
-    <div class="fdommembers">
-    <h3>Members of this Failover Domain</h3>
-    <ul>
-     <span tal:repeat="node fdom/nodeslist">
-        <li style="list-style-image: url(small_node_active.png);" tal:condition="python:node['status'] == '0'">
-         <a href="" tal:attributes="href node/nodecfgurl"><font color="green"><span tal:content="node/nodename"/></font></a>
-        </li>
-        <li style="list-style-image: url(small_node_inactive.png);" tal:condition="python:node['status'] == '1'">
-         <a href="" tal:attributes="href node/nodecfgurl"><font color="red"><span tal:content="node/nodename"/></font></a>
-        </li>
-        <li style="list-style-image: url(small_node_unknown.png);" tal:condition="python:node['status'] == '2'">
-         <a href="" tal:attributes="href node/nodecfgurl"><font color="gray"><span tal:content="node/nodename"/></font></a>
-        </li>
-     </span>
-    </ul>
-    </div>
-    <div class="fdomservice">
-      <h2>Services employing this Failover Domain: </h2>
-        <ul>
-          <span tal:condition="python:len(fdom['svclist']) < 1">
-           <li><i>No Services Defined</i></li>
-          </span>
-          <span tal:repeat="svc fdom/svclist">
-            <span tal:condition="python:svc['status'] == 'true'">
-             <li style="list-style-image:url(small_svc.png);">
-              <a href="" tal:attributes="href svc/svcurl"><font color="green"><span tal:content="svc/name"/></font></a> Running On Node <span tal:content="svc/location"/>
-             </li>
-            </span>
-            <span tal:condition="python:svc['status'] != 'true'">
-             <li style="list-style-image:url(small_svc_stopped.png);">
-              <a href="" tal:attributes="href svc/svcurl"><font color="red"><span tal:content="svc/name"/></font></a> Not Running
-             </li>
-            </span>
-        </span>
-       </ul>
-    </div>
-   </span>
-   <hr/>
-  </span>
+	<tal:block
+		tal:define="
+			global ragent python: here.getRicciAgentForCluster(request);
+			global sta python: here.getClusterStatus(ragent);
+			global fdominfo python: here.getFdomsInfo(modelb, request, sta);" />
+
+	<div class="cluster fdom" tal:repeat="fdom fdominfo">
+	<div class="cluster fdom fdomname">
+		<img src="fDom.png"/>
+		<strong class="cluster fdom">Failover Domain Name<strong>:
+		<a class="cluster fdom_link"
+			tal:attributes="href fdom/cfgurl"
+			tal:content="fdom/name" />
+	</div>
+
+	<div class="fdomordered">
+		<h4>This Failover Domain is
+		<strong>
+			<span tal:replace="python: fdom['ordered'] == True and 'Ordered' or 'Unordered'" />
+		</strong>
+	</div>
+
+	<div class="fdomrestricted">
+		<h4>This Failover Domain is <span tal:replace="python: fdom['restricted'] == True and 'Restricted' or 'Unrestricted'"/></h4>
+	</div>
+
+	<div class="fdommembers">
+		<h3>Members of this Failover Domain</h3>
+		<ul class="cluster node">
+			<tal:block tal:repeat="node fdom/nodeslist">
+				<tal:block
+					tal:define="global nodeclass python: 'cluster ' + (node['status'] == '0' and 'node_active' or (node['status'] == '1' and 'node_inactive' or 'node_unknown'));" />
+				<li tal:attributes="class python: nodeclass">
+					<a tal:content="node/nodename"
+						tal:attributes="
+							href node/configurl;
+							class python: nodeclass;" />
+				</li>
+			</tal:block>
+		</ul>
+	</div>
+
+	<div class="fdomservice">
+		<h2>Services employing this Failover Domain: </h2>
+		<ul>
+			<tal:block tal:condition="python: len(fdom['svclist']) < 1">
+				<li>No Services Defined</li>
+			</tal:block>
+			<tal:block tal:repeat="svc fdom/svclist">
+				<tal:block
+					tal:define="global svcclass python: svc['status'] == 'true' and 'running' or 'stopped'" />
+
+				<li tal:attributes="class python: 'cluster cluster_service ' + svcclass">
+					<a tal:content="python: svc['name'] + ' ' + (svcclass == 'running' and ('Running on node ' + svc['location']) or 'Not running')"
+						tal:attributes="href svc/svcurl;
+							class python: 'cluster cluster_service ' + svcclass" />
+				</li>
+			</tal:block>
+		</ul>
+		<hr/>
+	</div>
+
+	</div>
 </div>
 
 <div metal:define-macro="fdomadd-form">
--- conga/luci/cluster/resource-form-macros	2006/08/10 23:06:20	1.4
+++ conga/luci/cluster/resource-form-macros	2006/08/29 23:22:59	1.5
@@ -1,692 +1,909 @@
 <html>
-  <head>
-    <title tal:content="template/title">The title</title>
-  </head>
-  <body>
-  <div metal:define-macro="resources-form">
-    <h2>
-    Resources for <span tal:content="request/clustername" />
-    </h2>
-    <span tal:define="global rescInf python:here.getResourcesInfo(modelb, request)"/>
-    <span tal:define="msg python:here.appendModel(request, modelb)"/>
-    <table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
-      <thead>
-        <tr border="0" cellspacing="5" align="left">
-          <th width="100">Resource Name</th>
-          <th width="100">Type</th>
-          <th width="75">Link</th>
-          <th width="75">Configure</th>
-          <th width="75">Delete</th>
-        </tr>
-      </thead>
-      <span tal:repeat="rs rescInf">
-        <tr border="0" cellspacing="5">
-          <td tal:content="rs/name" />
-          <td tal:content="rs/type" />
-          <td>
-            <a href="" tal:attributes="HREF rs/url" />
-            details
-          </td>
-          <td>
-            <a href="" tal:attributes="HREF rs/cfgurl" />
-            configure
-          </td>
-          <td>
-            <a href="" tal:attributes="HREF rs/delurl" />
-            delete
-          </td>
-        </tr>
-      </span>
-    </table>
-  </div>
-  <div metal:define-macro="resourceslist-form">
-   <h2>Resources List Form</h2>
-  </div>
-  <div metal:define-macro="resourceremove-form">
-   <h2>Resources Remove Form</h2>
-   <span tal:define="global cluname request/clustername;
-                     global ragent python:here.getRicciAgentForCluster(request);"/>
-   <span tal:define="global edited request/edit|nothing" />
-   <span tal:define="global msg python:here.delResource(request, ragent)" />
-   <div tal:condition="msg" tal:content="msg">Something returned from delResource().</div>
-  </div>
-  <div metal:define-macro="resourceadd-form">
-      <script type="text/javascript" src="luci/cluster/resource_form_handlers.js" />  
-      <h2>Add a Resource</h2>
-      <strong>Select Resource Type:</strong><br/>
-      <form name="filler">
-	<select name="select_div" onChange="swap_div('container', filler.select_div.options[filler.select_div.selectedIndex].value);">
-	  <option name="blank" value="blank">Select a resource type</option>
-	  <option name="IP" value="IP">IP Resource</option>
-	  <option name="FS" value="FS">FS Resource</option>
-	  <option name="GFS" value="GFS">GFS Resource</option>
-	  <option name="NFSM" value="NFSM">NFS Mount Resource</option>
-	  <option name="NFSC" value="NFSC">NFS Client Resource</option>
-	  <option name="NFSX" value="NFSX">NFS Export Resource</option>
-	  <option name="SCR" value="SCR">Script Resource</option>
-	  <option name="SMB" value="SMB">Samba Resource</option>
+<head>
+	<title tal:content="template/title">The title</title>
+</head>
+<body>
+
+
+<div metal:define-macro="resources-form">
+	<h2>Resources for <span tal:replace="request/clustername" /></h2>
+
+	<tal:block
+		tal:define="
+			global rescInf python: here.getResourcesInfo(modelb, request);
+			global msg python: here.appendModel(request, modelb)" />
+
+	<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
+		<thead class="systemsTable">
+			<tr class="systemsTable">
+				<th class="systemsTable" width="100">Resource Name</th>
+				<th class="systemsTable" width="100">Type</th>
+				<th class="systemsTable" width="75">Link</th>
+				<th class="systemsTable" width="75">Configure</th>
+				<th class="systemsTable" width="75">Delete</th>
+			</tr>
+		</thead>
+
+		<tr class="systemsTable" tal:repeat="rs rescInf">
+			<td class="systemsTable" tal:content="rs/name" />
+			<td class="systemsTable" tal:content="rs/type" />
+			<td class="systemsTable">
+				<a class="cluster resource"
+					tal:content="string: details"
+					tal:attributes="href rs/url" />
+			</td>
+			<td class="systemsTable">
+				<a class="cluster resource"
+					tal:content="string: configure"
+					tal:attributes="href rs/cfgurl" />
+			</td>
+			<td class="systemsTable">
+				<a class="cluster resource"
+					tal:content="string: delete"
+					tal:attributes="href rs/delurl" />
+			</td>
+		</tr>
+	</table>
+</div>
+
+
+<div metal:define-macro="resourceslist-form">
+	<h2>Resources List Form</h2>
+</div>
+
+
+<div metal:define-macro="resourceremove-form">
+	<h2>Resources Remove Form</h2>
+
+	<tal:block
+		tal:define="
+				global cluname request/clustername;
+				global ragent python: here.getRicciAgentForCluster(request);
+				global edited request/edit | nothing;
+				global msg python: here.delResource(request, ragent)" />
+
+	<div tal:condition="msg" tal:content="msg" />
+</div>
+
+<div metal:define-macro="resourceadd-form">
+	<script type="text/javascript"
+		src="/luci/cluster/resource_form_handlers.js">
+	</script>
+
+	<h2>Add a Resource</h2>
+	<strong>Select Resource Type</strong><br/>
+
+	<form name="filler">
+	<select name="select_div"
+		onChange="swap_div('container', filler.select_div.options[filler.select_div.selectedIndex].value);">
+
+		<option name="blank" value="blank">Select a resource type</option>
+		<option name="IP" value="IP">IP Resource</option>
+		<option name="FS" value="FS">FS Resource</option>
+		<option name="GFS" value="GFS">GFS Resource</option>
+		<option name="NFSM" value="NFSM">NFS Mount Resource</option>
+		<option name="NFSC" value="NFSC">NFS Client Resource</option>
+		<option name="NFSX" value="NFSX">NFS Export Resource</option>
+		<option name="SCR" value="SCR">Script Resource</option>
+		<option name="SMB" value="SMB">Samba Resource</option>
 	</select>
-      </form>
-      <table class="systemsTable" border="0" cellspacing="1">
-      <tr><td id="container" width="400">	  
-	&nbsp
-      </td></tr>
-      </table>
-      <div id="invisible" style="display: none">
-        <div id="blank">&nbsp</div>
-  	<div metal:use-macro="here/resource-form-macros/macros/ip_macro"/>
-	<div metal:use-macro="here/resource-form-macros/macros/fs_macro"/>
-	<div metal:use-macro="here/resource-form-macros/macros/gfs_macro"/>
-	<div metal:use-macro="here/resource-form-macros/macros/nfsm_macro"/>
-        <div metal:use-macro="here/resource-form-macros/macros/nfsx_macro"/>
-        <div metal:use-macro="here/resource-form-macros/macros/nfsc_macro"/>
-        <div metal:use-macro="here/resource-form-macros/macros/smb_macro"/>
-        <div metal:use-macro="here/resource-form-macros/macros/scr_macro"/>
-      </div>
-    </div>
-
-  <div metal:define-macro="resource-form">
-    <span tal:define="global res python:here.getResourceInfo(modelb, request)"/>
-    <h2>Resource details for <span tal:content="res/name" /></h2>
-    <table class="systemsTable" border="0" cellspacing="5">
-      <thead  align="left">
-        <th width="100">Name</th>
-        <th width="100">Type</th>
-        <th width="75">Configure</th>
-      </thead>
-      <tr align="left">
-        <td tal:content="res/name" />
-        <td tal:content="res/tag_name" />
-        <td>
-        <a href="" tal:attributes="HREF res/cfgurl" />
-        configure
-        </td>
-      </tr>
-    </table>
-  </div>
-
-
-  <div metal:define-macro="resourceprocess-form">
-   <span tal:define="global cluname request/clustername;
-                     global ragent python:here.getRicciAgentForCluster(request);"/>
-   <span tal:define="global edited request/edit|nothing" />
-   <h2 tal:condition="not: edited">Resource Added</h2>
-   <h2 tal:condition="edited">Resource Edited</h2>
-   <span tal:define="global msg python:here.addResource(request, ragent)" />
-   <div tal:condition="msg" tal:content="msg">Something returned from addResource.</div>
-  </div>
-
-  <div metal:define-macro="resourceconfig-form">
-    <script type="text/javascript" src="luci/cluster/resource_form_handlers.js" />
-    <span tal:define="msg python:here.appendModel(request, modelb)"/>
-    <span tal:define="global restoedit request/resourcename|nothing"/>
-    <span tal:condition="restoedit">
-      <span tal:define="global res python:here.getResourceInfo(modelb, request)" />
-      <span tal:define="global type res/tag_name" />
-      <h2>Configure <span tal:content="res/name" /></h2>
-      <span tal:omit-tag="" tal:condition="python:type == 'ip'">
-       <div metal:use-macro="here/resource-form-macros/macros/ip_macro"/>
-      </span>
-      <span tal:omit-tag="" tal:condition="python:type == 'fs'">
-        <div metal:use-macro="here/resource-form-macros/macros/fs_macro"/>
-      </span>
-      <span tal:omit-tag="" tal:condition="python:type == 'gfs'">
-        <div metal:use-macro="here/resource-form-macros/macros/gfs_macro"/>
-      </span>
-      <span tal:omit-tag="" tal:condition="python:type == 'nfsm'">
-        <div metal:use-macro="here/resource-form-macros/macros/nfsm_macro"/>
-      </span>
-      <span tal:omit-tag="" tal:condition="python:type == 'nfsx'">
-        <div metal:use-macro="here/resource-form-macros/macros/nfsx_macro"/>
-      </span>
-      <span tal:omit-tag="" tal:condition="python:type == 'nfsc'">
-        <div metal:use-macro="here/resource-form-macros/macros/nfsc_macro"/>
-      </span>
-      <span tal:omit-tag="" tal:condition="python:type == 'smb'">
-        <div metal:use-macro="here/resource-form-macros/macros/smb_macro" />
-      </span>
-      <span tal:omit-tag="" tal:condition="python:type == 'script'">
-        <div metal:use-macro="here/resource-form-macros/macros/scr_macro" />
-      </span>
-    </span>
-  </div>
-
-  <div id="IP" metal:define-macro="ip_macro">
-    <span tal:condition="python:ptype == '33' or ptype == '24'">
-      <span tal:define="
-        global edit python:True;
-        global resName res/name;
-        global address python:resName.split('.');
-        global ip1 python:address[0];
-        global ip2 python:address[1];
-        global ip3 python:address[2];
-        global ip4 python:address[3];
-	global monitor_link res/attrs/monitor_link|nothing;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
-    </span>
-
-    <span tal:condition="python:ptype != '33'">
-      <span tal:define="
-            global edit python:False;
-	    global monitor_link string:1;
-            global cluname request/clustername;
-            tmp_URL context/cluster/index_html/absolute_url;
-            global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
-    </span>
-    <strong>IP Address Resource Configuration</strong>
-    <form name="ip_form" id="ip_form" method="get" tal:attributes="action processURL">
-      <input name="pagetype" type="hidden" value="35"/>
-      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
-      <input name="oldname" type="hidden"
-             tal:attributes="value res/name"
-             tal:condition="python:edit == True" />
-      <input name="edit" type="hidden" value="1"
-             tal:condition="python:edit == True" />
-     <input name="type" type="hidden" value="ip"/>
-      <table id="ipResourceTable" border="0" cellspacing="0" width="200" style="background-color: #dee7ec">
-        <tr>
-          <div>
-    	    <strong>IP:</strong>
-    	    <input size="3" name="ip1" type="text" maxlength="3" tal:attributes="VALUE ip1|nothing"/>.
-            <input size="3" name="ip2" type="text" maxlength="3" tal:attributes="VALUE ip2|nothing"/>.
-            <input size="3" name="ip3" type="text" maxlength="3" tal:attributes="VALUE ip3|nothing"/>.
-            <input size="3" name="ip4" type="text" maxlength="3" tal:attributes="VALUE ip4|nothing"/>
-          </div>
-          <div>
-    	    <strong>Monitor Link</strong>
-	    <span tal:condition="python: monitor_link == '1'">
-	      <input type="checkbox" name="monitorLink" checked >
-	    </span>
-	    <span tal:condition="python: monitor_link == '0'">
-	      <input type="checkbox" name="monitorLink">
-	    </span>
-          </div>
-        </tr>
-      </table>
-    </form>
-    <input name="submitButton" type="button" value="Submit" onClick="validate(ip_form);" />
-  </div>
-  <div id="FS" metal:define-macro="fs_macro">
-    <span tal:condition="python:ptype == '33' or ptype == '24'">
-      <span tal:define="
-        global edit python:True;
-        global resName res/name;
-        global mountPoint res/attrs/mountpoint;
-        global device res/attrs/device;
-        global fstype res/attrs/fstype;
-        global opt res/attrs/options;
-        global fsid res/attrs/fsid;
-        global force_unmount res/attrs/force_unmount;
-        global reboot_fail res/attrs/self_fence;
-        global fscheck res/attrs/force_fsck;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
-    </span>
-    <span tal:condition="python:ptype != '33'">
-      <span tal:define="
-        global edit python:False;
-        global force_unmount string:0;
-        global reboot_fail string:0;
-	global fstype string:0;
-        global fscheck string:0;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
-    </span>
-    <strong>File System Resource Configuration</strong>
-      <form name="fs_form" action="" method="get" tal:attributes="action processURL">
-      <input name="pagetype" type="hidden" value="35"/>
-      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
-      <input name="oldname" type="hidden"
-             tal:attributes="value res/name"
-             tal:condition="python:edit == True" />
-      <input name="edit" type="hidden" value="1"
-             tal:condition="python:edit == True" />
-     <input name="type" type="hidden" value="fs"/>
-      <table id="fileSystemTable" border="0" cellspacing="0">
-        <tr>
-          <div>
-	    <strong>Resource Name:</strong>
-    	    <input type="text" size="20" id="resourceName" name="resourceName" tal:attributes="value resName|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>File System Type:</strong>
-	    <select id="fstype" name="fstype">
-	      <span tal:condition="python: edit == nothing or fstype == 'ext2'">
-    	        <option name="ext2" value="ext2">ext2</option>
-                <option name="ext3" value="ext3" selected>ext3</option>
-	      </span>
-	      <span tal:condition="python: edit == True and fstype != 'ext3'">
-    	        <option name="ext2" value="ext2" selected>ext2</option>
-                <option name="ext3" value="ext3">ext3</option>
-	      </span>
-	    </select>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Mount Point:</strong>
-	    <input type="text" size="20" id="mountpoint" name="mountpoint" tal:attributes="value mountPoint|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Device:</strong>
-	    <input type="text" size="20" id="device" name="device" tal:attributes="value device|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Options:</strong>
-	    <input type="text" size="20" id="options" name="options" tal:attributes="value opt|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>File System ID:</strong>
-    	    <input type="text" size="20" id="fsid" name="fsid" tal:attributes="value fsid|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <input type="checkbox" id="forceunmount" name="forceunmount" checked 
-                   tal:condition="python:force_unmount == '1'"/>
-	    <input type="checkbox" id="forceunmount" name="forceunmount"
-                   tal:condition="python:force_unmount != '1'"/>
-	    <strong>Force unmount</strong>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <input type="checkbox" id="selffence" name="selffence" 
-                   tal:condition="not: reboot_fail| python:reboot_fail == '1'"/>
-	    <input type="checkbox" id="selffence" name="selffence" 
-                   tal:condition="python:reboot_fail != '1'"/>
-	    <strong>Reboot host node if unmount fails</strong>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <input type="checkbox" id="checkfs" name="checkfs" checked
-                   tal:condition="python:fscheck == '1'"/>
-	    <input type="checkbox" id="checkfs" name="checkfs"
-                   tal:condition="python:fscheck != '1'"/>
-    	    <strong>Check file system before mounting</strong>
-          </div>
-        </tr>	    	    
-      </table>
-    </form>
-    <input type="button" value="Submit" onClick="validate(fs_form);"/>
-  </div>
-  <div id="GFS" metal:define-macro="gfs_macro">
-    <span tal:condition="python:ptype == '33' or ptype =='24'">
-      <span tal:define="
-        global edit python:True;
-        global resName res/name;
-        global mountPoint res/attrs/mountpoint;
-        global device res/attrs/device;
-        global fstype res/attrs/fstype;
-        global opt res/attrs/options;
-        global fsid res/attrs/fsid;
-        global force_unmount res/attrs/force_unmount;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
-    </span>
-    <span tal:condition="python:ptype != '33'">
-      <span tal:define="
-        global edit python:False;
-        global force_unmount string:0;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
-    </span>
-    <strong>GFS Resource Configuration</strong>
-    <form name="gfs_form" action="" method="post" tal:attributes="action processURL">
-      <input name="pagetype" type="hidden" value="35"/>
-      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
-      <input name="oldname" type="hidden"
-             tal:attributes="value res/name"
-             tal:condition="python:edit == True" />
-      <input name="edit" type="hidden" value="1"
-             tal:condition="python:edit == True" />
-     <input name="type" type="hidden" value="gfs"/>
-      <table id="gfsTable" border="0" cellspacing="0">
-        <tr>
-          <div>
-	    <strong>Resource Name:</strong>
-    	    <input type="text" size="20" id="resourceName" name="resourceName"
-                   tal:attributes="value resName|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Mount Point:</strong>
-	    <input type="text" size="20" id="mountPoint" name="mountpoint" 
-                   tal:attributes="value mountpoint|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Device:</strong>
-	    <input type="text" size="20" id="device" name="device" 
-                   tal:attributes="value device|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Options:</strong>
-	    <input type="text" size="20" id="options" name="options" 
-                   tal:attributes="value opt|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>File System ID:</strong>
-    	    <input type="text" size="20" id="fsid" name="fsid" 
-                   tal:attributes="value fsid|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <input type="checkbox" id="forceunmount" name="forceunmount" checked 
-                   tal:condition="python:force_unmount == '1'"/>
-	    <input type="checkbox" id="forceunmount" name="forceunmount"
-                   tal:condition="python:force_unmount != '1'"/>
-	    <strong>Force unmount</strong>
-          </div>
-        </tr>
-      </table>
-    </form>
-    <input type="button" value="Submit" onclick="validate(gfs_form);"/>
-    </div>
-
-  <div id="NFSM" metal:define-macro="nfsm_macro">
-    <span tal:condition="python:ptype == '33' or ptype =='24'">
-      <span tal:define="
-        global edit python:True;
-        global resName res/name;
-        global mountpoint res/attrs/mountpoint;
-        global opt res/attrs/options;
-        global expath res/attrs/export;
-        global nfstype res/attrs/fstype;
-        global hostname res/attrs/host;
-        global force_unmount res/attrs/force_unmount;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
-    </span>
-    <span tal:condition="python:ptype != '33'">
-      <span tal:define="
-        global edit python:False;
-        global force_unmount string:0;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
-    </span>
-  <strong>NFS Mount Resource Configuration</strong>
-  <form name="nfsm_form" action="" method="post">
-    <form name="gfs_form" action="" method="post" tal:attributes="action processURL">
-      <input name="pagetype" type="hidden" value="35"/>
-      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
-      <input name="oldname" type="hidden"
-             tal:attributes="value res/name"
-             tal:condition="python:edit == True" />
-      <input name="edit" type="hidden" value="1"
-             tal:condition="python:edit == True" />
-      <input name="type" type="hidden" value="nfsm"/>
-      <table id="nfsMountTable" border="0" cellspacing="0">
-        <tr>
-          <div>
-	    <strong>Resource Name:</strong>
-    	    <input type="text" size="20" id="resourceName" name="resourceName"
-                   tal:attributes="value resName|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Mount Point:</strong>
-	    <input type="text" size="20" id="mountpoint" name="mountpoint" 
-                   tal:attributes="value mountpoint|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Host:</strong>
-	    <input type="text" size="20" id="host" name="host" 
-                   tal:attributes="value hostname|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Export Path:</strong>
-    	    <input type="text" size="20" id="exportpath" name="exportpath"
-                   tal:attributes="value expath|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <span tal:condition="python: edit == nothing or nfstype == 'nfs'">
-    	      <input type="radio" name="nfstype" value="nfs" checked>NFS
-	      <input type="radio" name="nfstype" value="nfs4">NFS4
-	    </span>
-	    <span tal:condition="python: edit == True and nfstype != 'nfs4'">
-    	      <input type="radio" name="nfstype" value="nfs">NFS
-	      <input type="radio" name="nfstype" value="nfs4" checked>NFS4
-	    </span>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Options:</strong>
-	    <input type="text" size="20" id="options" name="options" 
-                   tal:attributes="value opt|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <input type="checkbox" id="forceunmount" name="forceunmount" checked 
-                   tal:condition="python:force_unmount == '1'"/>
-	    <input type="checkbox" id="forceunmount" name="forceunmount"
-                   tal:condition="python:force_unmount != '1'"/>
-	    <strong>Force unmount</strong>
-          </div>
-        </tr>
-      </table>
-    </form>
-    <input type="button" value="Submit" onclick="validate(nfsm_form);"/>
-  </div>
-
-  <div id="NFSC" metal:define-macro="nfsc_macro">
-    <span tal:condition="python:ptype == '33' or ptype == '24'">
-      <span tal:define="
-        global edit python:True;
-        global resName res/name;
-        global target res/attrs/target;
-        global opt res/attrs/options;
-        global expath res/attrs/readOnly|nothing;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
-    </span>
-    <span tal:condition="python:ptype != '33'">
-      <span tal:define="
-        global edit python:False;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
-    </span>
-    <strong>NFS Client Resource Configuration</strong>
-    <form name="nfsc_form" action="" method="post" tal:attributes="action processURL">
-      <input name="pagetype" type="hidden" value="35"/>
-      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
-      <input name="oldname" type="hidden"
-             tal:attributes="value res/name"
-             tal:condition="python:edit == True" />
-      <input name="edit" type="hidden" value="1"
-             tal:condition="python:edit == True" />
-      <input name="type" type="hidden" value="nfsc"/>
-      <table id="nfsClientTable" border="0" cellspacing="0">
-        <tr>
-          <div>
-	    <strong>Resource Name:</strong>
-    	    <input type="text" size="20" id="resourceName" name="resourceName"
-                   tal:attributes="value resName|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Target:</strong>
-	    <input type="text" size="20" id="target" name="target" 
-                   tal:attributes="value target|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Options:</strong>
-	    <input type="text" size="20" id="options" name="options" 
-                   tal:attributes="value opt|nothing"/>
-          </div>
-        </tr>
-      </table>
-    </form>
-    <input type="button" value="Submit" onclick="validate(nfsc_form);"/>
-  </div>
+	</form>
+
+	<table class="systemsTable">
+		<tr class="systemsTable">
+			<td class="systemsTable" id="container" width="400">
+				&nbsp
+			</td></tr>
+	</table>
+
+	<div id="invisible" style="display: none">
+		<div id="blank">&nbsp</div>
+		<div metal:use-macro="here/resource-form-macros/macros/ip_macro"/>
+		<div metal:use-macro="here/resource-form-macros/macros/fs_macro"/>
+		<div metal:use-macro="here/resource-form-macros/macros/gfs_macro"/>
+		<div metal:use-macro="here/resource-form-macros/macros/nfsm_macro"/>
+		<div metal:use-macro="here/resource-form-macros/macros/nfsx_macro"/>
+		<div metal:use-macro="here/resource-form-macros/macros/nfsc_macro"/>
+		<div metal:use-macro="here/resource-form-macros/macros/smb_macro"/>
+		<div metal:use-macro="here/resource-form-macros/macros/scr_macro"/>
+	</div>
+</div>
+
+<div metal:define-macro="resource-form">
+	<tal:block
+		tal:define="global res python: here.getResourceInfo(modelb, request)" />
+
+	<h2>Resource details for <span tal:replace="res/name" /></h2>
+
+	<table class="systemsTable">
+		<thead class="systemsTable">
+			<th class="systemsTable" width="100">Name</th>
+			<th class="systemsTable" width="100">Type</th>
+			<th class="systemsTable" width="75">Configure</th>
+		</thead>
+		<tr class="systemsTable">
+			<td class="systemsTable" tal:content="res/name" />
+			<td class="systemsTable" tal:content="res/tag_name" />
+			<td>
+				<a class="cluster resource"
+					tal:content="string: configure"
+					tal:attributes="href res/cfgurl" />
+			</td>
+		</tr>
+	</table>
+</div>
+
+
+<div metal:define-macro="resourceprocess-form">
+	<tal:block
+		tal:define="
+			global cluname request/clustername;
+			global edited request/edit | nothing;
+			global ragent python: here.getRicciAgentForCluster(request)" />
+
+	<h2>Resource <span tal:replace="python: request['edit'] and 'Edited' or 'Added'" /></h2>
+
+	<tal:block
+		tal:define="global msg python: here.addResource(request, ragent)" />
+	<div tal:condition="msg" tal:content="msg" />
+</div>
+
+<div metal:define-macro="resourceconfig-form">
+	<script type="text/javascript"
+		src="luci/cluster/resource_form_handlers.js">
+	</script>
+
+	<tal:block tal:define="
+		global msg python: here.appendModel(request, modelb);
+		global restoedit request/resourcename | nothing" />
+
+	<tal:block tal:condition="restoedit">
+		tal:define="
+			global res python: here.getResourceInfo(modelb, request);
+			global type res/tag_name">
+
+		<h2>Configure <span tal:replace="res/name"/></h2>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'ip'">
+			<div metal:use-macro="here/resource-form-macros/macros/ip_macro"/>
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'fs'">
+			<div metal:use-macro="here/resource-form-macros/macros/fs_macro"/>
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'gfs'">
+			<div metal:use-macro="here/resource-form-macros/macros/gfs_macro"/>
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'nfsm'">
+			<div metal:use-macro="here/resource-form-macros/macros/nfsm_macro"/>
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'nfsx'">
+			<div metal:use-macro="here/resource-form-macros/macros/nfsx_macro"/>
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'nfsc'">
+			<div metal:use-macro="here/resource-form-macros/macros/nfsc_macro"/>
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'smb'">
+			<div metal:use-macro="here/resource-form-macros/macros/smb_macro" />
+		</span>
+
+		<span tal:omit-tag="" tal:condition="python: type == 'script'">
+			<div metal:use-macro="here/resource-form-macros/macros/scr_macro" />
+		</span>
+	</tal:block>
+</div>
+
+<div id="IP" metal:define-macro="ip_macro">
+
+<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
+	tal:define="
+		global edit python: True;
+		global resName res/name;
+		global address python: resName.split('.');
+		global ip1 python: address[0];
+		global ip2 python: address[1];
+		global ip3 python: address[2];
+		global ip4 python: address[3];
+		global monitor_link res/attrs/monitor_link | nothing;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
+
+<tal:block
+	tal:condition="python: ptype != '33'"
+	tal:define="
+		global edit python: False;
+		global monitor_link string:1;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+
+	<strong>IP Address Resource Configuration</strong>
+
+	<form name="ip_form" id="ip_form" method="get"
+		tal:attributes="action processURL">
+
+	<input name="pagetype" type="hidden" value="35"/>
+
+	<input name="clustername" type="hidden" tal:attributes="value cluname"/>
+
+	<input name="oldname" type="hidden"
+		tal:attributes="value res/name"
+		tal:condition="python: edit == True" />
+
+	<input name="edit" type="hidden" value="1"
+		tal:condition="python: edit == True" />
+
+	<input name="type" type="hidden" value="ip"/>
+
+	<table id="ipResourceTable" class="systemsTable">
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>IP</strong>
+			</td>
+			<td class="systemsTable">
+				<input size="3" name="ip1" type="text" maxlength="3" tal:attributes="value ip1 | nothing"/>.
+				<input size="3" name="ip2" type="text" maxlength="3" tal:attributes="value ip2 | nothing"/>.
+				<input size="3" name="ip3" type="text" maxlength="3" tal:attributes="value ip3 | nothing"/>.
+				<input size="3" name="ip4" type="text" maxlength="3" tal:attributes="value ip4 | nothing"/>
+			</td>
+
+			<td class="systemsTable">
+				<strong>Monitor Link</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="checkbox" name="monitorLink"
+					tal:attributes="
+						checked python: monitor_link == '1' and 'checked'" />
+			</td>
+		</tr>
+	</table>
+
+	<input class="hbSubmit" name="submit" type="button" value="Submit"
+		onClick="validate(this.form);" />
+	</form>
+</div>
+
+<div id="FS" metal:define-macro="fs_macro">
+<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
+	tal:define="
+		global edit python: True;
+		global resName res/name;
+		global mountPoint res/attrs/mountpoint;
+		global device res/attrs/device;
+		global fstype res/attrs/fstype;
+		global opt res/attrs/options;
+		global fsid res/attrs/fsid;
+		global force_unmount res/attrs/force_unmount;
+		global reboot_fail res/attrs/self_fence;
+		global fscheck res/attrs/force_fsck;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
+
+<tal:block tal:condition="python: ptype != '33'"
+	tal:define="
+		global edit python: False;
+		global force_unmount string:0;
+		global reboot_fail string:0;
+		global fstype string:0;
+		global fscheck string:0;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+
+	<strong>File System Resource Configuration</strong>
+
+	<form name="fs_form" method="get" tal:attributes="action processURL">
+
+	<input name="pagetype" type="hidden" value="35" />
+
+	<input name="clustername" type="hidden" tal:attributes="value cluname" />
+
+	<input name="oldname" type="hidden"
+		tal:condition="python: edit == True"
+		tal:attributes="value res/name" />
+
+	<input name="edit" type="hidden" value="1"
+		tal:condition="python: edit == True" />
+
+	<input name="type" type="hidden" value="fs" />
+
+	<table id="fileSystemTable" class="systemsTable">
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Resource Name</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20"
+					id="resourceName" name="resourceName"
+					tal:attributes="value resName | nothing"/>
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>File System Type</strong>
+			</td>
+			<td class="systemsTable">
+				<select id="fstype" name="fstype">
+					<option name="ext3" value="ext3"
+						tal:content="string: ext3"
+						tal:attributes="checked python: (edit == nothing or fstype == 'ext3') and 'checked'" />
+					<option name="ext2" value="ext2"
+						tal:content="string: ext2"
+						tal:attributes="checked python: (edit == True and fstype == 'ext2') and 'checked'" />
+				</select>
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Mount Point</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="mountpoint" name="mountpoint"
+					tal:attributes="value mountPoint | nothing"/>
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Device</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="device" name="device"
+					tal:attributes="value device | nothing"/>
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Options</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="options" name="options"
+					tal:attributes="value opt | nothing"/>
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>File System ID</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="fsid" name="fsid"
+					tal:attributes="value fsid | nothing"/>
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Force unmount</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="checkbox" id="forceunmount" name="forceunmount"
+					tal:attributes="checked python: force_unmount == '1' and 'checked'" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Reboot host node if unmount fails</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="checkbox" id="selffence" name="selffence"
+					tal:attributes="
+						checked python: reboot_fail == '1' and 'checked'" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Check file system before mounting</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="checkbox" id="checkfs" name="checkfs"
+					tal:attributes="
+						checked python: fscheck == '1' and 'checked'" />
+			</td>
+		</tr>
+	</table>
+
+	<input class="hbSubmit" type="button" value="Submit"
+		onClick="validate(this.form);" />
+
+	</form>
+</div>
+
+<div id="GFS" metal:define-macro="gfs_macro">
+<tal:block tal:condition="python: ptype == '33' or ptype =='24'"
+	tal:define="
+		global edit python: True;
+		global resName res/name;
+		global mountPoint res/attrs/mountpoint;
+		global device res/attrs/device;
+		global fstype res/attrs/fstype;
+		global opt res/attrs/options;
+		global fsid res/attrs/fsid;
+		global force_unmount res/attrs/force_unmount;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
+
+<tal:block tal:condition="python: ptype != '33'"
+	tal:define="
+		global edit python: False;
+		global force_unmount string:0;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+
+	<strong>GFS Resource Configuration</strong>
+	<form name="gfs_form" method="get" tal:attributes="action processURL">
+
+	<input name="pagetype" type="hidden" value="35" />
+
+	<input name="clustername" type="hidden"
+		tal:attributes="value cluname" />
+
+	<input name="oldname" type="hidden"
+		tal:condition="python: edit == True"
+		tal:attributes="value res/name" />
+
+	<input name="edit" type="hidden" value="1"
+		tal:condition="python: edit == True" />
+
+	<input name="type" type="hidden" value="gfs" />
+
+	<table id="gfsTable" class="systemsTable">
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Resource Name</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20"
+					id="resourceName" name="resourceName"
+					tal:attributes="value resName | nothing" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Mount Point</strong>
+			</td>
+
+			<td class="systemsTable">
+				<input type="text" size="20" id="mountPoint" name="mountpoint"
+					tal:attributes="value mountpoint | nothing" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Device</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="device" name="device"
+					tal:attributes="value device | nothing"/>
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Options</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="options" name="options"
+					tal:attributes="value opt | nothing" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>File System ID</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="fsid" name="fsid"
+					tal:attributes="value fsid | nothing" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Force unmount</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="checkbox" id="forceunmount" name="forceunmount"
+					tal:attributes="
+						checked python: force_unmount == '1' and 'checked'" />
+			</td>
+		</tr>
+	</table>
+
+	<input type="button" value="Submit" class="hbSubmit"
+		onclick="validate(gfs_form);" />
+
+	</form>
+</div>
+
+<div id="NFSM" metal:define-macro="nfsm_macro">
+<tal:block tal:condition="python: ptype == '33' or ptype =='24'"
+	tal:define="
+		global edit python: True;
+		global resName res/name;
+		global mountpoint res/attrs/mountpoint;
+		global opt res/attrs/options;
+		global expath res/attrs/export;
+		global nfstype res/attrs/fstype;
+		global hostname res/attrs/host;
+		global force_unmount res/attrs/force_unmount;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
+
+<tal:block tal:condition="python: ptype != '33'"
+	tal:define="
+		global edit python: False;
+		global force_unmount string:0;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+	<form name="nfsm_form" method="get" tal:attributes="action processURL">
+
+	<strong>NFS Mount Resource Configuration</strong>
+
+	<input name="pagetype" type="hidden" value="35" />
+
+	<input name="clustername" type="hidden" tal:attributes="value cluname"/>
+
+	<input name="oldname" type="hidden"
+		tal:condition="python: edit == True"
+		tal:attributes="value res/name" />
+
+	<input name="edit" type="hidden" value="1"
+		tal:condition="python: edit == True" />
+
+	<input name="type" type="hidden" value="nfsm" />
+
+	<table id="nfsMountTable" class="systemsTable">
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Resource Name</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20"
+					id="resourceName" name="resourceName"
+					tal:attributes="value resName | nothing" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Mount Point</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="mountpoint" name="mountpoint"
+					tal:attributes="value mountpoint | nothing" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Host</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="host" name="host"
+					tal:attributes="value hostname | nothing" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Export Path</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="exportpath" name="exportpath"
+					tal:attributes="value expath | nothing"/>
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>NFS Type</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="radio" name="nfstype" value="nfs"
+					tal:attributes="checked python: (edit == nothing or nfstype == 'nfs') and 'checked'" />
+				NFS (version 3)
+				<br/>
+				<input type="radio" name="nfstype" value="nfs4"
+					tal:attributes="checked python: (edit == True and nfstype == 'nfs4') and 'checked'">
+				NFS4
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Options</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="options" name="options"
+					tal:attributes="value opt | nothing"/>
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Force unmount</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="checkbox" id="forceunmount" name="forceunmount"
+					tal:attributes="
+						checked python: force_unmount == '1' and 'checked'" />
+			</td>
+		</tr>
+	</table>
+
+	<input type="button" value="Submit" class="hbSubmit"
+		onclick="validate(this.form);"/>
+
+	</form>
+</div>
+
+<div id="NFSC" metal:define-macro="nfsc_macro">
+<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
+	tal:define="
+		global edit python: True;
+		global resName res/name;
+		global target res/attrs/target;
+		global opt res/attrs/options;
+		global expath res/attrs/readOnly | nothing;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
+
+<tal:block tal:condition="python: ptype != '33'"
+	tal:define="
+		global edit python: False;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+
+	<strong>NFS Client Resource Configuration</strong>
+
+	<form name="nfsc_form" method="post" tal:attributes="action processURL">
+
+	<input name="pagetype" type="hidden" value="35" />
+
+	<input name="clustername" type="hidden" tal:attributes="value cluname" />
+
+	<input name="oldname" type="hidden"
+		tal:condition="python: edit == True"
+		tal:attributes="value res/name" />
+
+	<input name="edit" type="hidden" value="1"
+		tal:condition="python: edit == True" />
+
+	<input name="type" type="hidden" value="nfsc"/>
+
+	<table id="nfsClientTable" class="systemsTable">
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Resource Name</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20"
+					id="resourceName" name="resourceName"
+					tal:attributes="value resName | nothing" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Target</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="target" name="target"
+					tal:attributes="value target | nothing"/>
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Options</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="options" name="options"
+					tal:attributes="value opt | nothing"/>
+			</td>
+		</tr>
+	</table>
+
+	<input type="button" value="Submit" class="hbSubmit"
+		onclick="validate(this.form);" />
+
+	</form>
+</div>
 
 <div id="NFSX" metal:define-macro="nfsx_macro">
-    <span tal:condition="python:ptype == '33' or ptype == '24'">
-      <span tal:define="
-        global edit python:True;
-        global resName res/name;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
-    </span>
-    <span tal:condition="python:ptype != '33'">
-      <span tal:define="
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
-    </span>
-    <strong>NFS Export Resource Configuration</strong>
-    <form name="nfsx_form" action="" method="post" tal:attributes="action processURL">
-      <input name="pagetype" type="hidden" value="35"/>
-      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
-      <input name="oldname" type="hidden"
-             tal:attributes="value res/name"
-             tal:condition="python:edit == True" />
-      <input name="edit" type="hidden" value="1"
-             tal:condition="python:edit == True" />
-      <input name="type" type="hidden" value="nfsx"/>
-      <table id="nfsExportTable" border="0" cellspacing="0">
-        <tr>
-          <div>
-    	    <strong>Name:</strong>
-	    <input type="text" size="20" id="resourceName" name="resourceName" 
-                   tal:attributes="value resName|nothing"/>
-          </div>
-        </tr>
-      </table>
-    </form>
-    <input type="button" value="Submit" onclick="validate(nfsx_form);"/>
-  </div>
-
-  <div id="SCR" metal:define-macro="scr_macro">
-    <span tal:condition="python:ptype == '33' or ptype == '24'">
-      <span tal:define="
-        global edit string:true;
-        global resName res/name;
-        global filename res/attrs/file;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
-    </span>
-    <span tal:condition="python:ptype != '33'">
-      <span tal:define="
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname"/>
-    </span>
-    <strong>Script Resource Configuration</strong>
-    <form name="scr_form" action="" method="post" tal:attributes="action processURL">
-      <input name="pagetype" type="hidden" value="35"/>
-      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
-      <input name="oldname" type="hidden"
-             tal:attributes="value res/name"
-             tal:condition="python:edit == 'true'" />
-      <input name="edit" type="hidden" value="1"
-             tal:condition="python:edit == 'true'" />
-      <input name="type" type="hidden" value="scr"/>
-      <table id="scriptTable" border="0" cellspacing="0">
-        <tr>
-          <div>
-    	    <strong>Name:</strong>
-	    <input type="text" size="20" id="resourceName" name="resourceName"
-                   tal:attributes="value resName|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>File</strong> (with path):
-	    <input type="text" size="20" id="file" name="file"
-                   tal:attributes="value filename|nothing"/>
-          </div>
-        </tr>
-      </table>
-    </form>
-    <input type="button" value="Submit" onclick="validate(scr_form);"/>
-  </div>
-
-  <div id="SMB" metal:define-macro="smb_macro">
-    <span tal:condition="python:ptype == '33' or ptype == '24'">
-      <span tal:define="
-        global edit python:True;
-        global resName res/name;
-        global workgroup res/attrs/workgroup;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
-    </span>
-    <span tal:condition="python:ptype != '33'">
-      <span tal:define="
-	global edit python:false;
-        global cluname request/clustername;
-        tmp_URL context/cluster/index_html/absolute_url;
-        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname"/>
-    </span>
-    <strong tal:condition="python:edit != 'true'">Samba Server Configuration</strong>
-    <form name="smb_form" action="" method="post" tal:attributes="action processURL">
-      <input name="pagetype" type="hidden" value="35"/>
-      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
-      <input name="oldname" type="hidden"
-             tal:attributes="value res/name"
-             tal:condition="python:edit == True" />
-      <input name="edit" type="hidden" value="1"
-             tal:condition="python:edit == True" />
-      <input name="type" type="hidden" value="smb"/>
-      <table id="sambaTable" border="0" cellspacing="0">
-        <tr>
-          <div>
-	    <strong>Name:</strong>
-    	    <input type="text" size="20" id="resourceName" name="resourceName"
-                   tal:attributes="value resName|nothing"/>
-          </div>
-        </tr>
-        <tr>
-          <div>
-	    <strong>Workgroup:</strong>
-	    <input type="text" size="20" id="workgroup" name="workgroup"
-                   tal:attributes="value workgroup|nothing"/>
-          </div>
-        </tr>
-      </table>
-    </form>
-    <input type="button" value="Submit" onclick="validate(smb_form);"/>
-  </div> 
-  </body>
+<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
+	tal:define="
+		global edit python: True;
+		global resName res/name;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
+
+<tal:block tal:condition="python: ptype != '33'"
+	tal:define="
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+
+	<strong>NFS Export Resource Configuration</strong>
+	<form name="nfsx_form" method="post" tal:attributes="action processURL">
+
+	<input name="pagetype" type="hidden" value="35" />
+
+	<input name="clustername" type="hidden" tal:attributes="value cluname" />
+
+	<input name="oldname" type="hidden"
+		tal:condition="python: edit == True"
+		tal:attributes="value res/name" />
+
+	<input name="edit" type="hidden" value="1"
+		tal:condition="python: edit == True" />
+
+	<input name="type" type="hidden" value="nfsx" />
+
+	<table id="nfsExportTable" class="systemsTable">
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Name</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20"
+					id="resourceName" name="resourceName"
+					tal:attributes="value resName | nothing" />
+			</td>
+		</tr>
+	</table>
+
+	<input type="button" value="Submit" class="hbSubmit"
+		onClick="validate(this.form);" />
+
+	</form>
+</div>
+
+<div id="SCR" metal:define-macro="scr_macro">
+<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
+	tal:define="
+		global edit string:true;
+		global resName res/name;
+		global filename res/attrs/file;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
+
+<tal:block tal:condition="python: ptype != '33'"
+	tal:define="
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+
+	<strong>Script Resource Configuration</strong>
+	<form name="scr_form" method="post" tal:attributes="action processURL">
+
+	<input name="pagetype" type="hidden" value="35" />
+
+	<input name="clustername" type="hidden" tal:attributes="value cluname" />
+
+	<input name="oldname" type="hidden"
+		tal:condition="python: edit == 'true'"
+		tal:attributes="value res/name" />
+
+	<input name="edit" type="hidden" value="1"
+		tal:condition="python: edit == 'true'" />
+
+	<input name="type" type="hidden" value="scr" />
+
+	<table id="scriptTable" class="systemsTable">
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Name</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20"
+					id="resourceName" name="resourceName"
+					tal:attributes="value resName | nothing" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Full path to script file</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="file" name="file"
+					tal:attributes="value filename | nothing" />
+			</td>
+		</tr>
+	</table>
+
+	<input type="button" value="Submit" class="hbSubmit"
+		onClick="validate(scr_form);" />
+
+	</form>
+</div>
+
+<div id="SMB" metal:define-macro="smb_macro">
+<tal:block tal:condition="python: ptype == '33' or ptype == '24'"
+	tal:define="
+		global edit python: True;
+		global resName res/name;
+		global workgroup res/attrs/workgroup;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'" />
+
+<tal:block tal:condition="python: ptype != '33'"
+	tal:define="
+		global edit python: false;
+		global cluname request/clustername;
+		tmp_URL context/cluster/index_html/absolute_url;
+		global processURL python: tmp_URL+'?pagetype=35&clustername='+cluname" />
+
+	<strong tal:condition="python: edit != 'true'">Samba Server Configuration</strong>
+
+	<form name="smb_form" method="post" tal:attributes="action processURL">
+
+	<input name="pagetype" type="hidden" value="35" />
+
+	<input name="clustername" type="hidden" tal:attributes="value cluname" />
+
+	<input name="oldname" type="hidden"
+		tal:condition="python: edit == True"
+		tal:attributes="value res/name" />
+
+	<input name="edit" type="hidden" value="1"
+		tal:condition="python: edit == True" />
+
+	<input name="type" type="hidden" value="smb" />
+
+	<table id="sambaTable" class="systemsTable">
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Name</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20"
+					id="resourceName" name="resourceName"
+					tal:attributes="value resName | nothing" />
+			</td>
+		</tr>
+
+		<tr class="systemsTable">
+			<td class="systemsTable">
+				<strong>Workgroup</strong>
+			</td>
+			<td class="systemsTable">
+				<input type="text" size="20" id="workgroup" name="workgroup"
+					tal:attributes="value workgroup | nothing"/>
+			</td>
+		</tr>
+	</table>
+
+	<input type="button" value="Submit" class="hbSubmit"
+		onClick="validate(smb_form);" />
+
+	</form>
+</div>
+
+</body>
 </html>



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Cluster-devel] conga/luci/cluster form-macros resource-form-m ...
@ 2006-08-10 23:06 shuennek
  0 siblings, 0 replies; 6+ messages in thread
From: shuennek @ 2006-08-10 23:06 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	shuennek at sourceware.org	2006-08-10 23:06:20

Modified files:
	luci/cluster   : form-macros resource-form-macros 
	                 resource_form_handlers.js 

Log message:
	

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.2&r2=1.3

--- conga/luci/cluster/form-macros	2006/08/10 15:49:34	1.21
+++ conga/luci/cluster/form-macros	2006/08/10 23:06:20	1.22
@@ -832,25 +832,22 @@
 </div>
 
 <div metal:define-macro="serviceconfig-form">
-	<tal:block tal:define="
-					global ricci_agent python:here.getRicciAgentForCluster(request);
-					global sstat python:here.getClusterStatus(ricci_agent);
-					global sinfo python:here.getServiceInfo(sstat, modelb,request);
-					global running sinfo/running | nothing;" />
-
-	<table width="800px">
-		<tr style="padding:10px;margin:10px;border-width:0px;">
-			<td style="padding:10px;margin:10px;border-width:0px;">
-				<h1 style="border:0px;">Service Name: <span tal:content="sinfo/name"/></h1>
-			</td>
-
-			<td style="margin:10px">
-			<form method="post" onSubmit="return dropdown(this.gourl)">
-				<select name="gourl"
-					tal:define="global innermap sinfo/innermap;
-								starturls innermap/links">
-
-					<tal:block tal:condition="running">
+  <tal:block tal:define="
+    global ricci_agent python:here.getRicciAgentForCluster(request);
+    global sstat python:here.getClusterStatus(ricci_agent);
+    global sinfo python:here.getServiceInfo(sstat, modelb,request);
+    global running sinfo/running | nothing;" />
+  <table width="800px">
+    <tr style="padding:10px;margin:10px;border-width:0px;">
+      <td style="padding:10px;margin:10px;border-width:0px;">
+	<h1 style="border:0px;">Service Name: <span tal:content="sinfo/name"/></h1>
+      </td>
+      <td style="margin:10px">
+	<form method="post" onSubmit="return dropdown(this.gourl)">
+          <select name="gourl"
+		    tal:define="global innermap sinfo/innermap;
+		    starturls innermap/links">
+	  <tal:block tal:condition="running">
 						<option value=""><span tal:replace="innermap/current"/></option>
 						<option value="" tal:attributes="value innermap/restarturl">Restart this service</option>
 						<option value="">----------</option>
@@ -881,22 +878,45 @@
 			<h1 tal:condition="not: running" style="border:0px;">Service Status: <font color="red"><i>Stopped</i></font></h1>
 			<h1 tal:condition="running" style="border:0px;">Service Status: <font color="green"><i>Running</i></font></h1>
 		</td></tr>
-	</table>
+  </table>
   <h2> Service Composition</h2>
-  <span tal:define="global svc_rcs sinfo/resource_list"/>
-  <span tal:repeat="svc_rc svc_rcs">
-   <h4> Name: <span tal:content="svc_rc/resource_name"/></h4>
-   <h4> Type: <span tal:content="svc_rc/type"/></h4>
-   <span tal:define="ref svc_rc/ref_object | nothing">
-     <span tal:condition="ref">
-      <h4>This is a shared resource</h4>
-     </span>
-     <span tal:condition="not: ref">
-      <h4>This is a resource private to this service</h4>
-     </span>
-   </span>
-   <h4>Indent level:  <span tal:content="svc_rc/indent_ctr"/></h4>
-  </span>
+  <ul>
+  <span tal:omit-tag="" tal:define="global svc_rcs sinfo/resource_list"/>
+    <li tal:repeat="res svc_rcs">
+      <ul>
+      <div tal:define="global type res/type;
+		       global ref res/ref_object | nothing"/>
+        <span omit-tag="" tal:condition="ref">
+          <span tal:omit-tag="" tal:define="global shared string:true"/>
+        </span>
+	<strong tal:content="res/indent_str"/>
+        <span tal:omit-tag="" tal:condition="python:type == 'IP Address: '">
+          <li metal:use-macro="here/resource-form-macros/macros/ip_macro"/>
+        </span>
+        <span tal:omit-tag="" tal:condition="python:type == 'fs'">
+          <li metal:use-macro="here/resource-form-macros/macros/fs_macro"/>
+        </span>
+        <span tal:omit-tag="" tal:condition="python:type == 'gfs'">
+          <li metal:use-macro="here/resource-form-macros/macros/gfs_macro"/>
+        </span>
+        <span tal:omit-tag="" tal:condition="python:type == 'nfsm'">
+          <li metal:use-macro="here/resource-form-macros/macros/nfsm_macro"/>
+        </span>
+        <span tal:omit-tag="" tal:condition="python:type == 'nfsx'">
+          <li metal:use-macro="here/resource-form-macros/macros/nfsx_macro"/>
+        </span>
+        <span tal:omit-tag="" tal:condition="python:type == 'nfsc'">
+          <li metal:use-macro="here/resource-form-macros/macros/nfsc_macro"/>
+        </span>
+        <span tal:omit-tag="" tal:condition="python:type == 'smb'">
+          <li metal:use-macro="here/resource-form-macros/macros/smb_macro" />
+        </span>
+        <span tal:omit-tag="" tal:condition="python:type == 'Script: '">
+          <li metal:use-macro="here/resource-form-macros/macros/scr_macro" />
+        </span>
+      </ul>
+    </li>
+  </ul>
 </div>
 
 <div metal:define-macro="service-form">
--- conga/luci/cluster/resource-form-macros	2006/08/10 19:46:09	1.3
+++ conga/luci/cluster/resource-form-macros	2006/08/10 23:06:20	1.4
@@ -152,15 +152,16 @@
   </div>
 
   <div id="IP" metal:define-macro="ip_macro">
-    <span tal:condition="python:ptype == '33'">
+    <span tal:condition="python:ptype == '33' or ptype == '24'">
       <span tal:define="
+        global edit python:True;
         global resName res/name;
         global address python:resName.split('.');
         global ip1 python:address[0];
         global ip2 python:address[1];
         global ip3 python:address[2];
         global ip4 python:address[3];
-	global monitor_link res/attrs/monitor_link;
+	global monitor_link res/attrs/monitor_link|nothing;
         global cluname request/clustername;
         tmp_URL context/cluster/index_html/absolute_url;
         global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
@@ -168,20 +169,21 @@
 
     <span tal:condition="python:ptype != '33'">
       <span tal:define="
+            global edit python:False;
 	    global monitor_link string:1;
             global cluname request/clustername;
             tmp_URL context/cluster/index_html/absolute_url;
             global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
     </span>
-    <h2>IP Address Resource Configuration</h2>
+    <strong>IP Address Resource Configuration</strong>
     <form name="ip_form" id="ip_form" method="get" tal:attributes="action processURL">
       <input name="pagetype" type="hidden" value="35"/>
       <input name="clustername" type="hidden" tal:attributes="value cluname"/>
       <input name="oldname" type="hidden"
              tal:attributes="value res/name"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="edit" type="hidden" value="1"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
      <input name="type" type="hidden" value="ip"/>
       <table id="ipResourceTable" border="0" cellspacing="0" width="200" style="background-color: #dee7ec">
         <tr>
@@ -207,8 +209,9 @@
     <input name="submitButton" type="button" value="Submit" onClick="validate(ip_form);" />
   </div>
   <div id="FS" metal:define-macro="fs_macro">
-    <span tal:condition="python:ptype == '33'">
+    <span tal:condition="python:ptype == '33' or ptype == '24'">
       <span tal:define="
+        global edit python:True;
         global resName res/name;
         global mountPoint res/attrs/mountpoint;
         global device res/attrs/device;
@@ -224,6 +227,7 @@
     </span>
     <span tal:condition="python:ptype != '33'">
       <span tal:define="
+        global edit python:False;
         global force_unmount string:0;
         global reboot_fail string:0;
 	global fstype string:0;
@@ -232,15 +236,15 @@
         tmp_URL context/cluster/index_html/absolute_url;
         global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
     </span>
-    <h2>File System Resource Configuration</h2>
+    <strong>File System Resource Configuration</strong>
       <form name="fs_form" action="" method="get" tal:attributes="action processURL">
       <input name="pagetype" type="hidden" value="35"/>
       <input name="clustername" type="hidden" tal:attributes="value cluname"/>
       <input name="oldname" type="hidden"
              tal:attributes="value res/name"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="edit" type="hidden" value="1"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
      <input name="type" type="hidden" value="fs"/>
       <table id="fileSystemTable" border="0" cellspacing="0">
         <tr>
@@ -253,11 +257,11 @@
           <div>
 	    <strong>File System Type:</strong>
 	    <select id="fstype" name="fstype">
-	      <span tal:condition="python: ptype != '33' or fstype == 'ext2'">
+	      <span tal:condition="python: edit == nothing or fstype == 'ext2'">
     	        <option name="ext2" value="ext2">ext2</option>
                 <option name="ext3" value="ext3" selected>ext3</option>
 	      </span>
-	      <span tal:condition="python: ptype == '33' and fstype != 'ext3'">
+	      <span tal:condition="python: edit == True and fstype != 'ext3'">
     	        <option name="ext2" value="ext2" selected>ext2</option>
                 <option name="ext3" value="ext3">ext3</option>
 	      </span>
@@ -320,8 +324,9 @@
     <input type="button" value="Submit" onClick="validate(fs_form);"/>
   </div>
   <div id="GFS" metal:define-macro="gfs_macro">
-    <span tal:condition="python:ptype == '33'">
+    <span tal:condition="python:ptype == '33' or ptype =='24'">
       <span tal:define="
+        global edit python:True;
         global resName res/name;
         global mountPoint res/attrs/mountpoint;
         global device res/attrs/device;
@@ -335,20 +340,21 @@
     </span>
     <span tal:condition="python:ptype != '33'">
       <span tal:define="
+        global edit python:False;
         global force_unmount string:0;
         global cluname request/clustername;
         tmp_URL context/cluster/index_html/absolute_url;
         global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
     </span>
-    <h2>GFS Resource Configuration</h2>
+    <strong>GFS Resource Configuration</strong>
     <form name="gfs_form" action="" method="post" tal:attributes="action processURL">
       <input name="pagetype" type="hidden" value="35"/>
       <input name="clustername" type="hidden" tal:attributes="value cluname"/>
       <input name="oldname" type="hidden"
              tal:attributes="value res/name"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="edit" type="hidden" value="1"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
      <input name="type" type="hidden" value="gfs"/>
       <table id="gfsTable" border="0" cellspacing="0">
         <tr>
@@ -401,8 +407,9 @@
     </div>
 
   <div id="NFSM" metal:define-macro="nfsm_macro">
-    <span tal:condition="python:ptype == '33'">
+    <span tal:condition="python:ptype == '33' or ptype =='24'">
       <span tal:define="
+        global edit python:True;
         global resName res/name;
         global mountpoint res/attrs/mountpoint;
         global opt res/attrs/options;
@@ -416,21 +423,22 @@
     </span>
     <span tal:condition="python:ptype != '33'">
       <span tal:define="
+        global edit python:False;
         global force_unmount string:0;
         global cluname request/clustername;
         tmp_URL context/cluster/index_html/absolute_url;
         global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
     </span>
-  <h2>NFS Mount Resource Configuration</h2>
+  <strong>NFS Mount Resource Configuration</strong>
   <form name="nfsm_form" action="" method="post">
     <form name="gfs_form" action="" method="post" tal:attributes="action processURL">
       <input name="pagetype" type="hidden" value="35"/>
       <input name="clustername" type="hidden" tal:attributes="value cluname"/>
       <input name="oldname" type="hidden"
              tal:attributes="value res/name"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="edit" type="hidden" value="1"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="type" type="hidden" value="nfsm"/>
       <table id="nfsMountTable" border="0" cellspacing="0">
         <tr>
@@ -463,11 +471,11 @@
         </tr>
         <tr>
           <div>
-	    <span tal:condition="python: ptype != '33' or nfstype == 'nfs'">
+	    <span tal:condition="python: edit == nothing or nfstype == 'nfs'">
     	      <input type="radio" name="nfstype" value="nfs" checked>NFS
 	      <input type="radio" name="nfstype" value="nfs4">NFS4
 	    </span>
-	    <span tal:condition="python: ptype == '33' and nfstype != 'nfs4'">
+	    <span tal:condition="python: edit == True and nfstype != 'nfs4'">
     	      <input type="radio" name="nfstype" value="nfs">NFS
 	      <input type="radio" name="nfstype" value="nfs4" checked>NFS4
 	    </span>
@@ -495,8 +503,9 @@
   </div>
 
   <div id="NFSC" metal:define-macro="nfsc_macro">
-    <span tal:condition="python:ptype == '33'">
+    <span tal:condition="python:ptype == '33' or ptype == '24'">
       <span tal:define="
+        global edit python:True;
         global resName res/name;
         global target res/attrs/target;
         global opt res/attrs/options;
@@ -507,19 +516,20 @@
     </span>
     <span tal:condition="python:ptype != '33'">
       <span tal:define="
+        global edit python:False;
         global cluname request/clustername;
         tmp_URL context/cluster/index_html/absolute_url;
         global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
     </span>
-    <h2>NFS Client Resource Configuration</h2>
+    <strong>NFS Client Resource Configuration</strong>
     <form name="nfsc_form" action="" method="post" tal:attributes="action processURL">
       <input name="pagetype" type="hidden" value="35"/>
       <input name="clustername" type="hidden" tal:attributes="value cluname"/>
       <input name="oldname" type="hidden"
              tal:attributes="value res/name"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="edit" type="hidden" value="1"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="type" type="hidden" value="nfsc"/>
       <table id="nfsClientTable" border="0" cellspacing="0">
         <tr>
@@ -549,8 +559,9 @@
   </div>
 
 <div id="NFSX" metal:define-macro="nfsx_macro">
-    <span tal:condition="python:ptype == '33'">
+    <span tal:condition="python:ptype == '33' or ptype == '24'">
       <span tal:define="
+        global edit python:True;
         global resName res/name;
         global cluname request/clustername;
         tmp_URL context/cluster/index_html/absolute_url;
@@ -562,15 +573,15 @@
         tmp_URL context/cluster/index_html/absolute_url;
         global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname" />
     </span>
-    <h2>NFS Export Resource Configuration</h2>
+    <strong>NFS Export Resource Configuration</strong>
     <form name="nfsx_form" action="" method="post" tal:attributes="action processURL">
       <input name="pagetype" type="hidden" value="35"/>
       <input name="clustername" type="hidden" tal:attributes="value cluname"/>
       <input name="oldname" type="hidden"
              tal:attributes="value res/name"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="edit" type="hidden" value="1"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="type" type="hidden" value="nfsx"/>
       <table id="nfsExportTable" border="0" cellspacing="0">
         <tr>
@@ -586,8 +597,9 @@
   </div>
 
   <div id="SCR" metal:define-macro="scr_macro">
-    <span tal:condition="python:ptype == '33'">
+    <span tal:condition="python:ptype == '33' or ptype == '24'">
       <span tal:define="
+        global edit string:true;
         global resName res/name;
         global filename res/attrs/file;
         global cluname request/clustername;
@@ -600,15 +612,15 @@
         tmp_URL context/cluster/index_html/absolute_url;
         global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname"/>
     </span>
-    <h2>Script Resource Configuration</h2>
+    <strong>Script Resource Configuration</strong>
     <form name="scr_form" action="" method="post" tal:attributes="action processURL">
       <input name="pagetype" type="hidden" value="35"/>
       <input name="clustername" type="hidden" tal:attributes="value cluname"/>
       <input name="oldname" type="hidden"
              tal:attributes="value res/name"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == 'true'" />
       <input name="edit" type="hidden" value="1"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == 'true'" />
       <input name="type" type="hidden" value="scr"/>
       <table id="scriptTable" border="0" cellspacing="0">
         <tr>
@@ -631,8 +643,9 @@
   </div>
 
   <div id="SMB" metal:define-macro="smb_macro">
-    <span tal:condition="python:ptype == '33'">
+    <span tal:condition="python:ptype == '33' or ptype == '24'">
       <span tal:define="
+        global edit python:True;
         global resName res/name;
         global workgroup res/attrs/workgroup;
         global cluname request/clustername;
@@ -641,19 +654,20 @@
     </span>
     <span tal:condition="python:ptype != '33'">
       <span tal:define="
+	global edit python:false;
         global cluname request/clustername;
         tmp_URL context/cluster/index_html/absolute_url;
         global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname"/>
     </span>
-    <h2>Samba Server Configuration</h2>
+    <strong tal:condition="python:edit != 'true'">Samba Server Configuration</strong>
     <form name="smb_form" action="" method="post" tal:attributes="action processURL">
       <input name="pagetype" type="hidden" value="35"/>
       <input name="clustername" type="hidden" tal:attributes="value cluname"/>
       <input name="oldname" type="hidden"
              tal:attributes="value res/name"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="edit" type="hidden" value="1"
-             tal:condition="python:ptype == '33'" />
+             tal:condition="python:edit == True" />
       <input name="type" type="hidden" value="smb"/>
       <table id="sambaTable" border="0" cellspacing="0">
         <tr>
--- conga/luci/cluster/resource_form_handlers.js	2006/08/10 19:46:09	1.2
+++ conga/luci/cluster/resource_form_handlers.js	2006/08/10 23:06:20	1.3
@@ -5,12 +5,12 @@
   if (!container_element) {
     alert('Can\'t find element with id = ' + container_id);
     return (-1)
-      }
+  }
   child_element = document.getElementById(element_id);
   if (!child_element) {
     alert('Can\'t find element with id = ' + element_id);
     return (-1)
-      }
+  }
   for(child in child_element.children){
     alert(child);
   }
@@ -21,7 +21,7 @@
   if (!invisible_div) {
     alert('No invisible div');
     return (-1)
-      } 
+  } 
   
   invisible_div.appendChild(temp);
 }



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-02 20:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-22 21:59 [Cluster-devel] conga/luci/cluster form-macros resource-form-m rmccabe
  -- strict thread matches above, loose matches on Subject: below --
2006-10-02 20:21 rmccabe
2006-09-22 18:22 rmccabe
2006-09-06 22:13 rmccabe
2006-08-29 23:23 rmccabe
2006-08-10 23:06 shuennek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).