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

rmccabe at sourceware.org rmccabe at sourceware.org
Mon Sep 11 22:22:02 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-09-11 22:22:01

Modified files:
	luci/cluster   : form-macros resource-form-macros 
	                 resource_form_handlers.js 
	luci/homebase  : luci_homebase.css x.png 

Log message:
	resource / service frontend bits

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.57&r2=1.58
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.20&r2=1.21
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/x.png.diff?cvsroot=cluster&r1=1.1&r2=1.2

--- conga/luci/cluster/form-macros	2006/09/08 22:54:32	1.57
+++ conga/luci/cluster/form-macros	2006/09/11 22:22:00	1.58
@@ -1085,7 +1085,11 @@
 </div>
 
 <div metal:define-macro="serviceconfig-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/cluster/resource_form_handlers.js">
 	</script>
 	<tal:block tal:define="
 		global ricci_agent python: here.getRicciAgentForCluster(request);
@@ -1137,6 +1141,17 @@
 		</tr>
 	</table>
 	<br/>
+
+	<div id="resskel" class="invisible">
+		<tal:block metal:use-macro="here/resource-form-macros/macros/resource-swap-form" />
+		<div name="expander" class="invisible">
+			<img class="service_tree" name="arrow_down" alt="[-]"
+				src="/luci/cluster/arrow_down.png"
+				onClick="collapse_div(this)">
+			<span class="service_tree">Hide Children</span>
+		</div>
+	</div>
+
 	<h2>Service Composition</h2>
 
 	<div id="service_comp_list">
@@ -1185,10 +1200,9 @@
 			<tal:block metal:use-macro="here/resource-form-macros/macros/scr_macro" />
 		</span>
 
-		<div
-			tal:condition="python: res['max_depth'] != 0"
+		<div name="expander"
 			tal:attributes="
-				class python: 'rc_indent' + str(res['indent_ctr'] - 1)">
+				class python: res['max_depth'] == 0 and 'invisible' or ('rc_indent' + str(res['indent_ctr'] - 1))">
 			<img class="service_tree" name="arrow_down" alt="[-]"
 				src="/luci/cluster/arrow_down.png"
 				onClick="collapse_div(this)">
--- conga/luci/cluster/resource-form-macros	2006/09/08 22:54:32	1.8
+++ conga/luci/cluster/resource-form-macros	2006/09/11 22:22:00	1.9
@@ -13,7 +13,7 @@
 			global rescInf python: here.getResourcesInfo(modelb, request);
 			global msg python: here.appendModel(request, modelb)" />
 
-	<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
+	<table class="systemsTable" border="0" cellspacing="0">
 		<thead class="systemsTable">
 			<tr class="systemsTable">
 				<th class="systemsTable" width="100">Resource Name</th>
@@ -46,12 +46,10 @@
 	</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>
 
@@ -65,22 +63,16 @@
 	<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>
-
-	<tal:block
-		tal:define="
-			global res python: here.getResourceInfo(modelb, request);" />
-
-	<h2>Add a Resource</h2>
-	<strong>Select a Resource Type</strong>
-	<br/>
-
-	<form>
-	<select name="select_div"
-		onChange="swap_div('container', this.form.select_div.options[this.form.select_div.selectedIndex].value);">
+<div metal:define-macro="resource-swap-form">
+<form>
+	<div class="reshdr">
+		<strong class="reshdr">Select a Resource Type</strong>
+	</div>
+	<div class="reshdr">
+	<select onChange="swap_div_elem(this.form.parentNode.parentNode,
+		'invisible', 'container',
+		this.options[this.selectedIndex].value);">
+		<option name="blank" value="blank" checked>Select a Resource</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>
@@ -90,17 +82,14 @@
 		<option name="SCR" value="SCR">Script</option>
 		<option name="SMB" value="SMB">Samba</option>
 	</select>
-	</form>
+	</div>
 
-	<table class="systemsTable">
-		<tr class="systemsTable">
-			<td class="systemsTable" id="container" width="400">
-				&nbsp
-			</td></tr>
-	</table>
+	<div name="container" class="systemsTable">
+		<div> </div>
+	</div>
 
