conga/luci/cluster resource-form-macros resour ...
CVSROOT: /cvs/cluster
Module name: conga
Changes by: shuennek at sourceware.org 2006-08-10 19:46:09
Modified files:
luci/cluster : resource-form-macros resource_form_handlers.js
Log message:
Finally got committs working, two updates weren't there in resource form stuff.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.1&r2=1.2
luci/cluster/resource-form-macros +33 -32
@@ -145,7 +145,7 @@ <span tal:omit-tag="" tal:condition="python:type == 'smb'"> <div metal:use-macro="here/resource-form-macros/macros/smb_macro" /> </span> - <span tal:omit-tag="" tal:condition="python:type == 'src'"> + <span tal:omit-tag="" tal:condition="python:type == 'script'"> <div metal:use-macro="here/resource-form-macros/macros/scr_macro" /> </span> </span>
@@ -160,7 +160,7 @@ global ip2 python:address[1]; global ip3 python:address[2]; global ip4 python:address[3]; - global monitor_link res/monitor_link; + global monitor_link res/attrs/monitor_link; global cluname request/clustername; tmp_URL context/cluster/index_html/absolute_url; global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
@@ -204,20 +204,20 @@ </tr> </table> </form> - <input type="button" value="Submit" onClick="validate(ip_form);" /> + <input name="submitButton" type="button" value="Submit" onClick="validate(ip_form);" /> </div> <div id="FS" metal:define-macro="fs_macro"> <span tal:condition="python:ptype == '33'"> <span tal:define=" global resName res/name; - global mountPoint res/mountpoint; - global device res/device; - global fstype res/fstype; - global opt res/options; - global fsid res/fsid; - global force_unmount res/force_unmount; - global reboot_fail res/self_fence; - global fscheck res/force_fsck; + global mountPoint res/attrs/mountpoint; + global device res/attrs/device; + global fstype res/attrs/fstype; + global opt res/attrs/options; + global fsid res/attrs/fsid; + global force_unmount res/attrs/force_unmount; + global reboot_fail res/attrs/self_fence; + global fscheck res/attrs/force_fsck; global cluname request/clustername; tmp_URL context/cluster/index_html/absolute_url; global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
@@ -226,6 +226,7 @@ <span tal:define=" global force_unmount string:0; global reboot_fail string:0; + global fstype string:0; global fscheck string:0; global cluname request/clustername; tmp_URL context/cluster/index_html/absolute_url;
@@ -252,11 +253,11 @@ <div> <strong>File System Type:</strong> <select id="fstype" name="fstype"> - <span tal:condition="python: fstype == 'ext2'"> + <span tal:condition="python: ptype != '33' or fstype == 'ext2'"> <option name="ext2" value="ext2">ext2</option> <option name="ext3" value="ext3" selected>ext3</option> </span> - <span tal:condition="python: fstype != 'ext3'"> + <span tal:condition="python: ptype == '33' and fstype != 'ext3'"> <option name="ext2" value="ext2" selected>ext2</option> <option name="ext3" value="ext3">ext3</option> </span>
@@ -322,12 +323,12 @@ <span tal:condition="python:ptype == '33'"> <span tal:define=" global resName res/name; - global mountPoint res/mountpoint; - global device res/device; - global fstype res/fstype; - global opt res/options; - global fsid res/fsid; - global force_unmount res/force_unmount; + global mountPoint res/attrs/mountpoint; + global device res/attrs/device; + global fstype res/attrs/fstype; + global opt res/attrs/options; + global fsid res/attrs/fsid; + global force_unmount res/attrs/force_unmount; global cluname request/clustername; tmp_URL context/cluster/index_html/absolute_url; global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
@@ -403,12 +404,12 @@ <span tal:condition="python:ptype == '33'"> <span tal:define=" global resName res/name; - global mountpoint res/mountpoint; - global opt res/options; - global expath res/export; - global nfstype res/fstype; - global hostname res/host; - global force_unmount res/force_unmount; + global mountpoint res/attrs/mountpoint; + global opt res/attrs/options; + global expath res/attrs/export; + global nfstype res/attrs/fstype; + global hostname res/attrs/host; + global force_unmount res/attrs/force_unmount; global cluname request/clustername; tmp_URL context/cluster/index_html/absolute_url; global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
@@ -462,11 +463,11 @@ </tr> <tr> <div> - <span tal:condition="python: nfstype == 'nfs'"> + <span tal:condition="python: ptype != '33' or nfstype == 'nfs'"> <input type="radio" name="nfstype" value="nfs" checked>NFS <input type="radio" name="nfstype" value="nfs4">NFS4 </span> - <span tal:condition="python: nfstype != 'nfs4'"> + <span tal:condition="python: ptype == '33' and nfstype != 'nfs4'"> <input type="radio" name="nfstype" value="nfs">NFS <input type="radio" name="nfstype" value="nfs4" checked>NFS4 </span>
@@ -497,9 +498,9 @@ <span tal:condition="python:ptype == '33'"> <span tal:define=" global resName res/name; - global target res/target; - global opt res/options; - global expath res/readOnly|nothing; + global target res/attrs/target; + global opt res/attrs/options; + global expath res/attrs/readOnly|nothing; global cluname request/clustername; tmp_URL context/cluster/index_html/absolute_url; global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
@@ -588,7 +589,7 @@ <span tal:condition="python:ptype == '33'"> <span tal:define=" global resName res/name; - global filename res/file; + global filename res/attrs/file; global cluname request/clustername; tmp_URL context/cluster/index_html/absolute_url; global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
@@ -633,7 +634,7 @@ <span tal:condition="python:ptype == '33'"> <span tal:define=" global resName res/name; - global workgroup res/workgroup; + global workgroup res/attrs/workgroup; global cluname request/clustername; tmp_URL context/cluster/index_html/absolute_url; global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
luci/cluster/resource_form_handlers.js +6 -5
@@ -35,14 +35,15 @@ *down within actual cluster code.*/ function validate(form){ - if(form.resourceName.value.length == 0){ - alert("Please enter a name for this resource. \n"); - return; + if(form.type.value != 'ip'){ + if(form.resourceName.value.length == 0){ + alert("Please enter a name for this resource. \n"); + return; + } } - name = form.getAttribute("name"); /*Get the type of form from the first *part of the name string*/ - type = name.split("_")[0]; + type = form.type.value; /*use eval to access proper resource *valer function as defined below*/ eval("val"+(type.toUpperCase())+"(form);");