[Cluster-devel] conga/luci/cluster form-macros

rmccabe at sourceware.org rmccabe at sourceware.org
Fri Jan 26 16:53:55 UTC 2007


CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2007-01-26 16:53:55

Modified files:
	luci/cluster   : form-macros 

Log message:
	confirm cluster (restart, start, stop, delete) and node (join, leave, fence, reboot, etc.) when selected

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.161&r2=1.162

--- conga/luci/cluster/form-macros	2007/01/25 21:03:47	1.161
+++ conga/luci/cluster/form-macros	2007/01/26 16:53:53	1.162
@@ -92,7 +92,7 @@
 		</td>
 
 		<td class="cluster cluster_action">
-			<form method="post" onSubmit="return dropdown(this.gourl)">
+			<form method="post">
 				<select name="gourl" id="cluster_action" class="cluster">
 					<option class="cluster running"
 						tal:condition="python: 'running' in cstatus and cstatus['running'] != 'true'"
@@ -116,7 +116,8 @@
 						Delete this cluster
 					</option>
 				</select>
-				<input class="cluster" type="submit" value="Go" />
+				<input class="cluster" type="button" value="Go"
+					onclick="if (this.form.gourl[this.form.gourl.selectedIndex].value && confirm(this.form.gourl[this.form.gourl.selectedIndex].text + '?')) return dropdown(this.form.gourl)" />
 			</form>
 		</td>
 	</tr>
@@ -2802,7 +2803,7 @@
 
 			<td class="cluster node node_action"
 				tal:condition="python: nodeinfo['nodestate'] == '0' or nodeinfo['nodestate'] == '1'">
-				<form method="post" onSubmit="return dropdown(this.gourl)">
+				<form method="post">
 				<select name="gourl">
 					<option value="">Choose a Task...</option>
 					<option tal:attributes="value nodeinfo/jl_url"
@@ -2820,18 +2821,20 @@
 						tal:condition="python: not 'ricci_error' in nodeinfo">
 						Delete this node</option>
 				</select>
-				<input type="submit" value="Go"/>
+				<input type="button" value="Go"
+					onclick="if (this.form.gourl[this.form.gourl.selectedIndex].value && confirm(this.form.gourl[this.form.gourl.selectedIndex].text + '?')) return dropdown(this.form.gourl)" />
 				</form>
 			</td>
 
 			<td class="cluster node node_action"
 				tal:condition="python: nodeinfo['nodestate'] != '0' and nodeinfo['nodestate'] != '1'">
-				<form method="post" onSubmit="return dropdown(this.gourl)">
+				<form method="post">
 				<select name="gourl">
 					<option value="">Choose a Task...</option>
 					<option tal:attributes="value nodeinfo/fence_url | nothing">Fence this node</option>
 				</select>
-				<input type="submit" value="Go"/>
+				<input type="button" value="Go"
+					onclick="if (this.form.gourl[this.form.gourl.selectedIndex].value && confirm(this.form.gourl[this.form.gourl.selectedIndex].text + '?')) return dropdown(this.form.gourl)" />
 				</form>
 			</td>
 		</tr>
@@ -3217,7 +3220,7 @@
 				</td>
 
 				<td class="node node_action" tal:condition="python: nd['status'] == '0' or nd['status'] == '1'">
-					<form method="post" onSubmit="return dropdown(this.gourl)">
+					<form method="post">
 						<select class="node" name="gourl">
 							<option value="">Choose a Task...</option>
 							<option tal:attributes="value nd/jl_url">
@@ -3228,18 +3231,20 @@
 							<option tal:attributes="value nd/fence_it_url">Fence this node</option>
 							<option tal:attributes="value nd/reboot_url">Reboot this node</option>
 							<option value="">----------</option>
-							<option tal:attributes="value nd/delete_url">Delete</option>
+							<option tal:attributes="value nd/delete_url">Delete this node</option>
 						</select>
-						<input type="submit" value="Go"/>
+						<input type="button" value="Go"
+							onclick="if (this.form.gourl[this.form.gourl.selectedIndex].value && confirm(this.form.gourl[this.form.gourl.selectedIndex].text + '?')) return dropdown(this.form.gourl)" />
 					</form>
 				</td>
 				<td class="node node_action" tal:condition="python: nd['status'] != '0' and nd['status'] != '1'">
-					<form method="post" onSubmit="return dropdown(this.gourl)">
+					<form method="post">
 						<select class="node" name="gourl">
 							<option value="">Choose a Task...</option>
 							<option tal:attributes="value nd/fence_it_url | nothing">Fence this node</option>
 						</select>
-						<input type="submit" value="Go"/>
+						<input type="button" value="Go"
+							onclick="if (this.form.gourl[this.form.gourl.selectedIndex].value && confirm(this.form.gourl[this.form.gourl.selectedIndex].text + '?')) return dropdown(this.form.gourl)" />
 					</form>
 				</td>
 			</tr>
@@ -3584,7 +3589,7 @@
 				</td>
 
 				<td class="cluster service service_action">
-					<form method="post" onSubmit="return dropdown(this.gourl)">
+					<form method="post">
 						<select name="gourl">
 							<option value="">Choose a Task...</option>
 							<option
@@ -3613,7 +3618,8 @@
 								tal:attributes="value svc/delurl | nothing"
 								tal:content="string:Delete this service" />
 						</select>
-						<input type="submit" value="Go"/>
+						<input type="button" value="Go"
+							onclick="if (this.form.gourl[this.form.gourl.selectedIndex].value && confirm(this.form.gourl[this.form.gourl.selectedIndex].text + '?')) return dropdown(this.form.gourl)" />
 					</form>
 				</td>
 			</tr>
@@ -3867,7 +3873,7 @@
 			</td>
 			<td class="cluster service service_action"
 				tal:condition="python: sinfo and 'innermap' in sinfo">
-				<form method="post" onSubmit="return dropdown(this.gourl)">
+				<form method="post">
 					<input type="hidden" name="pagetype" tal:attributes="
 						value request/pagetype | request/form/pagetype | nothing" />
 					<select name="gourl"
@@ -3892,7 +3898,8 @@
 								tal:content="string:Delete this service" />
 						</tal:block>
 					</select>
-					<input type="submit" value="Go"/>
+					<input type="button" value="Go"
+						onclick="if (this.form.gourl[this.form.gourl.selectedIndex].value && confirm(this.form.gourl[this.form.gourl.selectedIndex].text + '?')) return dropdown(this.form.gourl)" />
 				</form>
 			</td>
 		</tr>




More information about the Cluster-devel mailing list