-	<div id="invisible">
-		<div id="blank">&nbsp</div>
+	<div name="invisible" class="invisible">
+		<div name="blank"> </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" />
@@ -110,6 +99,23 @@
 		<div metal:use-macro="here/resource-form-macros/macros/smb_macro" />
 		<div metal:use-macro="here/resource-form-macros/macros/scr_macro" />
 	</div>
+</form>
+</div>
+
+<div metal:define-macro="resourceadd-form">
+	<script type="text/javascript"
+		src="/luci/cluster/resource_form_handlers.js">
+	</script>
+
+	<tal:block
+		tal:define="
+			global res python: here.getResourceInfo(modelb, request);" />
+
+	<h2>Add a Resource</h2>
+
+	<div class="reschoose">
+		<div metal:use-macro="here/resource-form-macros/macros/resource-swap-form" />
+	</div>
 </div>
 
 <div metal:define-macro="resource-form">
@@ -167,41 +173,43 @@
 
 		<h2>Configure <span tal:replace="python: 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>
+		<div class="reschoose">
+			<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>
+		</div>
 	</tal:block>
 </div>
 
-<div class="rescfg" id="IP" metal:define-macro="ip_macro">
+<div class="rescfg" name="IP" metal:define-macro="ip_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit python: True;
@@ -223,7 +231,7 @@
 
 	<div class="reshdr">IP Address Resource Configuration</div>
 
-	<form name="ip_form" id="ip_form" method="get"
+	<form name="ip_form" method="get"
 		tal:attributes="action processURL">
 	<input name="pagetype" type="hidden" value="35"/>
 
@@ -242,7 +250,7 @@
 
 	<input name="type" type="hidden" value="ip"/>
 
-	<table id="ipResourceTable" class="systemsTable">
+	<table class="systemsTable">
 		<tr class="systemsTable">
 			<td class="systemsTable">IP address</td>
 			<td class="systemsTable">
@@ -276,7 +284,7 @@
 	</form>
 </div>
 
-<div class="rescfg" id="FS" metal:define-macro="fs_macro">
+<div class="rescfg" name="FS" metal:define-macro="fs_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit python: True;
@@ -324,12 +332,12 @@
 
 	<input name="type" type="hidden" value="fs" />
 
-	<table id="fileSystemTable" class="systemsTable">
+	<table class="systemsTable">
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
 				<input type="text" size="20"
-					id="resourceName" name="resourceName"
+					name="resourceName"
 					tal:attributes="value resName | nothing"/>
 			</td>
 		</tr>
@@ -337,7 +345,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">File system type</td>
 			<td class="systemsTable">
-				<select id="fstype" name="fstype">
+				<select name="fstype">
 					<option name="ext3" value="ext3"
 						tal:content="string: ext3"
 						tal:attributes="checked python: (edit == nothing or fstype == 'ext3') and 'checked'" />
@@ -351,7 +359,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Mount point</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="mountpoint" name="mountpoint"
+				<input type="text" size="20" name="mountpoint"
 					tal:attributes="value mountPoint | nothing" />
 			</td>
 		</tr>
@@ -359,7 +367,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Device</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="device" name="device"
+				<input type="text" size="20" name="device"
 					tal:attributes="value device | nothing" />
 			</td>
 		</tr>
@@ -367,7 +375,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Options</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="options" name="options"
+				<input type="text" size="20" name="options"
 					tal:attributes="value opt | nothing" />
 			</td>
 		</tr>
@@ -375,7 +383,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">File system ID</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="fsid" name="fsid"
+				<input type="text" size="20" name="fsid"
 					tal:attributes="value fsid | nothing" />
 			</td>
 		</tr>
@@ -383,7 +391,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Force unmount</td>
 			<td class="systemsTable">
-				<input type="checkbox" id="forceunmount" name="forceunmount"
+				<input type="checkbox" name="forceunmount"
 					tal:attributes="checked python: force_unmount == '1' and 'checked'" />
 			</td>
 		</tr>
@@ -391,7 +399,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Reboot host node if unmount fails</td>
 			<td class="systemsTable">
-				<input type="checkbox" id="selffence" name="selffence"
+				<input type="checkbox" name="selffence"
 					tal:attributes="
 						checked python: reboot_fail == '1' and 'checked'" />
 			</td>
@@ -400,7 +408,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Check file system before mounting</td>
 			<td class="systemsTable">
-				<input type="checkbox" id="checkfs" name="checkfs"
+				<input type="checkbox" name="checkfs"
 					tal:attributes="
 						checked python: fscheck == '1' and 'checked'" />
 			</td>
