[Cluster-devel] conga/luci/cluster form-chooser resource_form_ ...

jparsons at sourceware.org jparsons at sourceware.org
Thu Jul 27 16:32:47 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons at sourceware.org	2006-07-27 16:32:46

Modified files:
	luci/cluster   : form-chooser 
Added files:
	luci/cluster   : resource_form_handlers.js resource-form-macros 

Log message:
	Support for cluster resources

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-chooser.diff?cvsroot=cluster&r1=1.3&r2=1.4

/cvs/cluster/conga/luci/cluster/resource_form_handlers.js,v  -->  standard output
revision 1.1
--- conga/luci/cluster/resource_form_handlers.js
+++ -	2006-07-27 16:32:47.350404000 +0000
@@ -0,0 +1,163 @@
+/*swap_div switches between types of forms
+ * based on a chooser within the document */
+function swap_div(container_id, element_id){
+  container_element = document.getElementById(container_id);
+  if (!container_element) {
+    alert('Can\'t find element with id = ' + container_id);
+    return (-1)
+      }
+  child_element = document.getElementById(element_id);
+  if (!child_element) {
+    alert('Can\'t find element with id = ' + element_id);
+    return (-1)
+      }
+  for(child in child_element.children){
+    alert(child);
+  }
+  temp = container_element.firstChild;
+  container_element.replaceChild(child_element, container_element.firstChild);
+  
+  invisible_div = document.getElementById('invisible');
+  if (!invisible_div) {
+    alert('No invisible div');
+    return (-1)
+      } 
+  
+  invisible_div.appendChild(temp);
+}
+
+/*In order to val a new resource type, 
+ *create a form within the resource-form-macros 
+ *with 'resource-name'_form as the 'name' 
+ *attribute, and use:
+ * onSubmit="valResource('resource-name'_form)"
+ *val handler functions here and further
+ *down within actual cluster code.*/
+
+function validate(form){
+  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];
+  /*use eval to access proper resource
+   *valer function as defined below*/
+  eval("val"+(type.toUpperCase())+"(form);");
+  /*TODO: val error checking!!!*/
+}
+
+/*Val an IP Resource*/
+function valIP(form){
+  /*first, check to make sure all input 
+   *fields have values*/
+  if (isNaN(parseInt(form.ip1.value)) ||
+     isNaN(parseInt(form.ip2.value)) ||
+     isNaN(parseInt(form.ip3.value)) ||
+     isNaN(parseInt(form.ip4.value)) ) {
+    error = "The IP Address contains illegal characters. \n";
+    alert(error);
+  }
+  else{
+    form.submit();
+  }
+}
+
+/*Val an NFS Mount Resource*/
+function valNFSM(form){
+  error = ""
+  /*check to make sure all input
+   *fields have values*/
+  if(form.mountpoint.value == "")
+    error += "Please enter a mount point.\n";
+  if(form.host.value == "")
+    error += "Please enter a host.\n";
+  if(form.exportpath.value == "")
+    error += "Please enter an export path.\n";
+  if(error != "")
+    alert(error);
+  else
+    form.submit();
+}
+
+/*Validate an NFS Export Resource*/
+function valNFSX(form){
+  form.submit();
+}
+
+/*Validate an NFS Client Resource*/
+function valNFSC(form){
+  error = ""
+  /*check to make sure all input
+   *fields have values*/
+  if(form.target.value == "")
+    error += "Please enter a target.\n";
+  if(error != "")
+    alert(error);
+  else
+    form.submit();
+}
+
+/*Validate an FS Resource*/
+function valFS(form){
+  error = ""
+  /*check to make sure all input
+   *fields have values*/
+  if(form.fsTypeSelect.value == "")
+    error += "Please Select a file system type.\n";
+  if(form.mountpoint.value == "")
+    error += "Please enter a mount point.\n";
+  if(form.device.value == "")
+    error += "Please enter a device.\n";
+  if(form.fsid.value == "")
+    error += "Please enter a file system id.\n";
+  if(error != "")
+    alert(error);
+  else
+    form.submit(); 
+}
+
+/*Validate a GFS Resource*/
+function valGFS(form){
+  error = ""
+  /*check to make sure all input
+   *fields have values*/
+  if(form.mountpoint.value == "")
+    error += "Please enter a mount point.\n";
+  if(form.device.value == "")
+    error += "Please enter a device.\n";
+  if(form.fsid.value == "")
+    error += "Please enter a file system id.\n";
+  if(error != "")
+    alert(error);
+  else
+    form.submit(); 
+}
+
+/*Validate a Script Resource*/
+function valSCR(form){
+  error = ""
+  /*check to make sure all input
+   *fields have values*/
+  if(form.file.value == "")
+    error += "Please enter a filename.\n";
+  if(error != "")
+    alert(error);
+  else
+    form.submit(); 
+}
+
+/*Validate a Samba Resource*/
+function valSMB(form){
+  error = ""
+  /*check to make sure all input
+   *fields have values*/
+  if(form.workgroup.value == "")
+    error += "Please enter a workgroup.\n";
+  if(error != "")
+    alert(error);
+  else
+    form.submit();   
+}
/cvs/cluster/conga/luci/cluster/resource-form-macros,v  -->  standard output
revision 1.1
--- conga/luci/cluster/resource-form-macros
+++ -	2006-07-27 16:32:47.448257000 +0000
@@ -0,0 +1,647 @@
+<html>
+  <head>
+    <title tal:content="template/title">The title</title>
+  </head>
+  <body>
+  <div metal:define-macro="resources-form">
+    <h2>
+    Resources for <span tal:content="request/clustername" />
+    </h2>
+    <span tal:define="global rescInf python:here.getResourcesInfo(modelb, request)"/>
+    <table id="systemsTable" class="systemsTable" border="0" cellspacing="0">
+      <thead>
+        <tr border="0" cellspacing="5" align="left">
+          <th width="100">Resource Name</th>
+          <th width="100">Type</th>
+          <th width="75">Link</th>
+          <th width="75">Configure</th>
+        </tr>
+      </thead>
+      <span tal:repeat="rs rescInf">
+        <tr border="0" cellspacing="5">
+          <td tal:content="rs/name" />
+          <td tal:content="rs/type" />
+          <td>
+            <a href="" tal:attributes="HREF rs/url" />
+            details
+          </td>
+          <td>
+            <a href="" tal:attributes="HREF rs/cfgurl" />
+            configure
+          </td>
+        </tr>
+      </span>
+    </table>
+  </div>
+  <div metal:define-macro="resourceslist-form">
+   <h2>Resources List Form</h2>
+  </div>
+  <div metal:define-macro="resourceadd-form">
+      <script type="text/javascript" src="luci/cluster/resource_form_handlers.js" />  
+      <span tal:define="msg python:here.appendModel(request, modelb)"/>
+      <h2>Add a Resource</h2>
+      <strong>Select Resource Type:</strong><br/>
+      <form name="filler">
+	<select name="select_div" onChange="swap_div('container', filler.select_div.options[filler.select_div.selectedIndex].value);">
+	  <option name="blank" value="blank">Select a resource type</option>
+	  <option name="IP" value="IP">IP Resource</option>
+	  <option name="FS" value="FS">FS Resource</option>
+	  <option name="GFS" value="GFS">GFS Resource</option>
+	  <option name="NFSM" value="NFSM">NFS Mount Resource</option>
+	  <option name="NFSC" value="NFSC">NFS Client Resource</option>
+	  <option name="NFSX" value="NFSX">NFS Export Resource</option>
+	  <option name="SCR" value="SCR">Script Resource</option>
+	  <option name="SMB" value="SMB">Samba Resource</option>
+	</select>
+      </form>
+      <table class="systemsTable" border="0" cellspacing="1">
+      <tr><td id="container" width="400">	  
+	&nbsp
+      </td></tr>
+      </table>
+      <div id="invisible" style="display: none">
+        <div id="blank">&nbsp</div>
+  	<div metal:use-macro="here/resource-form-macros/macros/ip_macro"/>
+	<div metal:use-macro="here/resource-form-macros/macros/fs_macro"/>
+	<div metal:use-macro="here/resource-form-macros/macros/gfs_macro"/>
+	<div metal:use-macro="here/resource-form-macros/macros/nfsm_macro"/>
+        <div metal:use-macro="here/resource-form-macros/macros/nfsx_macro"/>
+        <div metal:use-macro="here/resource-form-macros/macros/nfsc_macro"/>
+        <div metal:use-macro="here/resource-form-macros/macros/smb_macro"/>
+        <div metal:use-macro="here/resource-form-macros/macros/scr_macro"/>
+      </div>
+    </div>
+
+  <div metal:define-macro="resource-form">
+    <span tal:define="global res python:here.getResourceInfo(modelb, request)"/>
+    <h2>Resource details for <span tal:content="res/name" /></h2>
+    <table class="systemsTable" border="0" cellspacing="5">
+      <thead  align="left">
+        <th width="100">Name</th>
+        <th width="100">Type</th>
+        <th width="75">Configure</th>
+      </thead>
+      <tr align="left">
+        <td tal:content="res/name" />
+        <td tal:content="res/tag_name" />
+        <td>
+        <a href="" tal:attributes="HREF res/cfgurl" />
+        configure
+        </td>
+      </tr>
+    </table>
+  </div>
+
+  <div metal:define-macro="resourceprocess-form">
+   <span tal:define="global edited request/edit|nothing" />
+   <h2 tal:condition="not: edited">Resource Added Form</h2>
+   <h2 tal:condition="edited">Resource Edited Form</h2>
+   <span tal:define="global msg python:here.addResource(request)" />
+   <strong>Errors:</strong>
+   <div tal:condition="msg" tal:content="msg">Something returned from addResource.</div>
+   <hr/>
+    These are the request vars <em tal:replace="structure request">template id</em>.
+  </div>
+
+  <div metal:define-macro="resourceconfig-form">
+    <script type="text/javascript" src="luci/cluster/resource_form_handlers.js" />
+    <span tal:define="global res python:here.getResourceInfo(modelb, request)" />
+    <span tal:define="global type res/tag_name" />
+    <h2>Configure <span tal:content="res/name" /></h2>
+    <span tal:omit-tag="" tal:condition="python:type == 'ip'">
+     <div metal:use-macro="here/resource-form-macros/macros/ip_macro"/>
+    </span>
+    <span tal:omit-tag="" tal:condition="python:type == 'fs'">
+      <div metal:use-macro="here/resource-form-macros/macros/fs_macro"/>
+    </span>
+    <span tal:omit-tag="" tal:condition="python:type == 'gfs'">
+      <div metal:use-macro="here/resource-form-macros/macros/gfs_macro"/>
+    </span>
+    <span tal:omit-tag="" tal:condition="python:type == 'nfsm'">
+      <div metal:use-macro="here/resource-form-macros/macros/nfsm_macro"/>
+    </span>
+    <span tal:omit-tag="" tal:condition="python:type == 'nfsx'">
+      <div metal:use-macro="here/resource-form-macros/macros/nfsx_macro"/>
+    </span>
+    <span tal:omit-tag="" tal:condition="python:type == 'nfsc'">
+      <div metal:use-macro="here/resource-form-macros/macros/nfsc_macro"/>
+    </span>
+    <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'">
+      <div metal:use-macro="here/resource-form-macros/macros/scr_macro" />
+    </span>
+  </div>
+
+  <div id="IP" metal:define-macro="ip_macro">
+    <span tal:condition="python:ptype == '33'">
+      <span tal:define="
+        global resName res/name;
+        global address python:resName.split('.');
+        global ip1 python:address[0];
+        global ip2 python:address[1];
+        global ip3 python:address[2];
+        global ip4 python:address[3];
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
+    </span>
+
+    <span tal:condition="python:ptype != '33'">
+      <span tal:define="
+            global cluname request/clustername;
+            tmp_URL context/cluster/index_html/absolute_url;
+            global processURL string:?pagetype=35&clustername='+cluname+'&edit=0" />
+    </span>
+    <h2>IP Address Resource Configuration</h2>
+    <form name="ip_form" id="ip_form" method="get" tal:attributes="action processURL">
+      <input name="pagetype" type="hidden" value="35"/>
+      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
+      <input name="oldname" type="hidden"
+             tal:attributes="value res/name"
+             tal:condition="python:ptype == '33'" />
+      <input name="edit" type="hidden" value="1"
+             tal:condition="python:ptype == '33'" />
+     <input name="type" type="hidden" value="ip"/>
+      <table id="ipResourceTable" border="0" cellspacing="0" width="200" style="background-color: #dee7ec">
+        <tr>
+          <div>
+    	    <strong>Resource Name:</strong>
+	      <input type="text" id="resourceName" name="resourceName" tal:attributes="VALUE resName|nothing" />
+          </div>
+        </tr>
+        <tr>
+          <div>
+    	    <strong>IP:</strong>
+    	    <input size="3" name="ip1" type="text" maxlength="3" tal:attributes="VALUE ip1|nothing"/>.
+            <input size="3" name="ip2" type="text" maxlength="3" tal:attributes="VALUE ip2|nothing"/>.
+            <input size="3" name="ip3" type="text" maxlength="3" tal:attributes="VALUE ip3|nothing"/>.
+            <input size="3" name="ip4" type="text" maxlength="3" tal:attributes="VALUE ip4|nothing"/>
+          </div>
+          <div>
+    	    <strong>Monitor Link</strong>
+	    <input type="checkbox" name="monitorLink" tal:condition="python:ptype != '33'">
+	    <input type="checkbox" name="monitorLink" checked tal:condition="python:ptype == '33'">
+          </div>
+        </tr>
+      </table>
+    </form>
+    <input 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 cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
+    </span>
+    <span tal:condition="python:ptype != '33'">
+      <span tal:define="
+        global force_unmount string:0;
+        global reboot_fail string:0;
+        global fscheck string:0;
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL string:?pagetype=35&clustername='+cluname+'&edit=0" />
+    </span>
+    <h2>File System Resource Configuration</h2>
+      <form name="fs_form" action="" method="get" tal:attributes="action processURL">
+      <input name="pagetype" type="hidden" value="35"/>
+      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
+      <input name="oldname" type="hidden"
+             tal:attributes="value res/name"
+             tal:condition="python:ptype == '33'" />
+      <input name="edit" type="hidden" value="1"
+             tal:condition="python:ptype == '33'" />
+     <input name="type" type="hidden" value="fs"/>
+      <table id="fileSystemTable" border="0" cellspacing="0">
+        <tr>
+          <div>
+	    <strong>Resource Name:</strong>
+    	    <input type="text" size="20" id="resourceName" name="resourceName" tal:attributes="value resName|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>File System Type:</strong>
+	    <select id="fstype" name="fstype">
+    	    <option name="ext2" value="ext2">ext2</option>
+            <option name="ext3" value="ext3">ext3</option>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Mount Point:</strong>
+	    <input type="text" size="20" id="mountpoint" name="mountpoint" tal:attributes="value mountPoint|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Device:</strong>
+	    <input type="text" size="20" id="device" name="device" tal:attributes="value device|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Options:</strong>
+	    <input type="text" size="20" id="options" name="options" tal:attributes="value opt|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>File System ID:</strong>
+    	    <input type="text" size="20" id="fsid" name="fsid" tal:attributes="value fsid|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <input type="checkbox" id="forceunmount" name="forceunmount" checked 
+                   tal:condition="python:force_unmount == '1'"/>
+	    <input type="checkbox" id="forceunmount" name="forceunmount"
+                   tal:condition="python:force_unmount != '1'"/>
+	    <strong>Force unmount</strong>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <input type="checkbox" id="selffence" name="selffence" 
+                   tal:condition="not: reboot_fail| python:reboot_fail == '1'"/>
+	    <input type="checkbox" id="selffence" name="selffence" 
+                   tal:condition="python:reboot_fail != '1'"/>
+	    <strong>Reboot host node if unmount fails</strong>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <input type="checkbox" id="checkfs" name="checkfs" checked
+                   tal:condition="python:fscheck == '1'"/>
+	    <input type="checkbox" id="checkfs" name="checkfs"
+                   tal:condition="python:fscheck != '1'"/>
+    	    <strong>Check file system before mounting</strong>
+          </div>
+        </tr>	    	    
+      </table>
+    </form>
+    <input type="button" value="Submit" onClick="validate(fs_form);"/>
+  </div>
+  <div id="GFS" metal:define-macro="gfs_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 cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
+    </span>
+    <span tal:condition="python:ptype != '33'">
+      <span tal:define="
+        global force_unmount string:0;
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL string:?pagetype=35&clustername='+cluname+'&edit=0" />
+    </span>
+    <h2>GFS Resource Configuration</h2>
+    <form name="gfs_form" action="" method="post" tal:attributes="action processURL">
+      <input name="pagetype" type="hidden" value="35"/>
+      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
+      <input name="oldname" type="hidden"
+             tal:attributes="value res/name"
+             tal:condition="python:ptype == '33'" />
+      <input name="edit" type="hidden" value="1"
+             tal:condition="python:ptype == '33'" />
+     <input name="type" type="hidden" value="gfs"/>
+      <table id="gfsTable" border="0" cellspacing="0">
+        <tr>
+          <div>
+	    <strong>Resource Name:</strong>
+    	    <input type="text" size="20" id="resourceName" name="resourceName"
+                   tal:attributes="value resName|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Mount Point:</strong>
+	    <input type="text" size="20" id="mountPoint" name="mountpoint" 
+                   tal:attributes="value mountpoint|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Device:</strong>
+	    <input type="text" size="20" id="device" name="device" 
+                   tal:attributes="value device|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Options:</strong>
+	    <input type="text" size="20" id="options" name="options" 
+                   tal:attributes="value opt|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>File System ID:</strong>
+    	    <input type="text" size="20" id="fsid" name="fsid" 
+                   tal:attributes="value fsid|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <input type="checkbox" id="forceunmount" name="forceunmount" checked 
+                   tal:condition="python:force_unmount == '1'"/>
+	    <input type="checkbox" id="forceunmount" name="forceunmount"
+                   tal:condition="python:force_unmount != '1'"/>
+	    <strong>Force unmount</strong>
+          </div>
+        </tr>
+      </table>
+    </form>
+    <input type="button" value="Submit" onclick="validate(gfs_form);"/>
+    </div>
+
+  <div id="NFSM" metal:define-macro="nfsm_macro">
+    <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 cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
+    </span>
+    <span tal:condition="python:ptype != '33'">
+      <span tal:define="
+        global force_unmount string:0;
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL string:?pagetype=35&clustername='+cluname+'&edit=0" />
+    </span>
+  <h2>NFS Mount Resource Configuration</h2>
+  <form name="nfsm_form" action="" method="post">
+    <form name="gfs_form" action="" method="post" tal:attributes="action processURL">
+      <input name="pagetype" type="hidden" value="35"/>
+      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
+      <input name="oldname" type="hidden"
+             tal:attributes="value res/name"
+             tal:condition="python:ptype == '33'" />
+      <input name="edit" type="hidden" value="1"
+             tal:condition="python:ptype == '33'" />
+      <input name="type" type="hidden" value="nfsm"/>
+      <table id="nfsMountTable" border="0" cellspacing="0">
+        <tr>
+          <div>
+	    <strong>Resource Name:</strong>
+    	    <input type="text" size="20" id="resourceName" name="resourceName"
+                   tal:attributes="value resName|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Mount Point:</strong>
+	    <input type="text" size="20" id="mountpoint" name="mountpoint" 
+                   tal:attributes="value mountpoint|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Host:</strong>
+	    <input type="text" size="20" id="host" name="host" 
+                   tal:attributes="value hostname|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Export Path:</strong>
+    	    <input type="text" size="20" id="exportpath" name="exportpath"
+                   tal:attributes="value expath|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+    	    <input type="radio" name="nfstype" value="nfs" checked>NFS
+	    <input type="radio" name="nfstype" value="nfs4">NFS4
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Options:</strong>
+	    <input type="text" size="20" id="options" name="options" 
+                   tal:attributes="value opt|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <input type="checkbox" id="forceunmount" name="forceunmount" checked 
+                   tal:condition="python:force_unmount == '1'"/>
+	    <input type="checkbox" id="forceunmount" name="forceunmount"
+                   tal:condition="python:force_unmount != '1'"/>
+	    <strong>Force unmount</strong>
+          </div>
+        </tr>
+      </table>
+    </form>
+    <input type="button" value="Submit" onclick="validate(nfsm_form);"/>
+  </div>
+
+  <div id="NFSC" metal:define-macro="nfsc_macro">
+    <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 cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
+    </span>
+    <span tal:condition="python:ptype != '33'">
+      <span tal:define="
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL string:?pagetype=35&clustername='+cluname+'&edit=0" />
+    </span>
+    <h2>NFS Client Resource Configuration</h2>
+    <form name="nfsc_form" action="" method="post" tal:attributes="action processURL">
+      <input name="pagetype" type="hidden" value="35"/>
+      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
+      <input name="oldname" type="hidden"
+             tal:attributes="value res/name"
+             tal:condition="python:ptype == '33'" />
+      <input name="edit" type="hidden" value="1"
+             tal:condition="python:ptype == '33'" />
+      <input name="type" type="hidden" value="nfsc"/>
+      <table id="nfsClientTable" border="0" cellspacing="0">
+        <tr>
+          <div>
+	    <strong>Resource Name:</strong>
+    	    <input type="text" size="20" id="resourceName" name="resourceName"
+                   tal:attributes="value resName|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Target:</strong>
+	    <input type="text" size="20" id="target" name="target" 
+                   tal:attributes="value target|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Options:</strong>
+	    <input type="text" size="20" id="options" name="options" 
+                   tal:attributes="value opt|nothing"/>
+          </div>
+        </tr>
+      </table>
+    </form>
+    <input type="button" value="Submit" onclick="validate(nfsc_form);"/>
+  </div>
+
+<div id="NFSX" metal:define-macro="nfsx_macro">
+    <span tal:condition="python:ptype == '33'">
+      <span tal:define="
+        global resName res/name;
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
+    </span>
+    <span tal:condition="python:ptype != '33'">
+      <span tal:define="
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL string:?pagetype=35&clustername='+cluname+'&edit=0" />
+    </span>
+    <h2>NFS Export Resource Configuration</h2>
+    <form name="nfsx_form" action="" method="post" tal:attributes="action processURL">
+      <input name="pagetype" type="hidden" value="35"/>
+      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
+      <input name="oldname" type="hidden"
+             tal:attributes="value res/name"
+             tal:condition="python:ptype == '33'" />
+      <input name="edit" type="hidden" value="1"
+             tal:condition="python:ptype == '33'" />
+      <input name="type" type="hidden" value="nfsx"/>
+      <table id="nfsExportTable" border="0" cellspacing="0">
+        <tr>
+          <div>
+    	    <strong>Name:</strong>
+	    <input type="text" size="20" id="resourceName" name="resourceName" 
+                   tal:attributes="value resName|nothing"/>
+          </div>
+        </tr>
+      </table>
+    </form>
+    <input type="button" value="Submit" onclick="validate(nfsx_form);"/>
+  </div>
+
+  <div id="SCR" metal:define-macro="scr_macro">
+    <span tal:condition="python:ptype == '33'">
+      <span tal:define="
+        global resName res/name;
+        global filename res/file;
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
+    </span>
+    <span tal:condition="python:ptype != '33'">
+      <span tal:define="
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL string:?pagetype=35&clustername='+cluname+'&edit=0" />
+    </span>
+    <h2>Script Resource Configuration</h2>
+    <form name="scr_form" action="" method="post" tal:attributes="action processURL">
+      <input name="pagetype" type="hidden" value="35"/>
+      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
+      <input name="oldname" type="hidden"
+             tal:attributes="value res/name"
+             tal:condition="python:ptype == '33'" />
+      <input name="edit" type="hidden" value="1"
+             tal:condition="python:ptype == '33'" />
+      <input name="type" type="hidden" value="scr"/>
+      <table id="scriptTable" border="0" cellspacing="0">
+        <tr>
+          <div>
+    	    <strong>Name:</strong>
+	    <input type="text" size="20" id="resourceName" name="resourceName"
+                   tal:attributes="value resName|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>File</strong> (with path):
+	    <input type="text" size="20" id="file" name="file"
+                   tal:attributes="value filename|nothing"/>
+          </div>
+        </tr>
+      </table>
+    </form>
+    <input type="button" value="Submit" onclick="validate(scr_form);"/>
+  </div>
+
+  <div id="SMB" metal:define-macro="smb_macro">
+    <span tal:condition="python:ptype == '33'">
+      <span tal:define="
+        global resName res/name;
+        global workgroup res/workgroup;
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL python:tmp_URL+'?pagetype=35&clustername='+cluname+'&edit=1'"/>
+    </span>
+    <span tal:condition="python:ptype != '33'">
+      <span tal:define="
+        global cluname request/clustername;
+        tmp_URL context/cluster/index_html/absolute_url;
+        global processURL string:?pagetype=35&clustername='+cluname+'&edit=0" />
+    </span>
+    <h2>Samba Server Configuration</h2>
+    <form name="smb_form" action="" method="post" tal:attributes="action processURL">
+      <input name="pagetype" type="hidden" value="35"/>
+      <input name="clustername" type="hidden" tal:attributes="value cluname"/>
+      <input name="oldname" type="hidden"
+             tal:attributes="value res/name"
+             tal:condition="python:ptype == '33'" />
+      <input name="edit" type="hidden" value="1"
+             tal:condition="python:ptype == '33'" />
+      <input name="type" type="hidden" value="smb"/>
+      <table id="sambaTable" border="0" cellspacing="0">
+        <tr>
+          <div>
+	    <strong>Name:</strong>
+    	    <input type="text" size="20" id="resourceName" name="resourceName"
+                   tal:attributes="value resName|nothing"/>
+          </div>
+        </tr>
+        <tr>
+          <div>
+	    <strong>Workgroup:</strong>
+	    <input type="text" size="20" id="workgroup" name="workgroup"
+                   tal:attributes="value workgroup|nothing"/>
+          </div>
+        </tr>
+      </table>
+    </form>
+    <input type="button" value="Submit" onclick="validate(smb_form);"/>
+  </div> 
+  </body>
+</html>
--- conga/luci/cluster/form-chooser	2006/07/25 02:27:08	1.3
+++ conga/luci/cluster/form-chooser	2006/07/27 16:32:46	1.4
@@ -84,22 +84,22 @@
      <div metal:use-macro="here/form-macros/macros/servicerestart"/>
     </span>
     <span tal:omit-tag="" tal:condition="python: ptype == '30'">
