Skip to contentSkip to conversation

conga/luci homebase/form-macros homebase/valid ...

Cluster-devel [email protected] 1 participant 1 message Oct 16, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-10-16 20:46:46

Modified files:
luci/homebase : form-macros validate_sys_remove.js luci/site/luci/Extensions: conga_constants.py
homebase_adapters.py

Log message:
add a reauth form at the top of the manage systems page

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/validate_sys_remove.js.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&r1=1.33&r2=1.34

luci/homebase/form-macros +77 -5
@@ -1,7 +1,7 @@
 <html>
 
 <tal:comment tal:replace="nothing">
-	$Id: form-macros,v 1.43 2006/10/16 15:35:27 rmccabe Exp $
+	$Id: form-macros,v 1.44 2006/10/16 20:46:46 rmccabe Exp $
 </tal:comment>
 
 <head>
@@ -298,19 +298,91 @@
 					global num_systems python:-1"
 	/>
 
+	<h2 class="homebase">Manage Systems and Clusters</h2>
+
+	<h3>Authenticate to Storage or Cluster Systems</h3>
+
+	<form name="authform" method="post" action="">
+		<input type="hidden" name="pagetype" value="8" />
+		<table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
+			<thead class="systemsTable">
+				<tr class="systemsTable">
+					<th class="systemsTable">System Hostname</th>
+					<th class="systemsTable">Root Password</th>
+				</tr>
+			</thead>
+
+			<tfoot class="systemsTable">
+				<tr class="systemsTable"><td colspan="2" class="systemsTable">
+					<div id="allSameDiv" class="invisible">
+						<input type="checkbox" class="allSameCheckBox" name="allSameCheckBox" id="allSameCheckBox" onClick="allPasswdsSame(this.form);"/><span>Check if storage system passwords are identical.</span>
+					</div>
+				</td></tr>
+
+				<tr class="systemsTable"><td class="systemsTable" colspan="2">
+					<div class="systemsTableEnd">
+						<input type="button" value="Add another entry" onClick="addSystem(this.form);" />
+					</div>
+				</td></tr>
+			</tfoot>
+
+			<tbody class="systemsTable">
+				<tr class="systemsTable">
+					<td class="systemsTable">
+						<input class="hbInputSys" type="text"
+							id="__SYSTEM0:Addr" name="__SYSTEM0:Addr" />
+					</td>
+					<td class="systemsTable">
+						<input type="password" autocomplete="off"
+							id="__SYSTEM0:Passwd" name="__SYSTEM0:Passwd"
+							class="hbInputPass"
+							onChange="pwd0Change(this.form);" />
+					</td>
+				</tr>
+
+				<tal:block tal:define="global numsys python: 0" />
+
+				<tal:block tal:repeat="s python:systems[2]">
+					<tal:block tal:define="global numsys python: numsys + 1" />
+					<tr class="systemsTable">
+						<td class="systemsTable">
+							<input class="hbInputSys" type="text"
+								tal:attributes="
+									id python: '__SYSTEM' + str(numsys) + ':Addr';
+									name python: '__SYSTEM' + str(numsys) + ':Addr'" />
+						</td>
+
+						<td class="systemsTable">
+							<input type="password" autocomplete="off"
+								onChange="pwd0Change(this.form);"
+								class="hbInputPass"
+								tal:attributes="
+									id python: '__SYSTEM' + str(numsys) + ':Password';
+									name python: '__SYSTEM' + str(numsys) + ':Password'" />
+						</td>
+					</tr>
+				</tal:block>
+			</tbody>
+		</table>
+
+		<input type="hidden" name="numStorage" value="1" />
+
+		<div class="hbSubmit" id="hbSubmit">
+			<input type="button" name="Submit" value="Submit"
+				onClick="validateAuth(this.form)" />
+		</div>
+	</form>
+
 	<form name="adminform" method="post" action=""
 		tal:condition="python:(systems[0] and len(systems[0]) > 0) or (systems[1] and len(systems[1]) > 0)">
 
 		<span tal:omit-tag="" tal:define="global blankForm python:0" />
 
-		<h2 class="homebase" tal:condition="python:systems">
-			Manage Systems and Clusters
-		</h2>
 
 		<input type="hidden" name="pagetype"
 			tal:attributes="value request/form/pagetype | request/pagetype | nothing" />
 
-		Check storage systems and clusters to remove from the Luci management interface.
+		<h3>Check storage systems and clusters to remove from the Luci management interface.</h3>
 
 		<h3 class="homebase" tal:condition="python: systems[0] and len(systems[0]) > 0">
 			Clusters
luci/homebase/validate_sys_remove.js +21 -0
@@ -43,3 +43,24 @@
 		form.submit();
 	return (0);
 }
+
+function validateAuth(form) {
+	var errors = new Array();
+
+	if (!form)
+		return (-1);
+
+	var added_storage = validate_systems(form, errors);
+
+	if (error_dialog(errors))
+		return (-1);
+
+	if (!added_storage || added_storage.length < 1)
+		errors.push('You have not specified any hosts.');
+
+	if (error_dialog(errors))
+		return (-1);
+
+	form.submit();
+	return (0);
+}
luci/site/luci/Extensions/conga_constants.py +8 -7
@@ -98,13 +98,14 @@
 
 
 # Homebase-specific constants
-HOMEBASE_ADD_USER="1"
-HOMEBASE_ADD_SYSTEM="2"
-HOMEBASE_PERMS="3"
-HOMEBASE_DEL_USER="4"
-HOMEBASE_DEL_SYSTEM="5"
-HOMEBASE_ADD_CLUSTER="6"
-HOMEBASE_ADD_CLUSTER_INITIAL="7"
+HOMEBASE_ADD_USER = "1"
+HOMEBASE_ADD_SYSTEM = "2"
+HOMEBASE_PERMS = "3"
+HOMEBASE_DEL_USER = "4"
+HOMEBASE_DEL_SYSTEM = "5"
+HOMEBASE_ADD_CLUSTER = "6"
+HOMEBASE_ADD_CLUSTER_INITIAL = "7"
+HOMEBASE_AUTH = "8"
 
 # Cluster node exception attribute flags
 CLUSTER_NODE_NEED_AUTH = 0x01
luci/site/luci/Extensions/homebase_adapters.py +84 -11

122 lines not on this page · raw message