@@ -419,11 +427,10 @@
 				onClick="delete_resource(this.form)" />
 		</tal:block>
 	</div>
-
 	</form>
 </div>
 
-<div class="rescfg" id="GFS" metal:define-macro="gfs_macro">
+<div class="rescfg" name="GFS" metal:define-macro="gfs_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype =='24'"
 	tal:define="
 		global edit python: True;
@@ -466,12 +473,12 @@
 
 	<input name="type" type="hidden" value="gfs" />
 
-	<table id="gfsTable" class="systemsTable">
+	<table class="systemsTable">
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
 				<input type="text" size="20"
-					id="resourceName" name="resourceName"
+					name="resourceName"
 					tal:attributes="value resName | nothing" />
 			</td>
 		</tr>
@@ -479,7 +486,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Mount point</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="mountPoint" name="mountpoint"
+				<input type="text" size="20" name="mountpoint"
 					tal:attributes="value mountpoint | nothing" />
 			</td>
 		</tr>
@@ -487,7 +494,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Device</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="device" name="device"
+				<input type="text" size="20" name="device"
 					tal:attributes="value device | nothing"/>
 			</td>
 		</tr>
@@ -495,7 +502,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Options</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="options" name="options"
+				<input type="text" size="20" name="options"
 					tal:attributes="value opt | nothing" />
 			</td>
 		</tr>
@@ -503,7 +510,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">File system ID</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="fsid" name="fsid"
+				<input type="text" size="20" name="fsid"
 					tal:attributes="value fsid | nothing" />
 			</td>
 		</tr>
@@ -511,7 +518,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Force unmount</td>
 			<td class="systemsTable">
-				<input type="checkbox" id="forceunmount" name="forceunmount"
+				<input type="checkbox" name="forceunmount"
 					tal:attributes="
 						checked python: force_unmount == '1' and 'checked'" />
 			</td>
@@ -534,7 +541,7 @@
 	</form>
 </div>
 
-<div class="rescfg" id="NFSM" metal:define-macro="nfsm_macro">
+<div class="rescfg" name="NFSM" metal:define-macro="nfsm_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype =='24'"
 	tal:define="
 		global edit python: True;
@@ -577,12 +584,12 @@
 
 	<input name="type" type="hidden" value="nfsm" />
 
-	<table id="nfsMountTable" class="systemsTable">
+	<table class="systemsTable">
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
 				<input type="text" size="20"
-					id="resourceName" name="resourceName"
+					name="resourceName"
 					tal:attributes="value resName | nothing" />
 			</td>
 		</tr>
@@ -590,7 +597,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Mount point</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="mountpoint" name="mountpoint"
+				<input type="text" size="20" name="mountpoint"
 					tal:attributes="value mountpoint | nothing" />
 			</td>
 		</tr>
@@ -598,7 +605,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Host</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="host" name="host"
+				<input type="text" size="20" name="host"
 					tal:attributes="value hostname | nothing" />
 			</td>
 		</tr>
@@ -606,7 +613,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Export path</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="exportpath" name="exportpath"
+				<input type="text" size="20" name="exportpath"
 					tal:attributes="value expath | nothing" />
 			</td>
 		</tr>
@@ -627,7 +634,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Options</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="options" name="options"
+				<input type="text" size="20" name="options"
 					tal:attributes="value opt | nothing" />
 			</td>
 		</tr>
@@ -635,7 +642,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Force unmount</td>
 			<td class="systemsTable">
-				<input type="checkbox" id="forceunmount" name="forceunmount"
+				<input type="checkbox" name="forceunmount"
 					tal:attributes="
 						checked python: force_unmount == '1' and 'checked'" />
 			</td>
@@ -658,7 +665,7 @@
 	</form>
 </div>
 
-<div class="rescfg" id="NFSC" metal:define-macro="nfsc_macro">
+<div class="rescfg" name="NFSC" metal:define-macro="nfsc_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit python: True;
@@ -697,12 +704,12 @@
 
 	<input name="type" type="hidden" value="nfsc"/>
 
-	<table id="nfsClientTable" class="systemsTable">
+	<table class="systemsTable">
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
 				<input type="text" size="20"
