From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci/cluster fence_device.js form-macros
Date: 9 Jan 2007 23:28:03 -0000 [thread overview]
Message-ID: <20070109232803.22101.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-01-09 23:28:02
Modified files:
luci/cluster : fence_device.js form-macros
Log message:
only show the "Add an instance" button for sharable fence devices
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence_device.js.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.147&r2=1.148
--- conga/luci/cluster/fence_device.js 2007/01/09 18:27:04 1.6
+++ conga/luci/cluster/fence_device.js 2007/01/09 23:28:02 1.7
@@ -71,6 +71,7 @@
container_element.removeChild(container_element.firstChild);
var target = child_element.cloneNode(1);
+ target.id = '';
var fence_type = fence_id;
if (fence_opt.className.match(/shared_fencedev/)) {
@@ -90,6 +91,7 @@
container_element.appendChild(target_form);
var fi_form = document.getElementById(fence_type + '_instance');
+ var sharable = 0;
if (fi_form) {
var idiv = document.createElement('div');
idiv.id = container_id + '_instances';
@@ -114,6 +116,7 @@
idiv.appendChild(form_elem);
container_element.appendChild(idiv);
num_fence_instances[container_id] = 1;
+ sharable++;
}
var remove_div = document.createElement('div');
@@ -124,12 +127,14 @@
remove_button.setAttribute('value', 'Remove this device');
remove_button.setAttribute('onclick', "del_fence('" + container_element.id + "');");
- var add_instance_button = document.createElement('input');
- add_instance_button.setAttribute('type', 'button');
- add_instance_button.setAttribute('name', 'add_fence_inst');
- add_instance_button.setAttribute('value', 'Add an instance');
- add_instance_button.setAttribute('onclick', "add_fence_instance('" + container_element.id + "','" + fence_type + "');");
- add_instance_button.className = 'pad_left';
+ if (sharable) {
+ var add_instance_button = document.createElement('input');
+ add_instance_button.setAttribute('type', 'button');
+ add_instance_button.setAttribute('name', 'add_fence_inst');
+ add_instance_button.setAttribute('value', 'Add an instance');
+ add_instance_button.setAttribute('onclick', "add_fence_instance('" + container_element.id + "','" + fence_type + "');");
+ add_instance_button.className = 'pad_left';
+ }
var remove_form = document.createElement('form');
remove_form.appendChild(remove_button);
--- conga/luci/cluster/form-macros 2007/01/09 22:20:34 1.147
+++ conga/luci/cluster/form-macros 2007/01/09 23:28:02 1.148
@@ -2200,7 +2200,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2242,7 +2242,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2277,7 +2277,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2312,7 +2312,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2347,7 +2347,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2382,7 +2382,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2417,7 +2417,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2452,7 +2452,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2487,7 +2487,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2522,7 +2522,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2544,7 +2544,7 @@
</tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
@@ -2579,7 +2579,7 @@
</td></tr>
</table>
- <input name="fence_instance" value="1" />
+ <input type="hidden" name="fence_instance" value="1" />
<input tal:condition="exists: cur_instance"
type="hidden" name="existing_instance" value="1" />
<input type="hidden" name="parent_fencedev"
next reply other threads:[~2007-01-09 23:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-09 23:28 rmccabe [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-01-10 20:02 [Cluster-devel] conga/luci/cluster fence_device.js form-macros rmccabe
2007-01-09 18:27 rmccabe
2007-01-05 23:26 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=20070109232803.22101.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.