summaryrefslogblamecommitdiffstats
path: root/application/modules/fbgui/views/scripts/index/start.phtml
blob: f63b8bd1634ab7f899a022a2cf88aad768f5678d (plain) (tree)
1
2
3
4
5
6
7
8
9
 
                               





                                                                       
 





                                                                          
                                 
                                                                        
        

                                                                 
                                                                                                         



                                                                 
                  
                
 
                                          
                            


                                                              


                                                                                                                                        

                                                                                                                                                        


                                                                                                                   
 




                                                       
                                
                                                    
     












                           

                                    
                                                  
 

                                  
 
                               
 
                                      


                                                                                                                                         
               
                      
 
 
         

<script type="text/javascript">
function bytesToSize(bytes) {
    var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
    if (bytes == 0) return 'n/a';
    var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
    return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[[i]];
}

if (!Number.toFixed) {
	Number.prototype.toFixed=function(n){
		return Math.round(this*Math.pow(10, n)) / Math.pow(10, n);
	}
}

function updateProgress(p, s, u){
	$("#progressbar").progressbar({ value: ((actFile-1)*50+(p/2))});
	
	if (p >= 0 && p <= 100){
		$(".progressbar:last").progressbar({ value: p });
		$(".downloadelement .status:last").html("Downloading... "+p+"% - "+(s.toFixed(2))+" "+u);
	}else{
		$(".progressbar:last").progressbar({ value: 0 });
	}
}
var fileCount = 2;
var actFile = 0;

function downloadInfo(filename, filesize){
	actFile = actFile+1;
    $(".downloadelement .status").html("Complete");
    $(".progressbar:last").progressbar({ value: 100});
    $("#downloadinfo").append("<div class='downloadelement'>"+
									"<div class='label'>"+
										"<div><b>File: </b>"+filename+"</div>"+
										"<div><b>Filesize:</b> "+bytesToSize(filesize)+"</div>"+
									"</div>"+									
    								'<div class="progressbar" style="height: 10px;"></div>'+
									"<div class='status'>Downloading...</div>"+
    							"</div>");
     $(".progressbar:last").progressbar({ value: 0 });
}
function allComplete(){
	$(".downloadelement .status").html("Complete");
    $(".progressbar").progressbar({ value: 100});
}

  $(document).ready(function() {
  	$("#progressbar").progressbar({ value: 0 });
  });
</script> 


<div id="div4"> 
  <div class="bar1"></div> 
  <div class="bar2"></div> 
  <div class="bar3"></div> 
  <div class="bar4"></div> 
  <div class="bar5"></div> 
  <div class="bar6"></div> 
  <div class="bar7"></div> 
  <div class="bar8"></div> 
</div>
<h1>Downloading System Files</h1>
<div class='headling'>Overall:</div>
<div id="progressbar" style="height: 30px;"></div>

<div class='headling'>Files:</div>
<div id='downloadinfo'></div>

<script type="text/javascript">

fbgui.setCallbackOnFinished('foo();');
fbgui.startDownload('http://<?php echo $this->host; ?>/resource/getkernel/alpha/<?php echo $this->alphasessionID; ?>/file/kernel');
fbgui.startDownload('http://<?php echo $this->host; ?>/resource/getinitramfs/alpha/<?php echo $this->alphasessionID; ?>/file/initramfs');
fbgui.startDownload('http://<?php echo $this->host; ?>/resource/getkcl/alpha/<?php echo $this->alphasessionID; ?>/file/kcl');
function foo(){
	allComplete();
}

</script>