-					id="resourceName" name="resourceName"
+					name="resourceName"
 					tal:attributes="value resName | nothing" />
 			</td>
 		</tr>
@@ -710,7 +717,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Target</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="target" name="target"
+				<input type="text" size="20" name="target"
 					tal:attributes="value target | nothing"/>
 			</td>
 		</tr>
@@ -718,7 +725,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Options</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="options" name="options"
+				<input type="text" size="20" name="options"
 					tal:attributes="value opt | nothing"/>
 			</td>
 		</tr>
@@ -740,7 +747,7 @@
 	</form>
 </div>
 
-<div class="rescfg" id="NFSX" metal:define-macro="nfsx_macro">
+<div class="rescfg" name="NFSX" metal:define-macro="nfsx_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit python: True;
@@ -775,12 +782,12 @@
 
 	<input name="type" type="hidden" value="nfsx" />
 
-	<table id="nfsExportTable" class="systemsTable">
+	<table class="systemsTable">
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
 				<input type="text" size="20"
-					id="resourceName" name="resourceName"
+					name="resourceName"
 					tal:attributes="value resName | nothing" />
 			</td>
 		</tr>
@@ -802,7 +809,7 @@
 	</form>
 </div>
 
-<div class="rescfg" id="SCR" metal:define-macro="scr_macro">
+<div class="rescfg" name="SCR" metal:define-macro="scr_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit string:true;
@@ -838,12 +845,12 @@
 
 	<input name="type" type="hidden" value="scr" />
 
-	<table id="scriptTable" class="systemsTable">
+	<table class="systemsTable">
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
 				<input type="text" size="20"
-					id="resourceName" name="resourceName"
+					name="resourceName"
 					tal:attributes="value resName | nothing" />
 			</td>
 		</tr>
@@ -851,7 +858,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Full path to script file</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="file" name="file"
+				<input type="text" size="20" name="file"
 					tal:attributes="value filename | nothing" />
 			</td>
 		</tr>
@@ -873,7 +880,7 @@
 	</form>
 </div>
 
-<div class="rescfg" id="SMB" metal:define-macro="smb_macro">
+<div class="rescfg" name="SMB" metal:define-macro="smb_macro">
 <tal:block tal:condition="python: ptype == '33' or ptype == '24'"
 	tal:define="
 		global edit python: True;
@@ -913,12 +920,12 @@
 
 	<input name="type" type="hidden" value="smb" />
 
-	<table id="sambaTable" class="systemsTable">
+	<table class="systemsTable">
 		<tr class="systemsTable">
 			<td class="systemsTable">Name</td>
 			<td class="systemsTable">
 				<input type="text" size="20"
-					id="resourceName" name="resourceName"
+					name="resourceName"
 					tal:attributes="value resName | nothing" />
 			</td>
 		</tr>
@@ -926,7 +933,7 @@
 		<tr class="systemsTable">
 			<td class="systemsTable">Workgroup</td>
 			<td class="systemsTable">
-				<input type="text" size="20" id="workgroup" name="workgroup"
+				<input type="text" size="20" name="workgroup"
 					tal:attributes="value workgroup | nothing"/>
 			</td>
 		</tr>
