Author: jfthomps Date: Tue Apr 24 20:03:58 2012 New Revision: 1329980 URL: http://svn.apache.org/viewvc?rev=1329980&view=rev Log: removed all references to vmtype
utils.php: -modified getComputers - removed vmtypeid from the select statement -modified getVMProfiles - removed vt.name, vp.vmtypeid, and join on vmtype from select statement -removed getVMtypes -modified getSelectLanguagePulldown - (unrelated) changed time for change language continuation from 5 minutes to 1 day vm.php: -modified editVMInfo - removed Type from edit profile section -modified AJprofileData - removed types from data returned -modified AJupdateVMprofileItem - removed vmtypeid as an item that can be updated -modified AJnewProfile - modified initial insert to not include vmtypeid vm.js: -modified getVMprofileDataCB - no longer set the store for the ptype widget -modified delProfile - removed Type from confirmation table Modified: incubator/vcl/trunk/web/.ht-inc/utils.php incubator/vcl/trunk/web/.ht-inc/vm.php incubator/vcl/trunk/web/js/vm.js Modified: incubator/vcl/trunk/web/.ht-inc/utils.php URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/utils.php?rev=1329980&r1=1329979&r2=1329980&view=diff ============================================================================== --- incubator/vcl/trunk/web/.ht-inc/utils.php (original) +++ incubator/vcl/trunk/web/.ht-inc/utils.php Tue Apr 24 20:03:58 2012 @@ -7162,7 +7162,6 @@ function getComputers($sort=0, $included . "r.id AS resourceid, " . "c.notes, " . "c.vmhostid, " - . "c.vmtypeid, " . "c2.hostname AS vmhost, " . "c.location, " . "c.provisioningid, " @@ -9295,8 +9294,6 @@ function generateString($length=8) { /// element is an array with these keys:\n /// \b profilename - name of profile\n /// \b name - name of profile (so array can be passed to printSelectInput)\n -/// \b type - name of vm type\n -/// \b typeid - id of vm type\n /// \b image - name of image used for this profile\n /// \b imageid - id of image used for this profile\n /// \b repositorypath - share exported by nas to the vmhost\n @@ -9316,8 +9313,6 @@ function getVMProfiles($id="") { $query = "SELECT vp.id, " . "vp.profilename, " . "vp.profilename AS name, " - . "vt.name AS type, " - . "vp.vmtypeid, " . "i.prettyname AS image, " . "vp.imageid, " . "vp.repositorypath, " @@ -9331,7 +9326,6 @@ function getVMProfiles($id="") { . "vp.vmware_mac_eth0_generated, " . "vp.vmware_mac_eth1_generated " . "FROM vmprofile vp " - . "LEFT JOIN vmtype vt ON (vp.vmtypeid = vt.id) " . "LEFT JOIN image i ON (vp.imageid = i.id)"; if(! empty($id)) $query .= " AND vp.id = $id"; @@ -9344,24 +9338,6 @@ function getVMProfiles($id="") { //////////////////////////////////////////////////////////////////////////////// /// -/// \fn getVMtypes() -/// -/// \return an array where each key is the id of the type and each element is -/// the name of the type -/// -/// \brief gets the entries from the vmtype table -/// -//////////////////////////////////////////////////////////////////////////////// -function getVMtypes() { - $types = array(); - $qh = doQuery("SELECT id, name FROM vmtype", 101); - while($row = mysql_fetch_assoc($qh)) - $types[$row['id']] = $row['name']; - return $types; -} - -//////////////////////////////////////////////////////////////////////////////// -/// /// \fn addContinuationsEntry($nextmode, $data, $duration, $deleteFromSelf, /// $multicall, $repeatProtect) /// @@ -11230,7 +11206,7 @@ function getSelectLanguagePulldown() { $cdata['locale'] = $dir; $tmp = explode('/', $dir); $testlocale = array_pop($tmp); - $cont = addContinuationsEntry('changeLocale', $cdata, 300); + $cont = addContinuationsEntry('changeLocale', $cdata, 86400); if($locale == $testlocale) $rt .= "<option value=\"$cont\" selected>{$lang}</option>\n"; else Modified: incubator/vcl/trunk/web/.ht-inc/vm.php URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/vm.php?rev=1329980&r1=1329979&r2=1329980&view=diff ============================================================================== --- incubator/vcl/trunk/web/.ht-inc/vm.php (original) +++ incubator/vcl/trunk/web/.ht-inc/vm.php Tue Apr 24 20:03:58 2012 @@ -215,10 +215,6 @@ function editVMInfo() { print " <td><span id=pname dojoType=\"dijit.InlineEditBox\" onChange=\"updateProfile('pname', 'profilename');\"></span></td>\n"; print " </tr>\n"; print " <tr>\n"; - print " <th align=right>Type:</th>\n"; - print " <td><select id=ptype dojoType=\"dijit.form.FilteringSelect\" searchAttr=\"name\" onchange=\"updateProfile('ptype', 'vmtypeid');\"></span></td>\n"; - print " </tr>\n"; - print " <tr>\n"; print " <th align=right>Image:</th>\n"; print " <td><span id=pimage dojoType=\"dijit.form.FilteringSelect\" searchAttr=\"name\" onchange=\"updateProfile('pimage', 'imageid');\" style=\"width: 420px\"></span></td>\n"; print " </tr>\n"; @@ -755,7 +751,6 @@ function AJcancelVMmove() { /// \brief prints json data about a submitted or passed in vm profile with these /// fields:\n /// \b profile - array returned from getVMProfiles\n -/// \b types - array of vm types\n /// \b vmdisk - array of vm disk options\n /// \b images - array of images /// @@ -771,7 +766,6 @@ function AJprofileData($profileid="") { if(is_null($value)) $profiledata[$profileid][$key] = ''; } - $types = getVMtypes(); $allimages = getImages(); $images = array(); foreach($allimages as $key => $image) { @@ -781,19 +775,12 @@ function AJprofileData($profileid="") { } $imagedata = array('identifier' => 'id', 'items' => $images); - $types2 = array(); - foreach($types as $id => $val) { - $types2[] = array('id' => $id, 'name' => $val); - } - $typedata = array('identifier' => 'id', 'items' => $types2); - $vmdiskitems = array(); $vmdiskitems[] = array('id' => 'localdisk', 'name' => 'localdisk'); $vmdiskitems[] = array('id' => 'networkdisk', 'name' => 'networkdisk'); $vmdisk = array('identifier' => 'id', 'items' => $vmdiskitems); $arr = array('profile' => $profiledata[$profileid], - 'types' => $typedata, 'vmdisk' => $vmdisk, 'images' => $imagedata); sendJSON($arr); @@ -814,7 +801,7 @@ function AJupdateVMprofileItem() { } $profileid = processInputVar('profileid', ARG_NUMERIC); $item = processInputVar('item', ARG_STRING); - if(! preg_match('/^(profilename|vmtypeid|imageid|repositorypath|datastorepath|vmpath|virtualswitch0|virtualswitch1|vmdisk|username|password|vmware_mac_eth0_generated|vmware_mac_eth1_generated)$/', $item)) { + if(! preg_match('/^(profilename|imageid|repositorypath|datastorepath|vmpath|virtualswitch0|virtualswitch1|vmdisk|username|password|vmware_mac_eth0_generated|vmware_mac_eth1_generated)$/', $item)) { print "alert('Invalid data submitted.');"; return; } @@ -874,7 +861,7 @@ function AJnewProfile() { return; } $imageid = getImageId('noimage'); - $query = "INSERT INTO vmprofile (profilename, vmtypeid, imageid) VALUES ('$newprofile', 1, $imageid)"; + $query = "INSERT INTO vmprofile (profilename, imageid) VALUES ('$newprofile', $imageid)"; doQuery($query, 101); $qh = doQuery("SELECT LAST_INSERT_ID() FROM vmprofile", 101); $row = mysql_fetch_row($qh); Modified: incubator/vcl/trunk/web/js/vm.js URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/vm.js?rev=1329980&r1=1329979&r2=1329980&view=diff ============================================================================== --- incubator/vcl/trunk/web/js/vm.js (original) +++ incubator/vcl/trunk/web/js/vm.js Tue Apr 24 20:03:58 2012 @@ -75,7 +75,6 @@ function VMHostDataCB(data, ioArgs) { var obj = dijit.byId('vmprofile'); obj.setTitle(profile.profilename); var ct = '<table>'; - ct += '<tr><th align=right>VM type:</th><td>' + profile.type + '</td></tr>'; ct += '<tr><th align=right>Image:</th><td>' + profile.image + '</td></tr>'; ct += '<tr><th align=right>Repository Path:</th><td>' + profile.repositorypath + '</td></tr>'; ct += '<tr><th align=right>Datastore Path:</th><td>' + profile.datastorepath + '</td></tr>'; @@ -569,11 +568,6 @@ function getVMprofileDataCB(data, ioArgs return; } curprofile = data.items.profile; - var obj = dijit.byId('ptype'); - var store = new dojo.data.ItemFileReadStore({data: data.items.types}); - obj.store = store; - if(curprofile.vmtypeid != 0) - obj.setValue(curprofile.vmtypeid); var obj = dijit.byId('pimage'); var store = new dojo.data.ItemFileReadStore({data: data.items.images}); @@ -664,10 +658,6 @@ function delProfile(cont) { content += "<td>" + curprofile.profilename + "</td>"; content += "</tr>"; content += "<tr>"; - content += "<th align=right>Type:</th>"; - content += "<td>" + curprofile.type + "</td>"; - content += "</tr>"; - content += "<tr>"; content += "<th align=right>Image:</th>"; content += "<td>" + curprofile.image + "</td>"; content += "</tr>";