From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci cluster/form-macros cluster/resourc ...
Date: 8 Feb 2007 05:05:23 -0000 [thread overview]
Message-ID: <20070208050523.29438.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-02-08 05:05:22
Modified files:
luci/cluster : form-macros resource_form_handlers.js
luci/homebase : luci_homebase.css
luci/site/luci/Extensions: cluster_adapters.py
Log message:
Allow a failover domain to be selected for services
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.182&r2=1.183
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.234&r2=1.235
--- conga/luci/cluster/form-macros 2007/02/08 03:42:58 1.182
+++ conga/luci/cluster/form-macros 2007/02/08 05:05:21 1.183
@@ -3920,6 +3920,18 @@
<input type="checkbox" name="autostart" checked="checked" />
</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>
</table>
</form>
</div>
@@ -3945,6 +3957,7 @@
<input type="hidden" name="svc_name" value="" />
<input type="hidden" name="autostart" value="-1" />
<input type="hidden" name="form_xml" />
+ <input type="hidden" name="domain" />
<input type="hidden" name="action" value="add" />
</form>
</div>
@@ -4167,11 +4180,27 @@
<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>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>
</table>
<input type="hidden" name="service_name"
tal:attributes="value sinfo/name | string:1" />
@@ -4195,6 +4224,7 @@
<input type="hidden" name="svc_name" value="" />
<input type="hidden" name="autostart" value="-1" />
<input type="hidden" name="form_xml" />
+ <input type="hidden" name="domain" />
<input type="hidden" name="action" value="edit" />
</form>
</div>
--- conga/luci/cluster/resource_form_handlers.js 2007/01/26 17:56:14 1.29
+++ conga/luci/cluster/resource_form_handlers.js 2007/02/08 05:05:21 1.30
@@ -423,6 +423,7 @@
var form_xml = '';
var svc_name = null;
var autostart = 1;
+ var domain = null;
var form = document.getElementsByTagName('form');
for (var i = 0 ; i < form.length ; i++) {
@@ -437,6 +438,12 @@
}
if (!form[i].autostart.checked)
autostart = 0;
+
+ if (form[i].domain) {
+ domain = form[i].domain.options[form[i].domain.options.selectedIndex].value;
+ if (str_is_blank(domain))
+ domain = null;
+ }
continue;
}
@@ -486,6 +493,8 @@
/* 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;
master_form.autostart.value = autostart;
var confirm_msg = null;
--- conga/luci/homebase/luci_homebase.css 2007/02/07 17:18:43 1.38
+++ conga/luci/homebase/luci_homebase.css 2007/02/08 05:05:22 1.39
@@ -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,
--- conga/luci/site/luci/Extensions/cluster_adapters.py 2007/02/08 03:42:58 1.234
+++ conga/luci/site/luci/Extensions/cluster_adapters.py 2007/02/08 05:05:22 1.235
@@ -775,6 +775,14 @@
if len(errors) > 0:
return (False, {'errors': errors})
+ fdom = None
+ try:
+ fdom = request.form['domain'].strip()
+ if not fdom:
+ raise Exception, 'blank'
+ except:
+ fdom = None
+
try:
service_name = request.form['svc_name'].strip()
except Exception, e:
@@ -827,6 +835,8 @@
new_service = Service()
new_service.addAttribute('name', service_name)
+ if fdom:
+ new_service.addAttribute('domain', fdom)
if autostart is not None:
new_service.attr_hash['autostart'] = autostart
@@ -3270,6 +3280,11 @@
baseurl = '/luci/cluster/index_html'
try:
+ hmap['fdoms'] = map(lambda x: x.getName(), model.getFailoverDomains())
+ except:
+ hmap['fdoms'] = list()
+
+ try:
cluname = req['clustername']
if not cluname:
raise KeyError, 'is blank'
@@ -3334,6 +3349,11 @@
#Now build hashes for resources under service.
#first get service by name from model
svc = model.getService(servicename)
+ try:
+ hmap['domain'] = svc.getAttribute('domain')
+ except:
+ hmap['domain'] = None
+
resource_list = list()
if svc is not None:
indent_ctr = 0
@@ -3357,9 +3377,11 @@
#Note: Final version needs all resource attrs
if child.isRefObject() == True:
rc_map['ref_object'] = True
+ rc_map['tag_name'] = child.getObj().TAG_NAME
rc_map['type'] = child.getObj().getResourceType()
rc_map['attrs'] = child.getObj().getAttributes()
else:
+ rc_map['tag_name'] = child.TAG_NAME
rc_map['type'] = child.getResourceType()
rc_map['attrs'] = child.getAttributes()
next reply other threads:[~2007-02-08 5:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-08 5:05 rmccabe [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-05-30 5:54 [Cluster-devel] conga/luci cluster/form-macros cluster/resourc rmccabe
2007-02-16 2:12 rmccabe
2007-02-16 2:06 rmccabe
2007-02-08 16:00 rmccabe
2007-02-08 15:59 rmccabe
2007-01-26 17:56 rmccabe
2007-01-20 4:50 rmccabe
2006-12-06 22:44 rmccabe
2006-12-05 23:32 rmccabe
2006-12-05 6:44 rmccabe
2006-09-23 4:04 rmccabe
2006-09-14 21:24 rmccabe
2006-09-13 17:50 rmccabe
2006-09-11 22:22 rmccabe
2006-09-05 21:25 rmccabe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070208050523.29438.qmail@sourceware.org \
--to=rmccabe@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.