Skip to contentSkip to conversation

conga/luci/homebase form-chooser form-macros h ...

Cluster-devel [email protected] 1 participant 1 message Jul 18, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-07-18 19:25:20

Modified files:
luci/homebase : form-chooser form-macros homebase_common.js
index_html luci_homebase.css validate_cluster_add.js
Added files:
luci/homebase : validate_cluster_add_initial.js

Log message:
cluster pull-in frontened

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/validate_cluster_add_initial.js.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-chooser.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/homebase_common.js.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/index_html.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/validate_cluster_add.js.diff?cvsroot=cluster&r1=1.2&r2=1.3

/cvs/cluster/conga/luci/homebase/validate_cluster_add_initial.js,v --> standard output revision 1.1

- renamed from luci/homebase/validate_cluster_add_initial.js +22 -0
@@ -0,0 +1,22 @@
+function validateForm(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 added any cluster nodes.');
+
+	if (error_dialog(errors))
+		return (-1);
+
+	if (confirm('Retrieve cluster information from ' + added_storage[0] + '?'))
+		form.submit();
+
+	return (0);
+}
luci/homebase/form-chooser +5 -1
@@ -5,7 +5,7 @@
 </head>
 
 <tal:comment replace="nothing">
-	$Id: form-chooser,v 1.8 2006/06/20 21:21:47 rmccabe Exp $
+	$Id: form-chooser,v 1.9 2006/07/18 19:25:20 rmccabe Exp $
 </tal:comment>
 
 <body>
@@ -40,6 +40,10 @@
 	<span tal:omit-tag="" tal:condition="python: ptype == '6'">
 		<div metal:use-macro="here/form-macros/macros/cluster-add-form" />
 	</span>
+
+	<span tal:omit-tag="" tal:condition="python: ptype == '7'">
+		<div metal:use-macro="here/form-macros/macros/cluster-add-initial-form" />
+	</span>
 </metal:choose-form>
 
 </body>
luci/homebase/form-macros +110 -26

194 lines not on this page · raw message

luci/homebase/homebase_common.js +6 -2
@@ -85,13 +85,16 @@
 	var num_systems = form.numStorage.value;
 
 	var state = cb.checked;
-	var passwd = document.getElementById('__SYSTEM0:Passwd').value;
+	var passwd = document.getElementById('__SYSTEM0:Passwd');
+	if (!passwd || passwd.type != 'password')
+		return (-1);
+	passwd = passwd.value;
 	if (!passwd || !state)
 		passwd = '';
 
 	for (var i = 1 ; i < num_systems ; i++) {
 		var element = document.getElementById('__SYSTEM' + i + ':Passwd')
-		if (element) {
+		if (element && element.type == 'password') {
 			element.value = passwd;
 			element.disabled = state;
 		}
@@ -161,6 +164,7 @@
 
 		if (!element)
 			continue;
+		element.disabled = false;
 
 		var pwdElem = document.getElementById('__SYSTEM' + i + ':Passwd');
 		if (!element.value) {
luci/homebase/index_html +1 -3
@@ -15,7 +15,7 @@
 					xml:lang language">
 
 <tal:comment replace="nothing">
-	$Id: index_html,v 1.11 2006/07/05 20:26:00 rmccabe Exp $
+	$Id: index_html,v 1.12 2006/07/18 19:25:20 rmccabe Exp $
 </tal:comment>
 
 <head metal:use-macro="here/header/macros/html_header">
@@ -139,8 +139,6 @@
 			tal:define="global ret python: request.SESSION.get('checkRet')"
 		/>
 
-		<span tal:omit-tag="" tal:condition="python:request.SESSION.set('checkRet',{})" />
-
 		<div class="retmsgs" id="retmsgsdiv" tal:condition="python:(ret and 'messages' in ret and len(ret['messages']))">
 			<div class="hbclosebox">
 				<a href="javascript:hide_element('retmsgsdiv');"><img src="x.png"></a>
luci/homebase/luci_homebase.css +2 -2
@@ -1,11 +1,11 @@
-/* $Id: luci_homebase.css,v 1.7 2006/07/05 20:13:03 rmccabe Exp $ */
+/* $Id: luci_homebase.css,v 1.8 2006/07/18 19:25:20 rmccabe Exp $ */
 
 *.errmsgs,*.retmsgs {
 	list-style-image: none !important;
 	list-style-type: none !important;
 }
 
-*.errmsgs {
+*.error, *.errmsgs {
 	color: red !important;
 }
 
luci/homebase/validate_cluster_add.js +5 -12
@@ -4,19 +4,12 @@
 	if (!form)
 		return (-1);
 
-	if (form.clusterList) {
-		i = form.clusterList.selectedIndex;
-		if (i < 0 || !form.clusterList[i])
-			errors.push('You have not selected a valid cluster.');
-		else
-			clusterName = form.clusterList[i].value;
-	} else if (form.clusterName)
-		clusterName = form.clusterName.value;
-
-	if (str_is_blank(clusterName)) {
+	var clusterName = form.clusterName;
+	if (!clusterName || str_is_blank(clusterName.value)) {
 		errors.push('No cluster name was given.');
 	} else {
-		var invalid_chars = str_is_valid(form.clusterName.value, '/[0-9A-Za-z_. -]/g');
+		clusterName = clusterName.value;
+		var invalid_chars = str_is_valid(clusterName, '/[0-9A-Za-z_. -]/g');
 		if (invalid_chars)
 			errors.push('The cluster name you gave contains the following invalid characters: "' + invalid_chars + '".');
 	}
@@ -32,7 +25,7 @@
 	if (error_dialog(errors))
 		return (-1);
 
-	if (confirm("Submit form?"))
+	if (confirm('Add the cluster \"' + clusterName + '\" to the Luci management interface?'))
 		form.submit();
 
 	return (0);