Permalink
Browse files

narcissus: collapse package selection on build and tick off progress …

…during build
  • Loading branch information...
1 parent 3c0abae commit d3a9d5906dbe69c7891c37031b77935a6f57ffe5 @koenkooi koenkooi committed Dec 21, 2008
Showing with 20 additions and 9 deletions.
  1. BIN img/Green_tick.png
  2. +2 −0 index.php
  3. +18 −9 scripts/js/internal_request.js
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -1,6 +1,7 @@
<html>
<head>
<title>Narcissus - Online image builder for the angstrom distribution</title>
+<script language="javascript" type="text/javascript" src="scripts/js/MochiKit.js"></script>
<script language="javascript" type="text/javascript" src="scripts/js/internal_request.js"></script>
<link rel="stylesheet" type="text/css" title="dominion" href="css/dominion.css" media="screen" />
</head>
@@ -127,6 +128,7 @@ function machine_dropdown() {
<br clear='all'/>
<div id="status"></div>
+<div id="pkg_progress"></div>
<div id="image_link"></div>
<div id="configure_progress"></div>
<div id="image_progress"></div>
@@ -21,7 +21,6 @@ var package = "";
function configureImage(){
- showHideElement('form',0);
showHideElement('intro',0);
@@ -42,14 +41,26 @@ function configureImage(){
packagelist = packagestring.split(" ");
- document.getElementById('status').innerHTML = "<br/>\n<br/>\nConfiguring image";
+ document.getElementById('pkg_progress').innerHTML = "<br/><br/><table>\n";
+ document.getElementById('pkg_progress').innerHTML += "<tr><td colspan=\"2\">Preconfiguring image</td><td></td><td id=\"td-configure\"></td></tr>";
+ document.getElementById('pkg_progress').innerHTML += "<tr><td colspan=\"2\">Installing packages:</td><td></td><td id=\"td-package\"></td></tr>";
+
+ for (var i in packagelist) {
+ document.getElementById('pkg_progress').innerHTML += "<tr><td>&nbsp;</td><td>" + packagelist[i] + "</td><td>&nbsp;</td><td id=\"td-" + packagelist[i] + "\">&nbsp;&nbsp;</td></tr>";
+ }
+
+ document.getElementById('pkg_progress').innerHTML += "<tr><td colspan=\"2\">Assembling image</td><td></td><td id=\"td-assemble\"></td></tr>";
+ document.getElementById('pkg_progress').innerHTML += "</table>\n";
+
+
var params = 'action=configure_image&machine=' + document.entry_form.machine.value + '&name=' + document.entry_form.name.value;
http.open('post', 'backend.php');
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.onreadystatechange = configureProgress;
http.send(params);
+ blindUp('form');
}
function assembleImage(){
@@ -82,18 +93,17 @@ function showImagelink(){
function configureProgress(){
if(http.readyState == 4){
var response = http.responseText;
- document.getElementById('status').innerHTML += ": complete<br/>\n<br/>\n";
showHideElement('configure_progress',0);
document.getElementById('configure_progress').innerHTML = response;
+ document.getElementById('td-configure').innerHTML = "<img src=\"img/Green_tick.png\">";
package = packagelist.shift();
- document.getElementById('status').innerHTML += "Installed packages: ";
installPackage("test");
}
}
function installProgress(){
if(http.readyState == 4){
- document.getElementById('status').innerHTML += " " + package ;
+ document.getElementById('td-' + package).innerHTML = "<img src=\"img/Green_tick.png\">";
if (packagelist.length > 1) {
package = packagelist.shift();
if (package != "" && package != " ") {
@@ -107,13 +117,11 @@ function installProgress(){
}
function assembleProgress(){
- if(http.readyState == 1){
- document.getElementById('status').innerHTML += "<br>\nAssembling image";
- }
- if(http.readyState == 4){
+ if(http.readyState == 4){
var response = http.responseText;
showHideElement('image_progress',0);
document.getElementById('image_progress').innerHTML = response;
+ document.getElementById('td-assemble').innerHTML = "<img src=\"img/Green_tick.png\">";
showImagelink();
}
}
@@ -122,6 +130,7 @@ function imageDisplay(){
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('image_link').innerHTML = response;
+ pulsate(document.getElementById('image_link'));
}
}

0 comments on commit d3a9d59

Please sign in to comment.