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

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



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2007-01-30 22:26:00

Modified files:
	luci/cluster   : form-macros 
	luci/homebase  : luci_homebase.css 
Added files:
	luci/cluster   : validate_create_gulm.js 

Log message:
	GULM cluster deployment frontend

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_create_gulm.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.166&r2=1.167
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.35&r2=1.36

/cvs/cluster/conga/luci/cluster/validate_create_gulm.js,v  -->  standard output
revision 1.1
--- conga/luci/cluster/validate_create_gulm.js
+++ -	2007-01-30 22:26:01.117762000 +0000
@@ -0,0 +1,65 @@
+var lockservers = new Array();
+
+function toggle_gulm(form, lock_type) {
+	var gulm_div = document.getElementById('gulm_lockservers');
+	if (!gulm_div)
+		return (-1);
+
+	var ielem = gulm_div.getElementsByTagName('input');
+
+	if (lock_type != 'gulm') {
+		lockservers = new Array();
+		for (var i = 0 ; i < ielem.length ; i++) {
+			lockservers[i] = ielem[i].value;
+			ielem[i].value = null;
+			ielem[i].disabled = 'disabled';
+		}
+		gulm_div.className = 'invisible';
+	} else {
+		for (var i = 0 ; i < ielem.length ; i++)
+			ielem[i].disabled = null;
+		for (var i = 0 ; i < lockservers.length ; i++)
+			ielem[i].value = lockservers[i];
+		gulm_div.className = null;
+		lockservers = new Array();
+	}
+}
+
+function check_gulm_lkserv() {
+	var errors = new Array();
+	var gulm_div = document.getElementById('gulm_lockservers');
+	if (!gulm_div) {
+		errors.push('Exactly 1, 3, or 5 GULM lock servers must be given.');
+		return (errors);
+	}
+
+	var lcount = 0;
+	var ielem = gulm_div.getElementsByTagName('input');
+	if (!ielem) {
+		errors.push('Exactly 1, 3, or 5 GULM lock servers must be given.');
+		return (errors);
+	}
+
+	for (var i = 0 ; i < ielem.length ; i++) {
+		if (ielem[i]) {
+			if (str_is_blank(ielem[i].value))
+				ielem[i].value = null;
+			else
+				lcount++;
+		}
+	}
+
+	if (lcount != 1 && lcount != 3 && lcount != 5)
+		errors.push('Exactly 1, 3, or 5 GULM lock servers must be given.');
+
+	return (errors);
+}
+
+function validate_cluster_create(form) {
+	if (form.lockmanager && !form.lockmanager[0].checked) {
+		var errors = check_gulm_lkserv();
+		if (error_dialog(errors))
+			return (-1);
+	}
+	return validateForm(form);
+}
--- conga/luci/cluster/form-macros	2007/01/30 21:39:32	1.166
+++ conga/luci/cluster/form-macros	2007/01/30 22:26:00	1.167
@@ -202,6 +202,8 @@
 	<script type="text/javascript"
 		src="/luci/homebase/validate_cluster_add.js">
 	</script>
+	<script type="text/javascript"
+		src="validate_create_gulm.js">
 	<script type="text/javascript">
 		set_page_title('Luci — cluster — Deploy a cluster');
 	</script>
@@ -209,7 +211,7 @@
 	<tal:block tal:omit-tag=""
 		tal:define="global sessionObj python: request.SESSION.get('checkRet')" />
 
-	<h1>Add a cluster</h1>
+	<h1>Create a new cluster</h1>
 
 	<form name="create_cluster" action="" method="post"
 		tal:define="
@@ -243,18 +245,24 @@
 			</thead>
 
 			<tfoot class="systemsTable">
+				<tr class="systemsTable"><td class="systemsTable" colspan="2">
+					<div class="systemsTableEnd">
+						<input type="button" value="Add a cluster node"
+							onClick="addSystem(this.form)" />
+					</div>
+				</td></tr>
 				<tr class="systemsTable"><td colspan="2" class="systemsTable">
 					<input type="hidden" name="trust_shown" value="1"
 						tal:condition="add_cluster" />
 					<ul class="vanilla deploy">
 						<li class="vanilla">
-							<input type="radio" name="download_pkgs"
-								value="1" checked="checked" />
+							<input type="radio" name="download_pkgs" value="1"
+								tal:attributes="checked python: (not add_cluster or not 'download_pkgs' in add_cluster or add_cluster['download_pkgs'] != 0) and 'checked' or ''" />
 							Download packages
 						</li>
 						<li class="vanilla">
-							<input type="radio" name="download_pkgs"
-								value="0" />
+							<input type="radio" name="download_pkgs" value="0"
+								tal:attributes="checked python: (add_cluster and 'download_pkgs' in add_cluster and add_cluster['download_pkgs'] == 0) and 'checked' or ''" />
 							Use locally installed packages.
 						</li>
 					</ul>
@@ -281,12 +289,88 @@
 						</li>
 					</ul>
 				</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>
