You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2014/09/30 21:19:31 UTC

svn commit: r1628518 - in /vcl/trunk/web: .ht-inc/utils.php .ht-inc/vm.php js/vm.js

Author: jfthomps
Date: Tue Sep 30 19:19:30 2014
New Revision: 1628518

URL: http://svn.apache.org/r1628518
Log:
VCL-636 - Allow vCenter folder to be specified in VM profile

utils.php: modified getVMProfiles: added folderpath

vm.php:
-modified editVMInfo: added Folder Path
-modified AJupdateVMprofileItem: added folderpath

vm.js:
-modified VMHostDataCB: added Folder Path to table created
-modified getVMprofileDataCB: added pfolderpath
-modified delProfile: added Folder Path

Modified:
    vcl/trunk/web/.ht-inc/utils.php
    vcl/trunk/web/.ht-inc/vm.php
    vcl/trunk/web/js/vm.js

Modified: vcl/trunk/web/.ht-inc/utils.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/utils.php?rev=1628518&r1=1628517&r2=1628518&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/utils.php (original)
+++ vcl/trunk/web/.ht-inc/utils.php Tue Sep 30 19:19:30 2014
@@ -11111,6 +11111,8 @@ function generateString($length=8) {
 /// \b name - name of profile (so array can be passed to printSelectInput)\n
 /// \b image - name of image used for this profile\n
 /// \b imageid - id of image used for this profile\n
+/// \b resourcepath\n
+/// \b folderpath\n
 /// \b repositorypath - share exported by nas to the vmhost\n
 /// \b datastorepath - path to where vm data files are stored\n
 /// \b vmpath - path to where vm configuration files are stored\n
@@ -11135,6 +11137,7 @@ function getVMProfiles($id="") {
 	       .        "i.prettyname AS image, "
 	       .        "vp.imageid, "
 	       .        "vp.resourcepath, "
+	       .        "vp.folderpath, "
 	       .        "vp.repositorypath, "
 	       .        "vp.repositoryimagetypeid, "
 	       .        "t1.name AS repositoryimagetype, "

Modified: vcl/trunk/web/.ht-inc/vm.php
URL: http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/vm.php?rev=1628518&r1=1628517&r2=1628518&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/vm.php (original)
+++ vcl/trunk/web/.ht-inc/vm.php Tue Sep 30 19:19:30 2014
@@ -221,6 +221,10 @@ function editVMInfo() {
 	print "    <td><span id=presourcepath dojoType=\"dijit.InlineEditBox\" onChange=\"updateProfile('presourcepath', 'resourcepath');\"></span><img tabindex=0 src=\"images/helpicon.png\" id=\"resourcepathhelp\" /></td>\n";
 	print "  </tr>\n";
 	print "  <tr>\n";
+	print "    <th align=right>Folder Path:</th>\n";
+	print "    <td><span id=pfolderpath dojoType=\"dijit.InlineEditBox\" onChange=\"updateProfile('pfolderpath', 'folderpath');\"></span><img tabindex=0 src=\"images/helpicon.png\" id=\"folderpathhelp\" /></td>\n";
+	print "  </tr>\n";
+	print "  <tr>\n";
 	print "    <th align=right>Repository Path:</th>\n";
 	print "    <td><span id=prepositorypath dojoType=\"dijit.InlineEditBox\" onChange=\"updateProfile('prepositorypath', 'repositorypath');\"></span><img tabindex=0 src=\"images/helpicon.png\" id=\"repositorypathhelp\" /></td>\n";
 	print "  </tr>\n";
@@ -329,6 +333,8 @@ function editVMInfo() {
 
 	print "<div dojoType=\"dijit.Tooltip\" connectId=\"resourcepathhelp\">\n";
 	print _("Resource Path only needs to be configured if VMware vCenter is used. It defines the location where VMs will be created in the vCenter inventory tree. The inventory tree contains at least one Datacenter, and may also contain Folders, Clusters, and Resource Pools.<br>Example: /DatacenterA/Folder1/Cluster2/ResourcePool3");
+	print "<div dojoType=\"dijit.Tooltip\" connectId=\"folderpathhelp\">\n";
+	print _("Folder Path only needs to be configured if VMware vCenter is used. It defines the location where VMs will reside according to the vSphere Client's 'VMs and Templates' inventory view. This view will contain at least 1 Datacenter at the root level of the tree. Underneath each Datacenter, VMs may optionally be organized into VM Folders. Example: /DatacenterA/VCL_VMs");
 	print "</div>\n";
 	print "<div dojoType=\"dijit.Tooltip\" connectId=\"repositorypathhelp\">\n";
 	print _("(Optional) The path where master copies of images are stored which are used to transfer images to VM host datastores or to other repositories. This is required if multiple management nodes need to share images. VMs do not run directly off of the images stored in the repository. It can refer to and be mounted on either the management node or VM host.");
@@ -925,7 +931,7 @@ function AJupdateVMprofileItem() {
 	}
 	$profileid = processInputVar('profileid', ARG_NUMERIC);
 	$item = processInputVar('item', ARG_STRING);
-	if(! preg_match('/^(profilename|imageid|resourcepath|repositorypath|repositoryimagetypeid|datastorepath|datastoreimagetypeid|vmdisk|vmpath|virtualswitch[0-3]|username|password|eth0generated|eth1generated|rsakey|rsapub)$/', $item)) {
+	if(! preg_match('/^(profilename|imageid|resourcepath|folderpath|repositorypath|repositoryimagetypeid|datastorepath|datastoreimagetypeid|vmdisk|vmpath|virtualswitch[0-3]|username|password|eth0generated|eth1generated|rsakey|rsapub)$/', $item)) {
 		print "alert('Invalid data submitted.');";
 		return;
 	}

Modified: vcl/trunk/web/js/vm.js
URL: http://svn.apache.org/viewvc/vcl/trunk/web/js/vm.js?rev=1628518&r1=1628517&r2=1628518&view=diff
==============================================================================
--- vcl/trunk/web/js/vm.js (original)
+++ vcl/trunk/web/js/vm.js Tue Sep 30 19:19:30 2014
@@ -77,6 +77,7 @@ function VMHostDataCB(data, ioArgs) {
 	var ct = '<table>';
 	ct += '<tr><th align=right>Image:</th><td>' + profile.image + '</td></tr>';
 	ct += '<tr><th align=right>Resource Path:</th><td>' + profile.resourcepath + '</td></tr>';
+	ct += '<tr><th align=right>Folder Path:</th><td>' + profile.folderpath + '</td></tr>';
 	ct += '<tr><th align=right>Repository Path:</th><td>' + profile.repositorypath + '</td></tr>';
 	ct += '<tr><th align=right>Repository Image Type:</th><td>' + profile.repositoryimagetype + '</td></tr>';
 	ct += '<tr><th align=right>Virtual Disk Path:</th><td>' + profile.datastorepath + '</td></tr>';
@@ -593,6 +594,7 @@ function getVMprofileDataCB(data, ioArgs
 
 	dijit.byId('pname').noValueIndicator = '(empty)';
 	dijit.byId('presourcepath').noValueIndicator = '(empty)';
+	dijit.byId('pfolderpath').noValueIndicator = '(empty)';
 	dijit.byId('prepositorypath').noValueIndicator = '(empty)';
 	dijit.byId('pdspath').noValueIndicator = '(empty)';
 	dijit.byId('pvmpath').noValueIndicator = '(empty)';
@@ -606,6 +608,7 @@ function getVMprofileDataCB(data, ioArgs
 
 	dijit.byId('pname').setValue(curprofile.profilename);
 	dijit.byId('presourcepath').setValue(curprofile.resourcepath);
+	dijit.byId('pfolderpath').setValue(curprofile.folderpath);
 	dijit.byId('prepositorypath').setValue(curprofile.repositorypath);
 	dijit.byId('prepositoryimgtype').setValue(curprofile.repositoryimagetypeid);
 	dijit.byId('pdspath').setValue(curprofile.datastorepath);
@@ -689,6 +692,10 @@ function delProfile(cont) {
 	content += "<td>" + curprofile.resourcepath + "</td>";
 	content += "</tr>";
 	content += "<tr>";
+	content += "<th align=right>Folder Path:</th>";
+	content += "<td>" + curprofile.folderpath + "</td>";
+	content += "</tr>";
+	content += "<tr>";
 	content += "<th align=right>Repository Path:</th>";
 	content += "<td>" + curprofile.repositorypath + "</td>";
 	content += "</tr>";