--- conga/luci/cluster/resource_form_handlers.js	2006/09/08 22:54:32	1.5
+++ conga/luci/cluster/resource_form_handlers.js	2006/09/11 22:22:00	1.6
@@ -1,19 +1,28 @@
-function swap_div(container_id, element_id) {
-	var container_element = document.getElementById(container_id);
-	if (!container_element)
+function swap_div_elem(container, swap_out_cname, swap_in_cname, swap_in_name) {
+	var divs = container.getElementsByTagName('div');
+	if (!divs)
 		return (-1);
 
-	var child_element = document.getElementById(element_id);
-	if (!child_element)
-		return (-1);
+	var swap_out_cont = null;
+	var swap_in_cont = null;
+	var swap_in_elem = null;
+	var i = 0;
+	while ((!swap_out_cont || !swap_in_cont || !swap_in_elem) && i < divs.length)
+	{
+		if (!swap_in_cont && divs[i].getAttribute('name') == swap_in_cname)
+			swap_in_cont = divs[i];
+		else if (!swap_out_cont && divs[i].getAttribute('name') == swap_out_cname)
+			swap_out_cont = divs[i];
+		else if (!swap_in_elem && divs[i].getAttribute('name') == swap_in_name)
+			swap_in_elem = divs[i];
+		i++;
+	}
 
-	var invisible_div = document.getElementById('invisible');
-	if (!invisible_div)
+	if (!swap_out_cont || !swap_in_cont || !swap_in_elem)
 		return (-1);
 
-	var temp = container_element.firstChild;
-	container_element.replaceChild(child_element, container_element.firstChild);
-	invisible_div.appendChild(temp);
+	var temp = swap_in_cont.replaceChild(swap_in_elem, swap_in_cont.firstChild);
+	swap_out_cont.appendChild(temp);
 }
 
 function validate_ip(form) {
@@ -141,5 +150,49 @@
 	{
 		return (-1);
 	}
-	var level = Number(form.tree_level.value);
+	var ilevel = Number(form.tree_level.value);
+	var sdiv = document.getElementById('resskel');
+	if (!sdiv)
+		return (-1);
+
+	var pdiv = form.parentNode;
+	var regex = eval('/rc_indent' + ilevel + '$/');
+	while (pdiv && !pdiv.className.match(regex)) {
+		if (pdiv.className == 'service_comp_list')
+			break;
+		pdiv = pdiv.parentNode;
+	}
+	if (!pdiv)
+		return (-1);
+
+	var divs = pdiv.getElementsByTagName('div');
+	var target = null;
+
+	++ilevel;
+	regex = eval('/rc_indent' + ilevel + '$/');
+	for (var i = 0 ; i < divs.length ; i++) {
+		if (divs[i].className.match(regex)) {
+			target = divs[i]
+			break;
+		}
+	}
+
+	if (!target) {
+		alert('need to append');
+		target = document.createElement('div');
+		target.className = 'service_comp rc_indent' + ilevel;
+		pdiv.appendChild(target);
+	}
+
+	var node = sdiv.cloneNode(1);
+	node.id = null;
+	node.className = null;
+	ielem = node.getElementsByTagName('input');
+	if (!ielem)
+		return (-1);
+	for (var i = 0 ; i < ielem.length ; i++) {
+		if (ielem[i].getAttribute('name') == 'tree_level')
+			ielem[i].value = ilevel;
+	}
+	target.appendChild(node);
 }
--- conga/luci/homebase/luci_homebase.css	2006/09/08 22:54:32	1.20
+++ conga/luci/homebase/luci_homebase.css	2006/09/11 22:22:01	1.21
@@ -2,6 +2,12 @@
 	padding: .2em ! important;
 }
 
+input[type=checkbox], input[type=radio] {
+	float: left ! important;
+	vertical-align: middle;
+	background: #dee7ec;
+}
+
 ul.configTab {
 	color: #436976 !important;
 	margin: 20px 0px 0px 0px !important;
@@ -201,13 +207,13 @@
 }
 
 img.qdel_img {
-	height: 9px;
+	height: 7px;
 	width: 7px;
 	background: #dee7ec;
 	border: none;
 }
 
-#invisible, #allSameDiv {
+*.invisible,#invisible, #allSameDiv {
 	visibility: hidden;
 	display: none;
 }
@@ -259,23 +265,22 @@
 strong.cluster {
 	text-align: top;
 	font-size: 9pt;
-	letter-spacing: +1px;
+	letter-spacing: +.5px;
 }
 
 *.reshdr {
 	text-align: top;
 	font-size: 9pt;
-	letter-spacing: +1px;
+	letter-spacing: +.5px;
 	font-weight: 600;
 	padding-bottom: +1em;
 }
 
-
 strong.service_name,
 strong.node_name,
 strong.cluster_name {
 	font-size: 10pt;
-	letter-spacing: +1px;
+	letter-spacing: +.5px;
 }
 
 td.service_name,
@@ -382,6 +387,12 @@
 	padding: 1em;
 }
 
+div.reschoose {
+	background: #dee7ec;
+	padding: .5em;
+	max-width: 700px;
+}
+
 div.rescfg {
 	background: #dee7ec;
 }
Binary files /cvs/cluster/conga/luci/homebase/x.png	2006/06/20 21:21:47	1.1 and /cvs/cluster/conga/luci/homebase/x.png	2006/09/11 22:22:01	1.2 differ
rcsdiff: /cvs/cluster/conga/luci/homebase/x.png: diff failed




More information about the Cluster-devel mailing list