+
+				<tr class="systemsTable"
+					tal:condition="exists:add_cluster/gulm_support">
+					<td class="systemsTable" colspan="2">
+						<strong class="cluster">Lock Manager</strong>
+						<ul class="vanilla">
+							<li class="vanilla">
+								<input type="radio"
+									name="lockmanager" value="dlm"
+									onchange="toggle_gulm(this.form, this.value)"
+									tal:attributes="checked python: not add_cluster or not 'lockmanager' in add_cluster or add_cluster['lockmanager'] != 'gulm'"
+								>DLM (preferred)
+							</li>
+							<li class="vanilla">
+								<input type="radio"
+									name="lockmanager" value="gulm"
+									onchange="toggle_gulm(this.form, this.value)"
+									tal:attributes="checked python: add_cluster and 'lockmanager' in add_cluster and add_cluster['lockmanager'] == 'gulm'"
+								>GULM
+							</li>
+							<div id="gulm_lockservers" class="invisible">
+								<fieldset>
+								<legend class="rescfg">GULM lock server properties</legend>
+								<p>You must enter exactly 1, 3, or 5 GULM lock servers.</p>
+
+								<table class="systemsTable">
+									<tr>
+										<td class="pad_right">Lock Server 1</td>
+										<td>
+											<input type="text"
+												name="__GULM__:server1"
+												tal:attributes="
+													disabled python: not add_cluster or not 'lockmanager' in add_cluster or add_cluster['lockmanager'] != 'gulm';
+													value gulm_lockservers/server1 | nothing" />
+										</td>
+									</tr>
+									<tr>
+										<td class="pad_right">Lock Server 2</td>
+										<td>
+											<input type="text"
+												name="__GULM__:server2"
+												tal:attributes="
+													disabled python: not add_cluster or not 'lockmanager' in add_cluster or add_cluster['lockmanager'] != 'gulm';
+													value gulm_lockservers/server2 | nothing" />
+										</td>
+									</tr>
+									<tr>
+										<td class="pad_right">Lock Server 3</td>
+										<td>
+											<input type="text"
+												name="__GULM__:server3"
+												tal:attributes="
+													disabled python: not add_cluster or not 'lockmanager' in add_cluster or add_cluster['lockmanager'] != 'gulm';
+													value gulm_lockservers/server3 | nothing" />
+										</td>
+									</tr>
+									<tr>
+										<td class="pad_right">Lock Server 4</td>
+										<td>
+											<input type="text"
+												name="__GULM__:server4"
+												tal:attributes="
+													disabled python: not add_cluster or not 'lockmanager' in add_cluster or add_cluster['lockmanager'] != 'gulm';
+													value gulm_lockservers/server4 | nothing" />
+										</td>
+									</tr>
+									<tr>
+										<td class="pad_right">Lock Server 5</td>
+										<td>
+											<input type="text"
+												name="__GULM__:server5"
+												tal:attributes="
+													disabled python: not add_cluster or not 'lockmanager' in add_cluster or add_cluster['lockmanager'] != 'gulm';
+													value gulm_lockservers/server5 | nothing" />
+										</td>
+									</tr>
+								</table>
+								</fieldset>
+							</div>
+						<ul>
+					</td>
+				</tr>
 			</tfoot>
 
 			<tal:block tal:define="global cur_sysnum python:0" />
@@ -424,7 +508,7 @@
 
 		<div class="hbSubmit" id="hbSubmit">
 			<input type="button" name="Submit" value="Submit"
-				onClick="validateForm(this.form)" />
+				onClick="validate_cluster_create(this.form)" />
 		</div>
 	</form>
 
@@ -3386,13 +3470,13 @@
 						<li class="vanilla">
 							<input type="radio" name="download_pkgs" value="1"
 								tal:attributes="
-									checked add_system/download_pkgs | string:checked" />
+									checked add_cluster/download_pkgs | string:checked" />
 							Download packages
 						</li>
 						<li class="vanilla">
 							<input type="radio" name="download_pkgs" value="0"
 								tal:attributes="
-									checked not: add_system/download_pkgs | nothing" />
+									checked not: add_cluster/download_pkgs | nothing" />
 							
 							Use locally installed packages.
 						</li>
@@ -3401,7 +3485,7 @@
 				<tr class="systemsTable"><td colspan="2" class="systemsTable">
 					<input type="checkbox" name="enable_storage"
 						tal:attributes="
-							checked add_system/shared_storage | nothing" />
+							checked add_cluster/shared_storage | nothing" />
 					Enable Shared Storage Support
 				</td></tr>
 				<tr class="systemsTable"><td colspan="2" class="systemsTable">
@@ -3650,7 +3734,7 @@
 </div>
 
 <div metal:define-macro="xenvmadd-form">
-  <span tal:define="global vmforminfo python: here.getXenVMInfo(modelb, request)/>
+  <span tal:define="global vmforminfo python: here.getXenVMInfo(modelb, request)"/>
   <form method="get" action="" tal:attributes="action vmforminfo/formurl">
   <h4>Name for this VM: </h4><input type="text" name="xenvmname" value=""/>
   <h4>Path to configuration file: </h4><input type="text" name="xenvmpath" value=""/>
--- conga/luci/homebase/luci_homebase.css	2007/01/24 20:21:32	1.35
+++ conga/luci/homebase/luci_homebase.css	2007/01/30 22:26:00	1.36
@@ -18,6 +18,10 @@
 	margin-left: +.3333em;
 }
 
+td.pad_right {
+	padding-right: +.6666em;
+}
+
 form.form_border {
 	border-bottom: 1px solid #8cacbb;
 }
@@ -493,7 +497,7 @@
 	max-width: 700px;
 }
 
-div.rescfg {
+*.rescfg {
 	background: #dee7ec;
 }
 


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