[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga/luci/cluster fence_device.js form-macros



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2007-01-09 23:28:02

Modified files:
	luci/cluster   : fence_device.js form-macros 

Log message:
	only show the "Add an instance" button for sharable fence devices

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence_device.js.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.147&r2=1.148

--- conga/luci/cluster/fence_device.js	2007/01/09 18:27:04	1.6
+++ conga/luci/cluster/fence_device.js	2007/01/09 23:28:02	1.7
@@ -71,6 +71,7 @@
 		container_element.removeChild(container_element.firstChild);
 
 	var target = child_element.cloneNode(1);
+	target.id = '';
 
 	var fence_type = fence_id;
 	if (fence_opt.className.match(/shared_fencedev/)) {
@@ -90,6 +91,7 @@
 	container_element.appendChild(target_form);
 
 	var fi_form = document.getElementById(fence_type + '_instance');
+	var sharable = 0;
 	if (fi_form) {
 		var idiv = document.createElement('div');
 		idiv.id = container_id + '_instances';
@@ -114,6 +116,7 @@
 		idiv.appendChild(form_elem);
 		container_element.appendChild(idiv);
 		num_fence_instances[container_id] = 1;
+		sharable++;
 	}
 
 	var remove_div = document.createElement('div');
@@ -124,12 +127,14 @@
 	remove_button.setAttribute('value', 'Remove this device');
 	remove_button.setAttribute('onclick', "del_fence('" + container_element.id + "');");
 
-	var add_instance_button = document.createElement('input');
-	add_instance_button.setAttribute('type', 'button');
-	add_instance_button.setAttribute('name', 'add_fence_inst');
-	add_instance_button.setAttribute('value', 'Add an instance');
-	add_instance_button.setAttribute('onclick', "add_fence_instance('" + container_element.id + "','" + fence_type + "');");
-	add_instance_button.className = 'pad_left';
+	if (sharable) {
+		var add_instance_button = document.createElement('input');
+		add_instance_button.setAttribute('type', 'button');
+		add_instance_button.setAttribute('name', 'add_fence_inst');
+		add_instance_button.setAttribute('value', 'Add an instance');
+		add_instance_button.setAttribute('onclick', "add_fence_instance('" + container_element.id + "','" + fence_type + "');");
+		add_instance_button.className = 'pad_left';
+	}
 
 	var remove_form = document.createElement('form');
 	remove_form.appendChild(remove_button);
--- conga/luci/cluster/form-macros	2007/01/09 22:20:34	1.147
+++ conga/luci/cluster/form-macros	2007/01/09 23:28:02	1.148
@@ -2200,7 +2200,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2242,7 +2242,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2277,7 +2277,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2312,7 +2312,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2347,7 +2347,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2382,7 +2382,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2417,7 +2417,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2452,7 +2452,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2487,7 +2487,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2522,7 +2522,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2544,7 +2544,7 @@
 			</tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"
@@ -2579,7 +2579,7 @@
 			</td></tr>
 		</table>
 
-		<input name="fence_instance" value="1" />
+		<input type="hidden" name="fence_instance" value="1" />
 		<input tal:condition="exists: cur_instance"
 			type="hidden" name="existing_instance" value="1" />
 		<input type="hidden" name="parent_fencedev"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]