conga/luci cluster/fence_device.js cluster/for ...
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-01-10 23:47:11
Modified files:
luci/cluster : fence_device.js form-macros
luci/site/luci/Extensions: cluster_adapters.py
Log message:
small node fence cleanups
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence_device.js.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.150&r2=1.151
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.200&r2=1.201
luci/cluster/fence_device.js +11 -5
@@ -208,13 +208,19 @@ { temp += '<input type="' + res_type + '" name="' + input_elem[j].name + '" value="' + input_elem[j].value + '" />'; } else if (res_type == 'checkbox' || res_type == 'radio') { - if (input_elem[j].checked) - temp += '<input type="' + res_type + '" name="' + input_elem[j].name + '" checked="checked"'; - if (res_type == 'radio') - temp += ' value="' + input_elem[j].value + '"'; - temp += ' />'; + if (input_elem[j].checked) { + temp += '<input type="' + res_type + '" name="' + input_elem[j].name + '"'; + if (res_type == 'checkbox') + temp += ' value="1"'; + else if (res_type == 'radio') + temp += ' value="' + input_elem[j].value + '"'; + temp += ' />'; + } else if (res_type == 'checkbox') { + temp += '<input type="' + res_type + '" name="' + input_elem[j].name + '" value="0" />'; + } } } + var select_elem = form[i].getElementsByTagName('select'); for (var j = 0 ; j < select_elem.length ; j++) { temp += '<input type="text" name="' + select_elem[j].name + '" value="' + select_elem[j].options[select_elem[j].options.selectedIndex].value + '" />';
luci/cluster/form-macros +13 -5
@@ -2039,20 +2039,28 @@ <tr> <td>Password</td> <td> - <input name="password" type="password" autocomplete="off" + <input name="passwd" type="password" autocomplete="off" tal:attributes="value cur_fencedev/passwd | nothing" /> </td> </tr> <tr> <td>Authentication Type</td> - <td><input name="auth_type" type="text" Title="Options are to leave blank for none, password, md2, or md5"/></td> + <td> + <input name="auth_type" type="text" title="Options are to leave blank for none, password, md2, or md5" + tal:attributes="value cur_fencedev/auth_type | nothing" /> + </td> </tr> <tr> <td>Use Lanplus</td> <td> - <input name="lanplus" type="checkbox" - tal:attributes="checked cur_fencedev/lanplus | nothing" - /> + <tal:block tal:condition="exists: cur_fencedev"> + <input name="lanplus" type="checkbox" + tal:attributes="checked python: ('lanplus' in cur_fencedev and cur_fencedev['lanplus'] == '1') and 'checked' or ''" + /> + </tal:block> + <tal:block tal:condition="not:exists:cur_fencedev"> + <input name="lanplus" type="checkbox" /> + </tal:block> </td> </tr> </table>
luci/site/luci/Extensions/cluster_adapters.py +3 -1
@@ -1613,7 +1613,7 @@ # user could not have edited it (without playing dirty # games), so it's safe to pull the existing entry from # the model. All we need is the device name. - pass + del fence_form['sharable'] else: # An existing non-shared device; build up the device # from scratch since the user could have edited it.
@@ -1665,6 +1665,8 @@ # <node><fence>. All we need for that is the device name. if not 'sharable' in fence_form: instance_list.append({'name': fencedev_name }) + else: + del fence_form['sharable'] if fencedev_obj is not None: # If a device with this name exists in the model