conga/luci cluster/form-macros cluster/resourc ...
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL4
Changes by: rmccabe at sourceware.org 2007-02-08 15:59:20
Modified files:
luci/cluster : form-macros resource-form-macros
resource_form_handlers.js
luci/homebase : luci_homebase.css luci/site/luci/Extensions: cluster_adapters.py
Log message:
Support fdoms, recovery, and running exclusive for services.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.176.2.5&r2=1.176.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.31&r2=1.31.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.29&r2=1.29.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.37.2.1&r2=1.37.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.227.2.4&r2=1.227.2.5
luci/cluster/form-macros +160 -5
@@ -3820,6 +3820,41 @@ <p class="reshdr">Create a Virtual Machine Service</p> </td></tr> <tfoot class="systemsTable"> + <tr class="systemsTable"> + <td>Automatically start this service</td> + <td> + <input type="checkbox" name="autostart" checked="checked"> + </td> + </tr> + <tr class="systemsTable"> + <td>Run exclusive</td> + <td> + <input type="checkbox" name="exclusive"> + </td> + </tr> + <tr class="systemsTable"> + <td>Failover Domain</td> + <td> + <select name="domain"> + <option value="" selected="selected">None</option> + <tal:block tal:repeat="f python:here.get_fdom_names(modelb)"> + <option tal:content="f" + tal:attributes="value f" /> + </tal:block> + </select> + </td> + </tr> + <tr class="systemsTable"> + <td>Recovery policy</td> + <td> + <select name="recovery"> + <option value="">Select a recovery policy</option> + <option name="relocate" value="relocate">Relocate</option> + <option name="restart" value="restart">Restart</option> + <option name="disable" value="disable">Disable</option> + </select> + </td> + </tr> <tr class="systemsTable"><td colspan="2"> <div class="hbSubmit"> <input type="submit" value="Create Virtual Machine Service" />
@@ -3861,6 +3896,52 @@ <p class="reshdr">Properties for <tal:block tal:replace="vminfo/name | string:virtual machine service"/></p> </td></tr> <tfoot class="systemsTable"> + <tr class="systemsTable"> + <td>Automatically start this service</td> + <td> + <input type="checkbox" name="autostart" + tal:attributes="checked python: ('autostart' in vminfo and vminfo['autostart'] != '0') and 'checked' or ''" /> + </td> + </tr> + <tr class="systemsTable"> + <td>Run exclusive</td> + <td> + <input type="checkbox" name="exclusive" + tal:attributes="checked python: ('exclusive' in vminfo and vminfo['exclusive'] != '0') and 'checked' or ''" /> + </td> + </tr> + <tr class="systemsTable"> + <td>Failover Domain</td> + <td> + <select name="domain"> + <option value="" tal:content="string:None" + tal:attributes="selected python: (not 'domain' in vminfo or not vminfo['domain']) and 'selected' or ''" /> + <tal:block tal:repeat="f python:here.get_fdom_names(modelb)"> + <option tal:content="f" + tal:attributes=" + value f; + selected python: ('domain' in vminfo and vminfo['domain'] == f) and 'selected' or ''" /> + </tal:block> + </select> + </td> + </tr> + <tr class="systemsTable"> + <td>Recovery policy</td> + <td> + <select name="recovery"> + <option value="">Select a recovery policy</option> + <option name="relocate" value="relocate" + tal:content="string:Relocate" + tal:attributes="selected python: ('recovery' in vminfo and vminfo['recovery'] == 'relocate') and 'selected' or ''" /> + <option name="restart" value="restart" + tal:content="string:Restart" + tal:attributes="selected python: ('recovery' in vminfo and vminfo['recovery'] == 'restart') and 'selected' or ''" /> + <option name="disable" value="disable" + tal:content="string:Disable" + tal:attributes="selected python: ('recovery' in vminfo and vminfo['recovery'] == 'disable') and 'selected' or ''" /> + </select> + </td> + </tr> <tr class="systemsTable"><td colspan="2"> <div class="hbSubmit"> <input name="submit" type="submit" value="Update Virtual Machine Service" />
@@ -3920,6 +4001,35 @@ <input type="checkbox" name="autostart" checked="checked" /> </td> </tr> + <tr class="systemsTable"> + <td class="systemsTable">Run exclusive</td> + <td class="systemsTable"> + <input type="checkbox" name="exclusive"> + </td> + </tr> + <tr class="systemsTable"> + <td class="systemsTable">Failover Domain</td> + <td class="systemsTable"> + <select name="domain"> + <option value="" selected="selected">None</option> + <tal:block tal:repeat="f sinfo/fdoms"> + <option tal:content="f" + tal:attributes="value f" /> + </tal:block> + </select> + </td> + </tr> + <tr class="systemsTable"> + <td class="systemsTable">Recovery policy</td> + <td class="systemsTable"> + <select name="recovery"> + <option value="">Select a recovery policy</option> + <option name="relocate" value="relocate">Relocate</option> + <option name="restart" value="restart">Restart</option> + <option name="disable" value="disable">Disable</option> + </select> + </td> + </tr> </table> </form> </div>
@@ -3944,6 +4054,9 @@ <input type="hidden" name="tree_level" value="-1" /> <input type="hidden" name="svc_name" value="" /> <input type="hidden" name="autostart" value="-1" /> + <input type="hidden" name="exclusive" value="-1" /> + <input type="hidden" name="recovery" /> + <input type="hidden" name="domain" /> <input type="hidden" name="form_xml" /> <input type="hidden" name="action" value="add" /> </form>
@@ -4167,11 +4280,50 @@ <div class="service_comp_list"> <form name="service_name_form"> <table class="rescfg"> - <tr><td> - Automatically start this service - </td> - <td><input type="checkbox" name="autostart" - tal:attributes="checked python: ('autostart' in sinfo and sinfo['autostart'].lower() != 'false') and 'checked'" /></td></tr> + <tr> + <td>Automatically start this service</td> + <td><input type="checkbox" name="autostart" + tal:attributes="checked python: ('autostart' in sinfo and sinfo['autostart'].lower() != 'false') and 'checked'" /> + </td> + </tr> + <tr> + <td>Run exclusive</td> + <td><input type="checkbox" name="exclusive" + tal:attributes="checked python: ('exclusive' in sinfo and sinfo['exclusive'].lower() != 'false') and 'checked'" /> + </td> + </tr> + <tr> + <td>Failover Domain</td> + <td> + <select name="domain"> + <option value="" + tal:attributes="selected python: (not 'domain' in sinfo or not sinfo['domain']) and 'selected' or ''">None</option> + <tal:block tal:repeat="f sinfo/fdoms"> + <option tal:content="f" + tal:attributes=" + value f; + selected python: ('domain' in sinfo and sinfo['domain'] == f) and 'selected' or ''" /> + </tal:block> + </select> + </td> + </tr> + <tr class="systemsTable"> + <td>Recovery policy</td> + <td> + <select name="recovery"> + <option value="">Select a recovery policy</option> + <option name="relocate" value="relocate" + tal:content="string:Relocate" + tal:attributes="selected python: ('recovery' in sinfo and sinfo['recovery'] == 'relocate') and 'selected' or ''" /> + <option name="restart" value="restart" + tal:content="string:Restart" + tal:attributes="selected python: ('recovery' in sinfo and sinfo['recovery'] == 'restart') and 'selected' or ''" /> + <option name="disable" value="disable" + tal:content="string:Disable" + tal:attributes="selected python: ('recovery' in sinfo and sinfo['recovery'] == 'disable') and 'selected' or ''" /> + </select> + </td> + </tr> </table> <input type="hidden" name="service_name" tal:attributes="value sinfo/name | string:1" />
@@ -4194,6 +4346,9 @@ <input type="hidden" name="tree_level" value="-1" /> <input type="hidden" name="svc_name" value="" /> <input type="hidden" name="autostart" value="-1" /> + <input type="hidden" name="exclusive" value="-1" /> + <input type="hidden" name="recovery" /> + <input type="hidden" name="domain" /> <input type="hidden" name="form_xml" /> <input type="hidden" name="action" value="edit" /> </form>
luci/cluster/resource-form-macros +13 -7
@@ -129,11 +129,6 @@ </option> <option name="TOMCAT-5" value="TOMCAT-5">Tomcat 5</option> </tal:block> - - <tal:block - tal:condition="python: os_version and os_version == 'rhel5'"> - <option name="VM" value="VM">Virtual Machine</option> - </tal:block> </select> </form> </p>
@@ -174,6 +169,17 @@ <option name="NFSX" value="NFSX">NFS export</option> <option name="SCR" value="SCR">Script</option> <option name="SMB" value="SMB">Samba</option> + + <tal:block + tal:condition="python: os_version and os_version == 'rhel4'"> + <option name="APACHE" value="APACHE">Apache</option> + <option name="MYSQL" value="MYSQL">MySQL</option> + <option name="OPENLDAP" value="OPENLDAP">Open LDAP</option> + <option name="POSTGRES-8" value="POSTGRES-8"> + PostgreSQL 8 + </option> + <option name="TOMCAT-5" value="TOMCAT-5">Tomcat 5</option> + </tal:block> </select> </form> </p>
@@ -419,10 +425,10 @@ <option name="ext3" value="ext3" tal:content="string: ext3" - tal:attributes="checked python: fstype == 'ext3' and 'checked'" /> + tal:attributes="selected python: fstype == 'ext3' and 'selected'" /> <option name="ext2" value="ext2" tal:content="string: ext2" - tal:attributes="checked python: fstype == 'ext2' and 'checked'" /> + tal:attributes="selected python: fstype == 'ext2' and 'selected'" /> </select> </td> </tr>
luci/cluster/resource_form_handlers.js +30 -0
@@ -423,6 +423,9 @@ var form_xml = ''; var svc_name = null; var autostart = 1; + var domain = null; + var exclusive = 0; + var recovery = null; var form = document.getElementsByTagName('form'); for (var i = 0 ; i < form.length ; i++) {
@@ -435,8 +438,26 @@ clr_form_err(form[i].service_name); svc_name = form[i].service_name.value; } + if (!form[i].autostart.checked) autostart = 0; + + if (!form[i].exclusive.checked) + exclusive = 0; + else + exclusive = 1; + + if (form[i].recovery) { + recovery = form[i].recovery.options[form[i].recovery.options.selectedIndex].value; + if (str_is_blank(recovery)) + recovery = null; + } + + if (form[i].domain) { + domain = form[i].domain.options[form[i].domain.options.selectedIndex].value; + if (str_is_blank(domain)) + domain = null; + } continue; }
@@ -480,13 +501,22 @@ if (!form_xml) errors.push('No resource information was submitted.'); + if (recovery && recovery != 'relocate' && recovery != 'restart' && recovery != 'disable') { + errors.push('You entered an invalid recovery option. Valid options are "relocate" "restart" and "disable"'); + } + if (error_dialog(errors)) return (-1); /* sort this out in the backend */ master_form.form_xml.value = '<formlist>' + form_xml + '</formlist>'; master_form.svc_name.value = svc_name; + if (domain) + master_form.domain.value = domain; + if (recovery) + master_form.recovery.value = recovery; master_form.autostart.value = autostart; + master_form.exclusive.value = exclusive; var confirm_msg = null; if (master_form.action.value == 'add')
luci/homebase/luci_homebase.css +0 -2
@@ -336,7 +336,6 @@ strong.cluster { text-align: top; font-size: 9pt; - letter-spacing: +.5px; } *.reshdr {
@@ -350,7 +349,6 @@ strong.node_name, strong.cluster_name { font-size: 10pt; - letter-spacing: +.5px; } td.service_name,
luci/site/luci/Extensions/cluster_adapters.py +123 -1
196 lines not on this page · raw message