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

rmccabe at sourceware.org rmccabe at sourceware.org
Wed Feb 7 22:06:41 UTC 2007


CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2007-02-07 22:06:40

Modified files:
	.              : .cvsignore 
	luci/cluster   : form-macros 
	luci/site/luci/Extensions: cluster_adapters.py 
Added files:
	luci/cluster   : validate_fdom.js 

Log message:
	fdom front-end code

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/.cvsignore.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_fdom.js.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.179&r2=1.180
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.231&r2=1.232

--- conga/.cvsignore	2007/01/23 22:32:29	1.4
+++ conga/.cvsignore	2007/02/07 22:06:40	1.5
@@ -1,13 +1,10 @@
-Plone-2.5.tar.gz
-Plone-2.5.2-1.tar.gz
-Zope-2.9.3.tgz
-Zope-2.9.4-final.tgz
+Plone-*.tar.gz
+Zope-*.tgz
 conga.spec.in
 conga.spec
 clustermon.spec.in
 clustermon.spec
-clustermon-*.src.rpm
+clustermon-*.rpm
 clustermon-*.tar.gz
-conga-*.src.rpm
+conga-*.rpm
 conga-*.tar.gz
-
/cvs/cluster/conga/luci/cluster/validate_fdom.js,v  -->  standard output
revision 1.1
--- conga/luci/cluster/validate_fdom.js
+++ -	2007-02-07 22:06:41.540519000 +0000
@@ -0,0 +1,25 @@
+function fdom_set_prioritized(form, state) {
+	var prilist = form.getElementsByTagName('input');
+	if (!prilist)
+		return (-1);
+	for (var i = 0 ; i < prilist.length ; i++) {
+		if (prilist[i].type == 'text' && prilist[i].className == 'fdom_priority')
+			prilist[i].disabled = state;
+	}
+}
+
+function validate_add_fdom(form) {
+	var errors = new Array();
+
+	if (!form.name || str_is_blank(fdom.name.value)) {
+		set_form_err(form.name);
+		errors.append('No name was given for this failover domain.');
+	} else
+		clr_form_err(form.name);
+
+	if (error_dialog(errors))
+		return (-1);
+
+	if (confirm('Add this failover domain?'))
+		form.submit();
+}
--- conga/luci/cluster/form-macros	2007/02/07 17:18:42	1.179
+++ conga/luci/cluster/form-macros	2007/02/07 22:06:40	1.180
@@ -944,7 +944,8 @@
 					</td>
 				</tr>
 				<tr class="systemsTable">
-					<td class="systemsTable">Run XVM fence daemon</td>
+					<td class="systemsTable">
+						<span class="cluster_help" title="Enable if you will be running a VM cluster on this physical cluster">Run XVM fence daemon</td>
 					<td class="systemsTable">
 						<input type="checkbox" name="run_xvmd"
 							tal:attributes="checked python: ('fence_xvmd' in clusterinfo and clusterinfo['fence_xvmd']) and 'checked' or ''" />
@@ -4321,12 +4322,95 @@
 	</div>
 </div>
 
+<tal:block metal:define-macro="fdom-macro">
+<script type="text/javascript"
+	src="/luci/cluster/validate_fdom.js">
+</script>
+
+<form method="post" action="">
+	<input type="hidden" name="clustername"
+		tal:attributes="value request/clustername | nothing" />
+	<input type="hidden" name="pagetype"
+		tal:attributes="value request/pagetype | nothing" />
+	<input type="hidden" name="oldname"
+		tal:condition="exists: fdom/name"
+		tal:attributes="value fdom/name | nothing" />
+	
+	<table class="systemsTable" width="100%">
+		<thead class="systemsTable">
+			<tr class="systemsTable">
+				<td><strong>Failover Domain Name</strong></td>
+				<td>
+					<input type="text" name="name"
+						tal:attributes="value fdom/name | nothing" />
+				</td>
+			</tr>
+			<tr class="systemsTable">
+				<td>Prioritized</td>
+				<td>
+					<input type="checkbox" name="prioritized"
+						onchange="fdom_set_prioritized(this.form, !this.checked)"
+						tal:attributes="checked fdom/prioritied | nothing" />
+				</td>
+			</tr>
+			<tr class="systemsTable">
+				<td>Restrict failover to this domain's members</td>
+				<td>
+					<input type="checkbox" name="restricted"
+						tal:attributes="checked fdom/restricted | nothing" />
+				</td>
+			</tr>
+			<tr class="systemsTable">
+				<td class="systemsTable" colspan="2">
+					<p></p>
+					<p class="reshdr">Failover domain membership</p>
+				</td>
+			</tr>
+		</thead>
+
+		<tfoot class="systemsTable">
+			<tr class="systemsTable"><td>
+				<div class="hbSubmit">
+					<input type="button" name="submit" value="Submit" />
+				</div>
+			</td></tr>
+		</tfoot>
+
+		<tbody width="60%">
+			<tr class="systemsTable">
+				<th class="systemsTable" width="33%">Node</th>
+				<th class="systemsTable" width="10%">Member</th>
+				<th class="systemsTable" width="57%">Priority</th>
+			</tr>
+			<tal:block tal:repeat="n python:here.getnodes(modelb)">
+				<tr class="systemsTable">
+					<td class="systemsTable" width="33%">
+						<tal:block tal:replace="n" />
+					<td class="systemsTable" width="10%">
+						<input type="checkbox" name="n" />
+					</td>
+					<td class="systemsTable" width="75%">
+						<input type="text" class="fdom_priority"
+							tal:attributes="
+								name python: '__PRIORITY__:' + n;
+								value from/members/n/priority | string:1;
+								disabled not:fdom/prioritied | nothing" />
+					</td>
+				</tr>
+			</tal:block>
+		</tbody>
+	</table>
+</form>
+
+</tal:block>
+
 <div metal:define-macro="fdomadd-form">
 	<script type="text/javascript">
 		set_page_title('Luci — cluster — failover domains — Add a failover domain');
 	</script>
-	<h2>Failover Domain Add Form</h2>
-  <tal:block tal:define="allnodes python:here.getFdomNodes(request)"/>
+
+	<h2>Add a Failover Domain</h2>
+	<tal:block metal:use-macro="here/form-macros/macros/fdom-macro" />
 </div>
 
 <div metal:define-macro="fdomconfig-form">
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/02/07 22:00:50	1.231
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/02/07 22:06:40	1.232
@@ -2247,12 +2247,11 @@
   return dummynode
 
 def getnodes(self, model):
-  mb = model
-  nodes = mb.getNodes()
-  names = list()
-  for node in nodes:
-    names.append(node.getName())
-  return names
+	try:
+		return map(lambda x: str(x.getName()), model.getNodes())
+	except Exception, e:
+		luci_log.debug_verbose('getnodes0: %s' % str(e))
+	return []
 
 def createCluConfigTree(self, request, model):
   dummynode = {}




More information about the Cluster-devel mailing list