-     <div metal:use-macro="here/form-macros/macros/resources-form"/>
+     <div metal:use-macro="here/resource-form-macros/macros/resources-form"/>
     </span>
     <span tal:omit-tag="" tal:condition="python: ptype == '31'">
-     <div metal:use-macro="here/form-macros/macros/resourceadd-form"/>
+     <div metal:use-macro="here/resource-form-macros/macros/resourceadd-form"/>
     </span>
     <span tal:omit-tag="" tal:condition="python: ptype == '32'">
-     <div metal:use-macro="here/form-macros/macros/resourcelist-form"/>
+     <div metal:use-macro="here/resource-form-macros/macros/resourcelist-form"/>
     </span>
     <span tal:omit-tag="" tal:condition="python: ptype == '33'">
-     <div metal:use-macro="here/form-macros/macros/resourceconfig-form"/>
+     <div metal:use-macro="here/resource-form-macros/macros/resourceconfig-form"/>
     </span>
     <span tal:omit-tag="" tal:condition="python: ptype == '34'">
-     <div metal:use-macro="here/form-macros/macros/resource-form"/>
+     <div metal:use-macro="here/resource-form-macros/macros/resource-form"/>
     </span>
     <span tal:omit-tag="" tal:condition="python: ptype == '35'">
-     <div metal:use-macro="here/form-macros/macros/resourceprocess-form"/>
+     <div metal:use-macro="here/resource-form-macros/macros/resourceprocess-form"/>
     </span>
     <span tal:omit-tag="" tal:condition="python: ptype == '40'">
      <div metal:use-macro="here/form-macros/macros/fdoms-form"/>




More information about the Cluster-devel mailing list