CVSROOT: /cvs/cluster
Module name: conga
Changes by: [EMAIL PROTECTED] 2008-01-22 15:02:33
Modified files:
luci/homebase : form-macros homebase_common.js index_html
validate_cluster_add_initial.js
validate_sys_remove.js
luci/plone-custom: conga.js conga_ajax.js
luci/cluster : form-chooser form-macros index_html
Added files:
luci/plone-custom: update_hostinfo.js validate_auth.js
Log message:
sync up with my local tree
- fixes for 252348 and 230462
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/homebase_common.js.diff?cvsroot=cluster&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/index_html.diff?cvsroot=cluster&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/validate_cluster_add_initial.js.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/validate_sys_remove.js.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/update_hostinfo.js.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/validate_auth.js.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/conga.js.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/conga_ajax.js.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-chooser.diff?cvsroot=cluster&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.218&r2=1.219
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/index_html.diff?cvsroot=cluster&r1=1.40&r2=1.41
--- conga/luci/homebase/form-macros 2008/01/03 16:27:49 1.64
+++ conga/luci/homebase/form-macros 2008/01/22 15:02:32 1.65
@@ -289,6 +289,9 @@
-> if yes, confirm again, showing list
</tal:comment>
+ <script type="text/javascript" src="conga_ajax.js"></script>
+ <script type="text/javascript" src="update_hostinfo.js"></script>
+ <script type="text/javascript" src="validate_auth.js"></script>
<script type="text/javascript"
src="/luci/homebase/validate_sys_remove.js">
</script>
@@ -313,6 +316,7 @@
<tr class="systemsTable">
<th class="systemsTable">System
Hostname</th>
<th class="systemsTable">Root
Password</th>
+ <th class="systemsTable">Key
ID</th>
<th class="systemsTable"></th>
</tr>
</thead>
@@ -321,6 +325,7 @@
<tr class="systemsTable"
id="__SYSTEM_ROW_0">
<td class="systemsTable">
<input
class="hbInputSys" type="text"
+
onchange="reset_system_info(this)"
id="__SYSTEM0:Addr" name="__SYSTEM0:Addr" />
</td>
<td class="systemsTable">
@@ -332,6 +337,10 @@
onchange="pwd0Change(this.form)" />
</td>
<td class="systemsTable">
+ <img
id="__SYSTEM0Fingerprint" src="lock-open.png"
+ title="no key
fingerprint available" />
+ </td>
+ <td class="systemsTable">
<img
src="delete-row.png" class="deleteRow"
title="delete
this row"
onclick="delete_element_id('__SYSTEM_ROW_0')" />
@@ -363,6 +372,7 @@
<input type="hidden"
name="trust_shown" value="1" />
<input
class="hbInputSys" type="text"
+
onchange="reset_system_info(this)"
tal:attributes="
id
python: '__SYSTEM%d:Addr' % cur_sysnum;
name
python: '__SYSTEM%d:Addr' % cur_sysnum;
@@ -379,10 +389,10 @@
value
nothing" />
</td>
<td class="systemsTable">
- <img
- tal:attributes="
- src
python: 'trusted' in sys and 'lock-ok.png' or ('fp' in sys and
'lock-closed.png' or 'lock-open.png');
- title
sys/fp | string:no key fingerprint available"
+ <img tal:attributes="
+ id python:
'__SYSTEM%dFingerprint' % cur_sysnum;
+ src python:
'trusted' in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or
'lock-open.png');
+ title sys/fp |
string:no key fingerprint available"
/>
<input type="hidden"
tal:condition="exists: sys/fp"
@@ -416,10 +426,6 @@
<tfoot class="systemsTable">
<tr class="systemsTable"><td colspan="2"
class="systemsTable">
<ul class="vanilla">
- <li class="vanilla">
- <input
name="check_certs" id="view_certs"
-
onchange="view_certs_only(this.form, this.checked)"
-
type="checkbox">View system certificates before sending any passwords.</li>
<li class="vanilla"
tal:attributes="id
python: cur_sysnum < 2 and 'allSameDiv' or ''">
<input type="checkbox"
name="allSameCheckBox"
@@ -441,38 +447,55 @@
<input name="numStorage" id="numStorage" type="hidden"
tal:attributes="value cur_sysnum | string:1" />
- <input type="hidden" name="pagetype" value="8" />
+ <input type="hidden" name="pagetype" value="1003" />
+
+ <div class="hbSubmit">
+ <div class="hbSubmit">
+ <input type="button" name="View SSL cert fingerprints"
+ value="View SSL cert fingerprints"
+ onclick="get_system_info('auth_retmsgsdiv',
'auth_errmsgsdiv')" />
+ </div>
<div class="hbSubmit" id="hbSubmit">
<input type="button" name="Submit" value="Submit"
onclick="validateAuth(this.form)" />
</div>
- <tal:block tal:condition="exists: request/SESSION/auth_status">
- <div class="retmsgs" id="auth_retmsgsdiv"
- tal:condition="exists:
request/SESSION/auth_status/messages">
- <div class="hbclosebox">
- <a
href="javascript:hide_element('auth_retmsgsdiv');"><img src="x.png"
class="closeBox" title="dismiss"></a>
- </div>
- <p class="retmsgs">Status messages:</p>
- <ul class="statusmsg">
- <tal:block tal:repeat="e
request/SESSION/auth_status/messages">
- <li class="statusmsg"
tal:content="e" />
- </tal:block>
- </ul>
+ <tal:block tal:define="global have_retmsgs
exists:request/SESSION/auth_status/messages" />
+ <tal:block tal:define="global have_errmsgs
exists:request/SESSION/auth_status/errors" />
+
+ <div id="auth_retmsgsdiv"
+ tal:attributes="class python:'retmsgs' + (have_retmsgs
and ' ' or ' invisible')">
+ <div class="hbclosebox">
+ <a
href="javascript:hide_msgs('auth_retmsgsdiv')"><img src="x.png"
class="closeBox" title="dismiss"></a>
</div>
- <div class="errmsgs" id="auth_errmsgsdiv"
- tal:condition="exists:
request/SESSION/auth_status/errors">
- <div class="hbclosebox">
- <a
href="javascript:hide_element('auth_errmsgsdiv');"><img src="x.png"
class="closeBox" title="dismiss"></a>
- </div>
- <p class="errmsgs">The following errors
occurred:</p>
- <ul class="statusmsg">
- <tal:block tal:repeat="e
request/SESSION/auth_status/errors">
- <li class="statusmsg"
tal:content="e" />
- </tal:block>
- </ul>
+
+ <p class="retmsgs">Status messages:</p>
+ <ul class="statusmsg">
+ <tal:block
+
tal:condition="exists:request/SESSION/auth_status/messages"
+ tal:repeat="e
request/SESSION/auth_status/messages">
+ <li class="statusmsg" tal:content="e" />
+ </tal:block>
+ </ul>
+ </div>
+
+ <div id="auth_errmsgsdiv"
+ tal:attributes="class python:'errmsgs' + (have_errmsgs
and ' ' or ' invisible')">
+ <div class="hbclosebox">
+ <a
href="javascript:hide_msgs('auth_errmsgsdiv')"><img src="x.png"
class="closeBox" title="dismiss"></a>
</div>
+ <p class="errmsgs">The following errors occurred:</p>
+ <ul class="statusmsg">
+ <tal:block
+
tal:condition="exists:request/SESSION/auth_status/errors"
+ tal:repeat="e
request/SESSION/auth_status/errors">
+ <li class="statusmsg" tal:content="e" />
+ </tal:block>
+ </ul>
+ </div>
+
+ <tal:block tal:condition="exists:request/SESSION/auth_status">
<tal:block
tal:define="x python:
request.SESSION.delete('auth_status')" />
<div class="padding"> </div>
@@ -589,6 +612,8 @@
<script type="text/javascript" src="/luci/homebase/validate_sys_add.js">
</script>
+ <script type="text/javascript" src="conga_ajax.js"></script>
+ <script type="text/javascript" src="update_hostinfo.js"></script>
<script type="text/javascript">
set_page_title('Luci â homebase â Add a storage system to
be managed by Luci');
@@ -610,6 +635,7 @@
<tr class="systemsTable">
<th class="systemsTable">System
Hostname</th>
<th class="systemsTable">Root
Password</th>
+ <th class="systemsTable">Key
ID</th>
<th class="systemsTable"></th>
</tr>
</thead>
@@ -618,6 +644,7 @@
<tr class="systemsTable"
id="__SYSTEM_ROW_0">
<td class="systemsTable">
<input
class="hbInputSys" type="text"
+
onchange="reset_system_info(this)"
id="__SYSTEM0:Addr" name="__SYSTEM0:Addr" />
</td>
<td class="systemsTable">
@@ -629,6 +656,10 @@
onchange="pwd0Change(this.form)" />
</td>
<td class="systemsTable">
+ <img
src="lock-open.png" id="__SYSTEM0Fingerprint"
+ title="no key
fingerprint available" />
+ </td>
+ <td class="systemsTable">
<img
src="delete-row.png" class="deleteRow"
title="delete
this row"
onclick="delete_element_id('__SYSTEM_ROW_0')" />
@@ -643,7 +674,6 @@
<th class="systemsTable">System
Hostname</th>
<th class="systemsTable">Root
Password</th>
<th class="systemsTable">Key
ID</th>
- <th
class="systemsTable">Trust</th>
<th class="systemsTable"></th>
</tr>
</thead>
@@ -660,6 +690,7 @@
<input type="hidden"
name="trust_shown" value="1" />
<input
class="hbInputSys" type="text"
+
onchange="reset_system_info(this)"
tal:attributes="
id
python: '__SYSTEM%d:Addr' % cur_sysnum;
name
python: '__SYSTEM%d:Addr' % cur_sysnum;
@@ -677,17 +708,10 @@
</td>
<td class="systemsTable">
- <img
- tal:attributes="
- src
python: 'trusted' in sys and 'lock-ok.png' or ('fp' in sys and
'lock-closed.png' or 'lock-open.png');
- title
sys/fp | string:no key fingerprint available"
- />
- <input type="hidden"
-
tal:condition="exists: sys/fp"
- tal:attributes="
- id
python: '__SYSTEM%dFingerprint' % cur_sysnum;
- name
python: '__SYSTEM%dFingerprint' % cur_sysnum;
- value
sys/fp | nothing" />
+ <img tal:attributes="
+ id python:
'__SYSTEM%dFingerprint' % cur_sysnum;
+ src python:
'trusted' in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or
'lock-open.png');
+ title sys/fp |
string:no key fingerprint available" />
</td>
<td class="systemsTable">
<input type="checkbox"
checked tal:attributes="
@@ -714,12 +738,8 @@
<tfoot class="systemsTable">
<tr class="systemsTable"><td colspan="2"
class="systemsTable">
<ul class="vanilla">
- <li class="vanilla">
- <input
name="check_certs" id="view_certs"
-
onchange="view_certs_only(this.form, this.checked)"
-
type="checkbox">View system certificates before sending any passwords.</li>
<li class="vanilla"
- tal:attributes="id
python: cur_sysnum < 2 and 'allSameDiv' or ''"><input type="checkbox"
name="allSameCheckBox" id="allSameCheckBox"
onclick="allPasswdsSame(this.form);"/>Check if storage system passwords are
identical.</li>
+ tal:attributes="id
python: cur_sysnum < 2 and 'allSameDiv' or ''"><input type="checkbox"
name="allSameCheckBox" id="allSameCheckBox"
onclick="allPasswdsSame(this.form);"/>Check if system passwords are
identical.</li>
</ul>
</td></tr>
@@ -729,6 +749,15 @@
onclick="addSystem(this.form)" />
</div>
</td></tr>
+
+ <tr class="systemsTable"><td
class="systemsTable" colspan="2">
+ <div class="systemsTableEnd">
+ <input type="button"
+ name="View SSL
cert fingerprints"
+ value="View SSL
cert fingerprints"
+
onclick="get_system_info('retmsgsdiv', 'errmsgsdiv')" />
+ </div>
+ </td></tr>
</tfoot>
</table>
@@ -801,8 +830,7 @@
<tr class="systemsTable">
<th class="systemsTable">Node
Hostname</th>
<th class="systemsTable">Root
Password</th>
- <th tal:condition="asked_for_certs"
class="systemsTable">Key ID</th>
- <th tal:condition="asked_for_certs"
class="systemsTable">Trust</th>
+ <th class="systemsTable">Key ID</th>
</tr>
</thead>
@@ -811,12 +839,6 @@
<tr class="systemsTable"><td colspan="2"
class="systemsTable">
<input type="hidden" name="trust_shown"
value="1" />
<ul class="vanilla">
- <li class="vanilla">
- <input
name="check_certs" type="checkbox"
- id="view_certs"
-
onchange="view_certs_only(this.form, this.checked)" />
- View system
certificates before sending any passwords.
- </li>
<li class="vanilla"
id="allSameDiv">
<li class="vanilla"
tal:condition="not: exists: add_cluster/complete">
<input type="checkbox"
name="allSameCheckBox"
@@ -845,6 +867,7 @@
tal:define="sys python:
add_cluster['nodes'][cur_sys]">
<td class="systemsTable">
<input type="text"
+
onchange="reset_system_info(this)"
tal:attributes="
value sys/host
| nothing;
id python:
'__SYSTEM%d:Addr' % cur_sysnum;
@@ -874,39 +897,12 @@
name
python: '__SYSTEM%d:Passwd' % cur_sysnum" />
</tal:block>
</td>
- <td tal:condition="asked_for_certs"
class="systemsTable">
- <img
- tal:attributes="
- src python:
'trusted' in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or
'lock-open.png');
- title sys/fp |
string:no key fingerprint available" />
- <input type="hidden"
- tal:condition="exists:
sys/fp"
- tal:attributes="
- id python:
'__SYSTEM%dFingerprint' % cur_sysnum;
- name python:
'__SYSTEM%dFingerprint' % cur_sysnum;
- value sys/fp |
nothing" />
- </td>
- <td tal:condition="asked_for_certs"
class="systemsTable">
- <input type="checkbox"
- tal:attributes="
- checked python:
sys.has_key('fp') or sys.has_key('trusted');
- id python:
'__SYSTEM%dTrusted' % cur_sysnum;
- name python:
'__SYSTEM%dTrusted' % cur_sysnum;
- disabled
python: sys.has_key('trusted')" />
+ <td class="systemsTable">
+ <img tal:attributes="
+ id python:
'__SYSTEM%dFingerprint' % cur_sysnum;
+ src python: 'trusted'
in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or
'lock-open.png');
+ title sys/fp |
string:no key fingerprint available" />
</td>
- <tal:block tal:condition="python:not
asked_for_certs">
- <input type="hidden" value="1"
- tal:attributes="
- id python:
'__SYSTEM%dTrusted' % cur_sysnum;
- name python:
'__SYSTEM%dTrusted' % cur_sysnum"
- />
- <input type="hidden"
- tal:condition="exists:
sys/fp"
- tal:attributes="
- id python:
'__SYSTEM%dFingerprint' % cur_sysnum;
- name python:
'__SYSTEM%dFingerprint' % cur_sysnum;
- value sys/fp |
nothing" />
- </tal:block>
</tr>
<tal:block tal:define="global cur_sysnum
python: cur_sysnum + 1" />
</tal:block>
@@ -944,14 +940,17 @@
- At least one node name/password are given and are
valid
</tal:comment>
+ <script type="text/javascript" src="conga_ajax.js"></script>
+ <script type="text/javascript" src="update_hostinfo.js"></script>
<script type="text/javascript"
src="/luci/homebase/validate_cluster_add_initial.js">
</script>
+
<script type="text/javascript">
set_page_title('Luci â homebase â Add a running cluster to
be managed by Luci');
</script>
<form name="adminform" action="" method="post">
- <input name="pagetype" type="hidden"
+ <input name="pagetype" type="hidden" id="pagetype"
tal:attributes="value request/form/pagetype |
request/pagetype | nothing" />
<h2 class="homebase">Add an Existing Cluster</h2>
@@ -962,26 +961,32 @@
tal:define="cur_sys request/SESSION/add_cluster_initial
| nothing">
<thead class="systemsTable">
+ <tr class="systemsTable"><td
class="systemsTable" colspan="2">
+ <div class="systemsTableTop">
+ <strong class="cluster_name
invisible" id="cluname_elem">Cluster Name:
+ </strong>
+ <input type="hidden"
id="clustername" name="clustername" value="" />
+ <input type="hidden"
id="cluster_os" name="cluster_os" value="rhel5" />
+ </div>
+ </td></tr>
+
<tr class="systemsTable">
<th class="systemsTable">System
Hostname</th>
<th class="systemsTable">Root
Password</th>
- <tal:block tal:condition="cur_sys">
- <th>Key Id</th>
- <th>Trust</th>
- </tal:block>
+ <th>Key ID</th>
</tr>
</thead>
<tfoot class="systemsTable">
<tr class="systemsTable"><td colspan="2"
class="systemsTable">
- <input type="hidden" name="trust_shown"
value="1"
- tal:condition="cur_sys" />
-
+ <input type="hidden" name="trust_shown"
value="1" />
+ </td></tr>
+ <tr class="systemsTable"><td colspan="2"
class="systemsTable">
<ul class="vanilla">
- <li class="vanilla">
- <input
name="check_certs" id="view_certs"
-
onchange="view_certs_only(this.form, this.checked)"
-
type="checkbox">View system certificates before sending any passwords.
+ <li class="vanilla"
id="allSameDiv">
+ <input type="checkbox"
name="allSameCheckBox"
+
id="allSameCheckBox" onclick="allPasswdsSame(this.form)" />
+ Check if system
passwords are identical.
</li>
</ul>
</td></tr>
@@ -991,6 +996,7 @@
<tr class="systemsTable">
<td class="systemsTable">
<input class="hbInputSys"
type="text"
+
onchange="reset_system_info(this)"
id="__SYSTEM0:Addr"
name="__SYSTEM0:Addr"
tal:attributes="
value
cur_sys/host | nothing" />
@@ -1003,26 +1009,28 @@
tal:attributes="
value nothing"
/>
</td>
- <tal:block tal:condition="cur_sys">
- <td class="systemsTable">
- <img tal:attributes="
+ <td class="systemsTable">
+ <img id="__SYSTEM0Fingerprint"
+ tal:attributes="
title sys/fp |
string:no key fingerprint available;
- src python:
'trusted' in cur_sys and 'lock-ok.png' or ('fp' in cur_sys and
'lock-closed.png' or 'lock-open.png')"
- />
- </td>
- <td class="systemsTable">
- <input type="checkbox"
name="host_is_trusted" checked="checked" />
- </td>
- </tal:block>
+ src python:
(cur_sys and cur_sys.has_key('trusted')) and 'lock-ok.png' or ((cur_sys and
cur_sys.has_key('fp')) and 'lock-closed.png' or 'lock-open.png')"
+ />
+ </td>
</tr>
</tbody>
+
<tal:block tal:condition="cur_sys">
<tal:block
tal:define="x python:
request.SESSION.delete('add_cluster_initial')" />
</tal:block>
</table>
- <input type="hidden" name="numStorage" value="1" />
+ <input type="hidden" id="numStorage" name="numStorage"
value="1" />
+
+ <div class="hbSubmit">
+ <input type="button" name="View SSL cert fingerprints"
+ value="View SSL cert fingerprints"
onclick="get_system_info('retmsgsdiv', 'errmsgsdiv')" />
+ </div>
<div class="hbSubmit" id="hbSubmit">
<input type="button" name="Submit" value="Submit"
--- conga/luci/homebase/homebase_common.js 2008/01/02 20:52:23 1.23
+++ conga/luci/homebase/homebase_common.js 2008/01/22 15:02:32 1.24
@@ -74,7 +74,7 @@
}
}
-function addSystem(form) {
+function addSystem(form, no_delete) {
var sltab = document.getElementById('sys_tbody');
if (!sltab) {
return;
@@ -87,6 +87,7 @@
newsys.setAttribute('id', '__SYSTEM' + num_systems + ':Addr');
newsys.setAttribute('type', 'text');
newsys.setAttribute('value', '');
+ newsys.onclick = new Function('reset_system_info(this)');
var newsysp = document.createElement('input');
newsysp.className = 'hbInputPass';
@@ -120,20 +121,34 @@
hcol.className = 'systemsTable';
var pcol = document.createElement('td');
pcol.className = 'systemsTable';
- var dcol = document.createElement('td');
- dcol.className = 'systemsTable';
- var del_img = document.createElement('img');
- del_img.src = 'delete-row.png';
- del_img.title = 'delete this row';
- del_img.className = 'deleteRow';
- del_img.onclick = new Function('delete_element_id(\'' + newrow.id +
'\')');
- dcol.appendChild(del_img);
+ var fpcol = document.createElement('td');
+ fpcol.className = 'systemsTable';
+ var fp_img = document.createElement('img');
+ fp_img.src = 'lock-open.png';
+ fp_img.title = 'no key fingerprint available';
+ fp_img.id = '__SYSTEM' + num_systems + 'Fingerprint';
+ fpcol.appendChild(fp_img);
+
+ if (!no_delete) {
+ var dcol = document.createElement('td');
+ dcol.className = 'systemsTable';
+ var del_img = document.createElement('img');
+ del_img.src = 'delete-row.png';
+ del_img.title = 'delete this row';
+ del_img.className = 'deleteRow';
+ del_img.onclick = new Function('delete_element_id(\'' +
newrow.id + '\')');
+ dcol.appendChild(del_img);
+ }
+
hcol.appendChild(newsys);
pcol.appendChild(newsysp);
newrow.appendChild(hcol);
newrow.appendChild(pcol);
- newrow.appendChild(dcol);
+ newrow.appendChild(fpcol);
+ if (!no_delete) {
+ newrow.appendChild(dcol);
+ }
sltab.appendChild(newrow);
form.numStorage.value = ++num_systems;
@@ -142,6 +157,79 @@
temp.style.visibility = 'visible';
temp.style.display = 'block';
}
+ return (num_systems - 1);
+}
+
+function reset_system_info(obj) {
+ var offset = null;
+ if (!obj.id || obj.id.substr(0, 8) !== '__SYSTEM') {
+ return (-1);
+ }
+ offset = obj.id.substr(8, obj.id.indexOf(':') - 8);
+ if (offset === null || offset < 0) {
+ return (-1);
+ }
+ var pwd_elem = document.getElementById('__SYSTEM' + offset + ':Passwd');
+ if (pwd_elem) {
+ clr_form_err(pwd_elem);
+ }
+ var fp_elem = document.getElementById('__SYSTEM' + offset +
'Fingerprint');
+ if (fp_elem) {
+ fp_elem.src = 'lock-open.png';
+ fp_elem.title = 'no key fingerprint available';
+ }
+ clr_form_err(obj);
+
+}
+
+function get_systems_list(errors) {
+ var systems_entered = [];
+ var num_systems = 0;
+
+ try {
+ var num_elem = document.getElementById('numStorage');
+ num_systems = num_elem.value;
+ if (!is_valid_int(num_systems, null, null)) {
+ throw String(num_systems + ' is not a valid number of
systems.');
+ }
+ } catch (e) {
+ errors.push(e);
+ }
+
+ for (var i = 0 ; i < num_systems ; i++) {
+ var element = document.getElementById('__SYSTEM' + i + ':Addr');
+
+ if (!element || str_is_blank(element.value)) {
+ continue;
+ }
+ systems_entered.push(element.value);
+ }
+ return (systems_entered);
+}
+
+function get_systems_list_offsets(errors) {
+ var systems_entered = [];
+ var num_systems = 0;
+
+ try {
+ var num_elem = document.getElementById('numStorage');
+ num_systems = num_elem.value;
+ if (!is_valid_int(num_systems, null, null)) {
+ throw String(num_systems + ' is not a valid number of
systems.');
+ }
+ } catch (e) {
+ errors.append(e);
+ }
+
+ for (var i = 0 ; i < num_systems ; i++) {
+ var element = document.getElementById('__SYSTEM' + i + ':Addr');
+
+ if (!element || str_is_blank(element.value)) {
+ continue;
+ }
+ systems_entered.push([ element.value, i ]);
+ }
+ return (systems_entered);
}
function validate_systems(form, errors) {
--- conga/luci/homebase/index_html 2007/11/27 16:58:18 1.25
+++ conga/luci/homebase/index_html 2008/01/22 15:02:32 1.26
@@ -114,35 +114,38 @@
Homebase
</metal:main_form>
- <tal:block tal:condition="python: request.SESSION.has_key('checkRet')"
- tal:define="ret python: request.SESSION.get('checkRet')">
-
- <div class="retmsgs" id="retmsgsdiv" tal:condition="python:(ret
and 'messages' in ret and len(ret['messages']))">
+ <tal:block tal:define="ret python: request.SESSION.get('checkRet')">
+ <div id="retmsgsdiv"
+ tal:attributes="class python:'retmsgs' + ((ret and
ret.get('messages') and len(ret.get('messages')) > 0) and ' ' or ' invisible')">
<div class="hbclosebox">
- <img onclick="hide_element('retmsgsdiv')"
src="x.png" class="closeBox" title="dismiss" />
+ <img onclick="hide_msgs('retmsgsdiv')"
+ src="x.png" class="closeBox"
title="dismiss" />
</div>
<p class="retmsgs">Status messages:</p>
- <ul class="statusmsg">
- <tal:block tal:repeat="e
python:ret['messages']">
- <li class="statusmsg"
tal:content="python:e" />
+ <ul class="statusmsg" id="statusmsglist">
+ <tal:block tal:condition="exists:ret/messages"
+ tal:repeat="e ret/messages">
+ <li class="statusmsg" tal:content="e" />
</tal:block>
</ul>
</div>
- <div id="errmsgsdiv" class="errmsgs" tal:condition="python:(ret
and 'errors' in ret and len(ret['errors']))">
+ <div id="errmsgsdiv"
+ tal:attributes="class python:'errmsgs' + ((ret and
ret.get('errors') and len(ret.get('errors')) > 0) and ' ' or ' invisible')">
<div class="hbclosebox">
- <img onclick="hide_element('errmsgsdiv')"
src="x.png" class="closeBox" title="dismiss">
+ <img onclick="hide_msgs('errmsgsdiv')"
+ src="x.png" class="closeBox"
title="dismiss" />
</div>
<p class="errmsgs">The following errors occurred:</p>
- <ul class="statusmsg">
- <tal:block tal:repeat="e python:ret['errors']">
- <li class="statusmsg"
tal:content="python:e" />
+ <ul class="statusmsg" id="errmsglist">
+ <tal:block tal:condition="exists:ret/errors"
+ tal:repeat="e ret/errors">
+ <li class="statusmsg" tal:content="e" />
</tal:block>
</ul>
</div>
</tal:block>
-
</div>
</div>
--- conga/luci/homebase/validate_cluster_add_initial.js 2008/01/02 20:52:23
1.4
+++ conga/luci/homebase/validate_cluster_add_initial.js 2008/01/22 15:02:32
1.5
@@ -7,9 +7,11 @@
** Free Software Foundation.
*/
+var form_elem = null;
function validateForm(form) {
var errors = [];
+ form_elem = form;
if (!form) {
return (-1);
}
@@ -28,10 +30,159 @@
return (-1);
}
- if (confirm('Retrieve cluster information from ' + added_storage[0] +
'?'))
- {
- form.submit();
+ if (form.pagetype.value == 7) {
+ if (confirm('Retrieve cluster information from ' +
added_storage[0] + '?')) {
+ get_cluster_members();
+ }
+ } else if (form.pagetype.value == 6) {
+ if (confirm('Add this cluster?')) {
+ form.submit();
+ }
}
return (0);
}
+
+function same_host(left, right) {
+ if (left === right) {
+ return (true);
+ }
+ left = left.toLowerCase();
+ right = right.toLowerCase();
+ if (left === right) {
+ return (true);
+ }
+ left = left.replace(/\.$/, '');
+ right = right.replace(/\.$/, '');
+ if (left.length > right.length) {
+ return (right === left.substr(0, right.length));
+ } else {
+ return (left === right.substr(0, left.length));
+ }
+ return false;
+}
+
+function get_cluster_members() {
+ var url = '/luci/cluster?pagetype=1000';
+ var node_num = 0;
+
+ var hclu_elem = document.getElementById('__SYSTEM0:Addr');
+ if (hclu_elem && hclu_elem.value) {
+ ++node_num;
+ url += '&node' + node_num + '=' + hclu_elem.value;
+ }
+
+ if (!node_num) {
+ alert('No node names were entered');
+ } else {
+ initiate_async_get(url, cluster_member_callback);
+ }
+}
+
+function cluster_member_callback() {
+ return check_ajax_xml(xmlHttp_object, cluster_member_check);
+}
+
+function cluster_member_check(ret_status, obj) {
+ if (ret_status === null) {
+ /* Not ready */
+ return;
+ }
+
+ if (ret_status !== true) {
+ /* A communication error occurred. */
+ alert(obj);
+ form_elem.submit();
+ return;
+ }
+
+ var err = get_ricci_response_status(obj.responseXML);
+ if (err !== null && err.length > 0) {
+ alert(err.join('\n'));
+ form_elem.submit();
+ return;
+ }
+
+ try {
+ obj = obj.responseXML.getElementsByTagName('dict')[0];
+ } catch (e) {
+ alert('Received a malformed response from the luci server.');
+ form_elem.submit();
+ return;
+ }
+
+ var query_host;
+ var query_host_elem = document.getElementById('__SYSTEM0:Addr');
+ if (!query_host_elem || str_is_blank(query_host_elem.value)) {
+ alert('No node was entered.');
+ form_elem.submit();
+ return;
+ }
+ query_host = query_host_elem.value;
+
+ var clusters = [];
+ var dict_tags = obj.getElementsByTagName('dict');
+ var num_errors = 0;
+ for (var i = 0 ; i < dict_tags.length ; i++) {
+ try {
+ var cnode_names = [];
+ var tag_name = dict_tags[i].getAttribute('name');
+ var cnodes =
dict_tags[i].getElementsByTagName('clusternode');
+ var cur_node_name;
+
+ for (var j = 0 ; j < cnodes.length - 1 ; j++) {
+ addSystem(form_elem, 1);
+ }
+
+ var last_num = 0;
+ for (var j = 0 ; j < cnodes.length ; j++) {
+ cur_node_name = cnodes[j].getAttribute('value');
+ cnode_names.push(cur_node_name);
+ if (!same_host(cur_node_name, query_host)) {
+ var addr_elem =
document.getElementById('__SYSTEM' + ++last_num + ':Addr');
+ addr_elem.value = cur_node_name;
+ } else {
+ query_host_elem.value = cur_node_name;
+ }
+ }
+ } catch (e) {
+ num_errors++;
+ alert(e);
+ }
+ }
+ var cluster_name = "[unknown]";
+ var var_tags = obj.getElementsByTagName('var');
+ for (var i = 0 ; i < var_tags.length ; i++) {
+ try {
+ if (var_tags[i].getAttribute('name') == 'cluster') {
+ cluster_name =
var_tags[i].getAttribute('value');
+ break;
+ }
+ } catch (e) {
+ alert(e);
+ }
+ }
+ try {
+ var cn_elem = document.getElementById('cluname_elem');
+ cn_elem.className = cn_elem.className.replace(/invisible/gi,
'');
+ try {
+ var tn = document.createTextNode(cluster_name);
+ cn_elem.appendChild(tn);
+ } catch (e1) {
+ var tn = document.createElement('span');
+ tn.innerHTML = cluster_name;
+ cn_elem.appendChild(tn);
+ }
+ var cn_elem = document.getElementById('clustername');
+ cn_elem.value = cluster_name;
+ } catch (e) {
+ num_errors++;
+ }
+
+ if (num_errors === 0) {
+ var pt_elem = document.getElementById('pagetype');
+ if (pt_elem) {
+ pt_elem.value = 6;
+ }
+ }
+}
--- conga/luci/homebase/validate_sys_remove.js 2008/01/02 20:52:23 1.6
+++ conga/luci/homebase/validate_sys_remove.js 2008/01/22 15:02:32 1.7
@@ -82,6 +82,5 @@
return (-1);
}
- form.submit();
- return (0);
+ validate_auth_form(form, 'auth_retmsgsdiv', 'auth_errmsgsdiv');
}
/cvs/cluster/conga/luci/plone-custom/update_hostinfo.js,v --> standard output
revision 1.1
--- conga/luci/plone-custom/update_hostinfo.js
+++ - 2008-01-22 15:02:34.876851000 +0000
@@ -0,0 +1,144 @@
+/*
+** Copyright (C) 2007-2008 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+*/
+
+var err_div_id = null;
+var msg_div_id = null;
+var err_if_clumember = false;
+
+function get_system_info(msgarea_id, errarea_id, err) {
+ var url = '/luci/cluster?pagetype=1002';
+ var errors = [];
+ var systems_list = get_systems_list(errors);
+
+ if (error_dialog(errors)) {
+ return (null);
+ }
+
+ if (systems_list.length < 1) {
+ alert('No system names were entered');
+ return (null);
+ }
+
+ try {
+ hide_msgs(errarea_id);
+ hide_msgs(msgarea_id);
+ } catch (e) {
+ }
+
+ for (var i = 0 ; i < systems_list.length ; i++) {
+ url += '&node' + i + '=' + systems_list[i];
+ }
+
+ msg_div_id = msgarea_id;
+ err_div_id = errarea_id;
+ err_if_clumember = err;
+ initiate_async_get(url, get_system_info_callback);
+}
+
+function get_system_info_callback() {
+ return check_ajax_xml(xmlHttp_object, system_info_check);
+}
+
+function system_info_check(ret_status, obj) {
+ if (ret_status === null) {
+ return;
+ }
+
+ if (ret_status !== true) {
+ /* A communication error occurred. */
+ alert(obj);
+ return;
+ }
+
+ var err = get_ricci_response_status(obj.responseXML);
+ if (err !== null && err.length > 0) {
+ alert(err.join('\n'));
+ return;
+ }
+
+ try {
+ obj = obj.responseXML.getElementsByTagName('dict')[0];
+ } catch (e) {
+ alert('Received a malformed response from the luci server.');
+ return;
+ }
+
+ var elem = obj.getElementsByTagName('dict');
+ var node_props = [];
+ for (var i = 0 ; i < elem.length ; i++) {
+ var elem_type = elem[i].getAttribute('name');
+ if (elem_type != 'clusternodes') {
+ continue;
+ }
+ var cur_node_props = [];
+ var var_elem = elem[i].getElementsByTagName('var');
+ for (var j = 0 ; j < var_elem.length ; j++) {
+ try {
+ var cur_name = var_elem[j].getAttribute('name');
+ var cur_value =
var_elem[j].getAttribute('value');
+ cur_node_props[cur_name] = cur_value;
+ } catch (e) {
+ continue;
+ }
+ }
+ try {
+ node_props[cur_node_props['hostname']] = cur_node_props;
+ } catch (e) {
+ continue;
+ }
+ }
+
+ var errors = [];
+ var msgs = [];
+ var systems_list = get_systems_list_offsets(errors);
+
+ for (var i = 0 ; i < systems_list.length ; i++) {
+ var cur_node_props = node_props[systems_list[i][0]];
+ var cur_sys_name = systems_list[i][0];
+ var offset = systems_list[i][1];
+ try {
+ var addr_elem = document.getElementById('__SYSTEM' +
offset + ':Addr');
+ var pwd_elem = document.getElementById('__SYSTEM' +
offset + ':Passwd');
+ var fp_elem = document.getElementById('__SYSTEM' +
offset + 'Fingerprint');
+
+ if (cur_node_props['available'] != 'True') {
+ errors.push(cur_node_props['err_msg']);
+ set_form_err(addr_elem);
+ set_form_err(pwd_elem);
+ } else if (cur_node_props['key_fp']) {
+ msgs.push('Host ' + cur_sys_name + ' has SSL
key fingerprint ' + cur_node_props['key_fp']);
+ fp_elem.src = 'lock-closed.png';
+ fp_elem.title = cur_node_props['key_fp'];
+
+ try {
+ if (err_if_clumember &&
cur_node_props['cluname'] && !str_is_blank(cur_node_props['cluname'])) {
+ errors.push('Host ' +
cur_sys_name + ' is already a member of the cluster named "' +
cur_node_props['cluname'] + '"');
+ set_form_err(addr_elem);
+ clr_form_err(pwd_elem);
+ } else {
+ clr_form_err(addr_elem);
+ clr_form_err(pwd_elem);
+ }
+ } catch (e1) {
+ throw e1;
+ }
+ }
+ } catch (e) {
+ alert(e);
+ }
+ }
+
+ if (errors.length > 0) {
+ display_msgs(err_div_id, errors);
+ }
+
+ if (msgs.length > 0) {
+ display_msgs(msg_div_id, msgs);
+ }
+}
/cvs/cluster/conga/luci/plone-custom/validate_auth.js,v --> standard output
revision 1.1
--- conga/luci/plone-custom/validate_auth.js
+++ - 2008-01-22 15:02:34.959260000 +0000
@@ -0,0 +1,143 @@
+/*
+** Copyright (C) 2007-2008 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+*/
+
+var err_div_id = null;
+var msg_div_id = null;
+
+function validate_auth_form(form, msgarea_id, errarea_id) {
+ var url = '/luci/cluster?pagetype=1003';
+ var errors = [];
+ var systems_list = get_systems_list(errors);
+
+ if (error_dialog(errors)) {
+ return (null);
+ }
+
+ if (systems_list.length < 1) {
+ alert('No system names were entered');
+ return (null);
+ }
+
+ try {
+ hide_msgs(errarea_id);
+ hide_msgs(msgarea_id);
+ } catch (e) {
+ }
+
+ msg_div_id = msgarea_id;
+ err_div_id = errarea_id;
+ initiate_async_post(form, url, validate_auth_callback);
+}
+
+function validate_auth_callback() {
+ return check_ajax_xml(xmlHttp_object, validate_auth_check);
+}
+
+function validate_auth_check(ret_status, obj) {
+ if (ret_status === null) {
+ return;
+ }
+
+ if (ret_status !== true) {
+ /* A communication error occurred. */
+ alert(obj);
+ return;
+ }
+
+ var err = get_ricci_response_status(obj.responseXML);
+ if (err !== null && err.length > 0) {
+ alert(err.join('\n'));
+ return;
+ }
+
+ try {
+ obj = obj.responseXML.getElementsByTagName('dict')[0];
+ } catch (e) {
+ alert('Received a malformed response from the luci server.');
+ return;
+ }
+
+ var elem = obj.getElementsByTagName('dict');
+ var node_props = [];
+ for (var i = 0 ; i < elem.length ; i++) {
+ var elem_type = elem[i].getAttribute('name');
+ if (elem_type != 'clusternodes') {
+ continue;
+ }
+ var cur_node_props = [];
+ var var_elem = elem[i].getElementsByTagName('var');
+ for (var j = 0 ; j < var_elem.length ; j++) {
+ try {
+ var cur_name = var_elem[j].getAttribute('name');
+ var cur_value =
var_elem[j].getAttribute('value');
+ cur_node_props[cur_name] = cur_value;
+ } catch (e) {
+ continue;
+ }
+ }
+ try {
+ node_props[cur_node_props['hostname']] = cur_node_props;
+ } catch (e) {
+ continue;
+ }
+ }
+
+ var errors = [];
+ var msgs = [];
+ var systems_list = get_systems_list_offsets(errors);
+
+ for (var i = 0 ; i < systems_list.length ; i++) {
+ var cur_node_props = node_props[systems_list[i][0]];
+ var cur_sys_name = systems_list[i][0];
+ var offset = systems_list[i][1];
+ try {
+ var addr_elem = document.getElementById('__SYSTEM' +
offset + ':Addr');
+ var pwd_elem = document.getElementById('__SYSTEM' +
offset + ':Passwd');
+ var fp_elem = document.getElementById('__SYSTEM' +
offset + 'Fingerprint');
+
+ if (cur_node_props['available'] != 'True') {
+ set_form_err(addr_elem);
+ clr_form_err(pwd_elem);
+ errors.push('Unable to connect to host ' +
cur_sys_name + ' to authenticate: ' + cur_node_props['err_msg']);
+ } else {
+ var has_valid_fp = false;
+
+ if (cur_node_props['key_fp']) {
+ fp_elem.src = 'lock-closed.png';
+ fp_elem.title =
cur_node_props['key_fp'];
+ has_valid_fp = true;
+ }
+
+ if (cur_node_props['authed'] != 'True') {
+ errors.push('Authentication for host '
+ cur_sys_name + ' failed.');
+ clr_form_err(addr_elem);
+ set_form_err(pwd_elem);
+ } else {
+ var success_msg = 'Host ' +
cur_sys_name + ' was authenticated successfully';
+ if (has_valid_fp === true) {
+ success_msg += ' (SSL key
fingerprint ' + cur_node_props['key_fp'] + ')';
+ }
+ msgs.push(success_msg);
+ clr_form_err(addr_elem);
+ clr_form_err(pwd_elem);
+ }
+ }
+ } catch (e) {
+ alert(e);
+ }
+ }
+
+ if (errors.length > 0) {
+ display_msgs(err_div_id, errors);
+ }
+
+ if (msgs.length > 0) {
+ display_msgs(msg_div_id, msgs);
+ }
+}
--- conga/luci/plone-custom/conga.js 2008/01/02 20:52:23 1.11
+++ conga/luci/plone-custom/conga.js 2008/01/22 15:02:33 1.12
@@ -28,6 +28,56 @@
}
}
+function hide_msgs(id) {
+ var elem = document.getElementById(id);
+ if (!elem) {
+ return (-1);
+ }
+ elem.className += ' invisible';
+
+ var ul_elem = elem.getElementsByTagName('ul');
+ if (ul_elem) {
+ var ul_elem = ul_elem[0];
+ while (ul_elem.firstChild) {
+ ul_elem.removeChild(ul_elem.firstChild);
+ }
+ }
+}
+
+function display_msgs(id, msg_list) {
+ if (!msg_list || msg_list.length < 1) {
+ return (-1);
+ }
+
+ var elem = document.getElementById(id);
+ if (!elem) {
+ return (-1);
+ }
+
+ var ul_elem = elem.getElementsByTagName('ul');
+ if (!ul_elem || ul_elem.length < 1) {
+ return (-1);
+ }
+
+ ul_elem = ul_elem[0];
+
+ for (var i = 0 ; i < msg_list.length ; i++) {
+ var li_elem = document.createElement('li');
+ li_elem.className = 'statusmsg';
+ try {
+
li_elem.appendChild(document.createTextElement(msg_list[i]));
+ } catch (e) {
+ li_elem.innerHTML = msg_list[i];
+ }
+ ul_elem.appendChild(li_elem);
+ }
+
+ try {
+ elem.className = elem.className.replace(/invisible/gi,'');
+ } catch (e) {
+ }
+}
+
function popup_window(url, width_percent, height_percent) {
var width = window.innerWidth * (width_percent / 100);
var height = window.innerHeight * (height_percent / 100);
--- conga/luci/plone-custom/conga_ajax.js 2008/01/02 20:52:23 1.7
+++ conga/luci/plone-custom/conga_ajax.js 2008/01/22 15:02:33 1.8
@@ -68,7 +68,7 @@
xmlHttp_object.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
xmlHttp_object.setRequestHeader("Content-length", form_data_str.length);
xmlHttp_object.setRequestHeader("Connection", "close");
- xmlHttp_object.send(form_data_str);
+ xmlHttp_object.send(form_data_str.substr(0, form_data_str.length - 1));
}
function get_ajax_msgs(obj, tag_name) {
--- conga/luci/cluster/form-chooser 2008/01/02 20:52:22 1.23
+++ conga/luci/cluster/form-chooser 2008/01/22 15:02:33 1.24
@@ -225,6 +225,10 @@
<tal:block tal:condition="python: ptype == '1000'">
<div
metal:use-macro="here/form-macros/macros/get-cluster-members-form" />
</tal:block>
+
+ <tal:block tal:condition="python: ptype == '1002'">
+ <div
metal:use-macro="here/form-macros/macros/get-system-info-form" />
+ </tal:block>
</tal:block>
</metal:choose-form>
--- conga/luci/cluster/form-macros 2008/01/02 20:52:22 1.218
+++ conga/luci/cluster/form-macros 2008/01/22 15:02:33 1.219
@@ -153,14 +153,12 @@
</div>
<div metal:define-macro="clusteradd-form">
- <script type="text/javascript"
- src="/luci/homebase/homebase_common.js">
- </script>
- <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"
src="/luci/homebase/homebase_common.js"></script>
+ <script type="text/javascript"
src="/luci/homebase/validate_cluster_add.js"></script>
+ <script type="text/javascript" src="validate_create_gulm.js"></script>
+ <script type="text/javascript" src="conga_ajax.js"></script>
+ <script type="text/javascript" src="update_hostinfo.js"></script>
+
<script type="text/javascript">
set_page_title('Luci â cluster â Deploy a cluster');
</script>
@@ -193,10 +191,7 @@
<tr class="systemsTable">
<th class="systemsTable">Node
Hostname</th>
<th class="systemsTable">Root
Password</th>
- <tal:block tal:condition="add_cluster">
- <th class="systemsTable">Key
ID</th>
- <th
class="systemsTable">Trust</th>
- </tal:block>
+ <th class="systemsTable">Key ID</th>
<th></th>
</tr>
</thead>
@@ -227,18 +222,15 @@
<tr class="systemsTable"><td colspan="2"
class="systemsTable">
<input type="checkbox"
name="enable_storage"
tal:attributes="
- checked
add_cluster/shared_storage |string:checked" />
- Enable Shared Storage Support
+ checked
add_cluster/shared_storage |string:checked" />Enable Shared Storage Support
+ </td></tr>
+ <tr class="systemsTable"><td colspan="2"
class="systemsTable">
+ <input type="checkbox"
name="reboot_nodes"
+ tal:attributes="checked
python:(add_cluster and add_cluster.get('reboot_nodes')) and 'checked' or ''"
/>Reboot nodes before joining cluster
</td></tr>
<tr class="systemsTable"><td colspan="2"
class="systemsTable">
<ul class="vanilla">
<li class="vanilla">
- <input
name="check_certs" type="checkbox"
- id="view_certs"
-
onchange="view_certs_only(this.form, this.checked)" />
- View system
certificates before sending any passwords.
- </li>
- <li class="vanilla">
<input type="checkbox"
name="allSameCheckBox" id="allSameCheckBox"
onClick="allPasswdsSame(this.form)"
@@ -349,7 +341,7 @@
tal:attributes="id python:
'__SYSTEM_ROW_%d' % cur_sysnum"
tal:define="sys python:
add_cluster['nodes'][cur_sys]">
<td class="systemsTable">
- <input type="text"
+ <input type="text"
onchange="reset_system_info(this)"
tal:attributes="
value sys/host
| nothing;
id python:
'__SYSTEM%d:Addr' % cur_sysnum;
@@ -379,25 +371,12 @@
name
python: '__SYSTEM%d:Passwd' % cur_sysnum" />
</tal:block>
</td>
- <td tal:condition="add_cluster"
class="systemsTable">
+ <td class="systemsTable">
<img
tal:attributes="
+ id python:
'__SYSTEM%dFingerprint' % cur_sysnum;
src python:
'trusted' in sys and 'lock-ok.png' or ('fp' in sys and 'lock-closed.png' or
'lock-open.png');
title sys/fp |
string:no key fingerprint available" />
- <input type="hidden"
- tal:condition="exists:
sys/fp"
- tal:attributes="
- id python:
'__SYSTEM%dFingerprint' % cur_sysnum;
- name python:
'__SYSTEM%dFingerprint' % cur_sysnum;
- value sys/fp |
nothing" />
- </td>
- <td tal:condition="add_cluster"
class="systemsTable">
- <input type="checkbox"
tal:attributes="
- checked exists: sys/fp;
- id python:
'__SYSTEM%dTrusted' % cur_sysnum;
- name python:
'__SYSTEM%dTrusted' % cur_sysnum;
- disabled python:
'trusted' in sys"
- />
</td>
<td class="systemsTable">
<img src="delete-row.png"
class="deleteRow"
@@ -408,12 +387,13 @@
</tr>
<tal:block
tal:define="global cur_sysnum python:
cur_sysnum + 1" />
- </tal:block>
+ </tal:block>
<tr class="systemsTable" id="__SYSTEM_ROW_0"
tal:condition="not: add_cluster">
<td class="systemsTable">
<input class="hbInputSys"
type="text"
+
onchange="reset_system_info(this)"
id="__SYSTEM0:Addr"
name="__SYSTEM0:Addr" />
</td>
<td class="systemsTable">
@@ -423,6 +403,10 @@
id="__SYSTEM0:Passwd"
name="__SYSTEM0:Passwd" />
</td>
<td class="systemsTable">
+ <img id="__SYSTEM0Fingerprint"
src="lock-open.png"
+ title="no key
fingerprint available" />
+ </td>
+ <td class="systemsTable">
<img src="delete-row.png"
class="deleteRow"
title="delete this row"
onclick="delete_element_id('__SYSTEM_ROW_0')" />
@@ -432,6 +416,7 @@
tal:condition="not: add_cluster">
<td class="systemsTable">
<input class="hbInputSys"
type="text"
+
onchange="reset_system_info(this)"
id="__SYSTEM1:Addr"
name="__SYSTEM1:Addr" />
</td>
<td class="systemsTable">
@@ -441,6 +426,10 @@
id="__SYSTEM1:Passwd"
name="__SYSTEM1:Passwd" />
</td>
<td class="systemsTable">
+ <img id="__SYSTEM1Fingerprint"
src="lock-open.png"
+ title="no key
fingerprint available" />
+ </td>
+ <td class="systemsTable">
<img src="delete-row.png"
class="deleteRow"
title="delete this row"
onclick="delete_element_id('__SYSTEM_ROW_1')" />
@@ -450,6 +439,7 @@
tal:condition="not: add_cluster">
<td class="systemsTable">
<input class="hbInputSys"
type="text"
+
onchange="reset_system_info(this)"
id="__SYSTEM2:Addr"
name="__SYSTEM2:Addr" />
</td>
<td class="systemsTable">
@@ -459,6 +449,10 @@
id="__SYSTEM2:Passwd"
name="__SYSTEM2:Passwd" />
</td>
<td class="systemsTable">
+ <img id="__SYSTEM2Fingerprint"
src="lock-open.png"
+ title="no key
fingerprint available" />
+ </td>
+ <td class="systemsTable">
<img src="delete-row.png"
class="deleteRow"
title="delete this row"
onclick="delete_element_id('__SYSTEM_ROW_2')" />
@@ -471,6 +465,12 @@
<input name="numStorage" id="numStorage" type="hidden"
tal:attributes="value cur_sysnum" />
+ <div class="hbSubmit">
+ <input type="button" name="View SSL cert fingerprints"
+ value="View SSL cert fingerprints"
+ onclick="get_system_info('retmsgsdiv',
'errmsgsdiv', 1)" />
+ </div>
+
<div class="hbSubmit" id="hbSubmit">
<input type="hidden" name="cluster_create" value="1" />
<input type="button" name="Submit" value="Submit"
@@ -1102,10 +1102,7 @@
<tr class="systemsTable">
<th class="systemsTable">Node
Hostname</th>
<th class="systemsTable">Root
Password</th>
- <tal:block tal:condition="add_cluster">
- <th class="systemsTable">Key
ID</th>
- <th
class="systemsTable">Trust</th>
- </tal:block>
+ <th class="systemsTable">Key ID</th>
<th></th>
</tr>
</thead>
@@ -1136,17 +1133,14 @@
<tr class="systemsTable"><td colspan="2"
class="systemsTable">
<input type="checkbox"
name="enable_storage"
tal:attributes="
- checked
add_cluster/shared_storage | string:checked" />
- Enable Shared Storage Support
+ checked
add_cluster/shared_storage | string:checked" />Enable Shared Storage Support
+ </td></tr>
+ <tr class="systemsTable"><td colspan="2"
class="systemsTable">
+ <input type="checkbox"
name="reboot_nodes"
+ tal:attributes="checked
python:(add_cluster and add_cluster.get('reboot_nodes')) and 'checked' or ''"
/>Reboot nodes before joining cluster
</td></tr>
<tr class="systemsTable"><td colspan="2"
class="systemsTable">
<ul class="vanilla">
- <li class="vanilla">
- <input
name="check_certs" type="checkbox"
- id="view_certs"
-
onchange="view_certs_only(this.form, this.checked)" />
- View system
certificates before sending any passwords.
- </li>
<li class="vanilla"
tal:attributes="id
python: (not add_cluster or ('nodes' in add_cluster and
len(add_cluster['nodes']) < 2)) and 'allSameDiv'">
<input type="checkbox"
@@ -1170,7 +1164,7 @@
tal:attributes="id python:
'__SYSTEM_ROW_%d' % cur_sysnum"
tal:define="sys python:
add_cluster['nodes'][cur_sys]">
<td class="systemsTable">
- <input type="text"
+ <input type="text"
onchange="reset_system_info(this)"
tal:attributes="
value sys/host
| nothing;
id python:
'__SYSTEM%d:Addr' % cur_sysnum;
@@ -1214,10 +1208,10 @@
</td>
<td tal:condition="add_cluster"
class="systemsTable">
<input type="checkbox"
tal:attributes="
- checked exists: sys/fp;
+ checked python:
sys.has_key('fp') or sys.has_key('trusted');
id python:
'__SYSTEM%dTrusted' % cur_sysnum;
name python:
'__SYSTEM%dTrusted' % cur_sysnum;
- disabled python:
'trusted' in sys"
+ disabled python:
sys.has_key('trusted')"
/>
</td>
<td class="systemsTable">
@@ -1235,6 +1229,7 @@
tal:condition="not: add_cluster">
<td class="systemsTable">
<input class="hbInputSys"
type="text"
+
onchange="reset_system_info(this)"
id="__SYSTEM0:Addr"
name="__SYSTEM0:Addr" />
</td>
<td class="systemsTable">
@@ -1323,5 +1318,9 @@
<tal:block tal:define="ret python:
here.get_cluster_nodes_async(request)" />
</div>
+<div metal:define-macro="get-system-info-form">
+ <tal:block tal:define="ret python: here.get_sysinfo_async(request)" />
+</div>
+
</body>
</html>
--- conga/luci/cluster/index_html 2007/11/27 16:58:19 1.40
+++ conga/luci/cluster/index_html 2008/01/22 15:02:33 1.41
@@ -214,35 +214,38 @@
</div>
</div>
- <tal:block tal:condition="python: request.SESSION.has_key('checkRet')">
- <tal:block tal:define="ret python:
request.SESSION.get('checkRet')">
- <div class="retmsgs" id="retmsgsdiv" tal:condition="python:(ret
and 'messages' in ret and len(ret['messages']))">
+ <tal:block tal:define="ret python: request.SESSION.get('checkRet')">
+ <div id="retmsgsdiv"
+ tal:attributes="class python:'retmsgs' + ((ret and
ret.get('messages') and len(ret.get('messages')) > 0) and ' ' or ' invisible')">
<div class="hbclosebox">
- <img onclick="hide_element('retmsgsdiv')"
+ <img onclick="hide_msgs('retmsgsdiv')"
src="x.png" class="closeBox"
title="dismiss" />
</div>
<p class="retmsgs">Status messages:</p>
- <ul class="statusmsg">
- <tal:block tal:repeat="e
python:ret['messages']">
- <li class="statusmsg"
tal:content="python:e" />
+ <ul class="statusmsg" id="statusmsglist">
+ <tal:block tal:condition="exists:ret/messages"
+ tal:repeat="e ret/messages">
+ <li class="statusmsg" tal:content="e" />
</tal:block>
</ul>
</div>
- <div id="errmsgsdiv" class="errmsgs" tal:condition="python:(ret
and 'errors' in ret and len(ret['errors']))">
+ <div id="errmsgsdiv"
+ tal:attributes="class python:'errmsgs' + ((ret and
ret.get('errors') and len(ret.get('errors')) > 0) and ' ' or ' invisible')">
<div class="hbclosebox">
- <img onclick="hide_element('errmsgsdiv')"
+ <img onclick="hide_msgs('errmsgsdiv')"
src="x.png" class="closeBox"
title="dismiss" />
</div>
<p class="errmsgs">The following errors occurred:</p>
- <ul class="statusmsg">
- <tal:block tal:repeat="e python:ret['errors']">
- <li class="statusmsg"
tal:content="python:e" />
+ <ul class="statusmsg" id="errmsglist">
+ <tal:block tal:condition="exists:ret/errors"
+ tal:repeat="e ret/errors">
+ <li class="statusmsg" tal:content="e" />
</tal:block>
</ul>
</div>
- </tal:block>
</tal:block>
+
</div>
</div>