Changeset 6628
- Timestamp:
- Jan 17, 2018, 5:45:41 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lmd/trunk/fuentes/admin-center-ltsp.install/modul/lliurex-ltsp/src/js/imageManager.js
r6561 r6628 1387 1387 bootbox.confirm(text, function(res){ 1388 1388 if (res) { 1389 debugger;1390 1389 $("#llx-ltsp-new-image-assistant").fadeOut(); 1391 1390 //alert("create image"); … … 1399 1398 var req = new XMLHttpRequest(); 1400 1399 var timer; 1401 req.open('POST','http://'+sessionStorage.server+'/ admin-center/uploadiso.php');1400 req.open('POST','http://'+sessionStorage.server+'/uploadiso.php'); 1402 1401 req.upload.addEventListener("progress", self.progressUpload, false); 1403 req.upload.addEventListener("loadstart", self.startUpload, false);1404 1402 req.onreadystatechange = function(){ 1405 1403 if(req.readyState == 2){ … … 1413 1411 image_data['isopath'] = oRes['target']; 1414 1412 image_data['env'] = 'VENDOR="ISO" '; 1415 //self.createImageOnServer(id,image_data);1413 self.createImageOnServer(id,image_data); 1416 1414 } 1417 1415 } 1418 1416 else{ 1419 1417 // Cancel Upload file 1418 console.log('Upload canceled'); 1420 1419 } 1421 1420 } … … 1440 1439 ImageManager.prototype.progressUpload = function progressUpload(event){ 1441 1440 var self = this; 1442 1443 console.log("Uploaded " + event.loaded + " bytes of " + event.total);1444 1441 var percent = (event.loaded / event.total) * 100; 1445 1442 $("#progressIsoUpload").css({'width': percent + '%'}); 1446 if(percent == 100){$("#uploadIso Dialog").fadeOut(400,function(){modaldiv.remove()});}1443 if(percent == 100){$("#uploadIsoClose").click();} 1447 1444 } 1448 1445 … … 1452 1449 1453 1450 ImageManager.prototype.createImageOnServer=function createImageOnServer(id, image_data){ 1454 console.log(id);1455 console.log(image_data);1456 1451 1457 1452 var credentials=[sessionStorage.username , sessionStorage.password]; … … 1466 1461 arglist.push(image_data.arch); 1467 1462 if(image_data.hasOwnProperty('env')) arglist.push(image_data.env); 1468 if(image_data.hasOwnProperty('isopath')) arglist.push(' --isopath "' + image_data.isopath + '"') 1463 if(image_data.hasOwnProperty('isopath')) arglist.push(' --isopath "' + image_data.isopath + '"'); 1469 1464 1470 1465 Utils.n4dWithLog(credentials, n4dclass, n4dmethod, arglist, null); // no callback is needed … … 1653 1648 "i386":"", 1654 1649 "amd64":"" 1655 } 1650 }, 1651 "llx_ltsp_lliurex_from_iso": "lliurex-from-iso.conf" 1656 1652 }; 1657 1653 … … 1659 1655 "llx_ltsp_lliurex_from_iso" : "ISO", 1660 1656 "llx_ltsp_lliurex_minimal_image" : "mini", 1661 } 1657 }; 1662 1658 1663 1659 // Check templates … … 1676 1672 If not exists template for options selected or it's not needed then template is void 1677 1673 */ 1678 try{ template = list_templates[id][arch] } catch(err){} 1679 try{ type = type_image[id] } catch(err){} 1680 1674 try{ template = list_templates[id][arch] ;} catch(err){}; 1675 try{ type = type_image[id] ;} catch(err){}; 1676 1677 if (id == 'llx_ltsp_lliurex_from_iso') 1678 template = list_templates[id]; 1681 1679 // Setting image arch to description 1682 1680 if(arch==="i386") image_desc+=" (32 bits)";
Note: See TracChangeset
for help on using the changeset viewer.