Permalink
Browse files

narcissus js: show spinner to indicate it's working.

In the long term this should be replaced with proper ajax/websocket feedback

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
  • Loading branch information...
1 parent b347ea4 commit 4d4c4108524f65a16a8b236afbebbfc44073005d @koenkooi koenkooi committed May 3, 2012
Showing with 14 additions and 2 deletions.
  1. BIN img/spinner.gif
  2. +14 −2 scripts/js/narcissus.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,6 @@
/* Narcissus Online Image generator
-(c) Koen Kooi 2008 - 2010
+(c) Koen Kooi 2008 - 2012
This is licensed under the terms of the GPLv2
@@ -9,7 +9,8 @@ This is licensed under the terms of the GPLv2
var packagelist = new Array;
var packagestring = "";
var opackage = "";
-var progress_text = ""
+var progress_text = "";
+var spinner_image = "<img src='img/spinner.gif'>";
var FAIL_image = "<img src='img/X_mark.png'>";
var succes_image = "<img src='img/Green_tick.png'>";
var repourl = "http://www.angstrom-distribution.org/repo/?pkgname=";
@@ -201,6 +202,8 @@ function configureImage(){
document.getElementById('pkg_progress').innerHTML = progress_text;
var params = 'action=configure_image&machine=' + document.entry_form.machine.value + '&release=' + document.entry_form.configs.value + '&name=' + document.entry_form.name.value;
+
+ document.getElementById('td-configure').innerHTML = spinner_image;
$.ajax({
type: "POST",
@@ -225,6 +228,9 @@ function assembleImage(){
}
var params = 'action=assemble_image&machine=' + document.entry_form.machine.value + '&name=' + document.entry_form.name.value + '&imagetype=' + imagetype + '&manifest=' + document.entry_form.manifest.value + '&sdk=' + document.entry_form.SDK.value + '&sdkarch=' + document.entry_form.sdkarch.value;
+
+ document.getElementById('td-assemble').innerHTML = spinner_image;
+
$.ajax({
type: "POST",
url: workerurl,
@@ -247,6 +253,12 @@ function assembleImage(){
function installPackage(){
if (packagelist != "" && packagelist != " ") {
var params = 'action=install_package&machine=' + document.entry_form.machine.value + '&name=' + document.entry_form.name.value + '&pkgs=' + packagelist;
+
+ for(var i=0; i < packagelist.length; i++){
+ var progress_id = 'td-' + packagelist[i];
+ document.getElementById(progress_id).innerHTML = spinner_image;
+ }
+
$.ajax({
type: "POST",
url: workerurl,

0 comments on commit 4d4c410

Please sign in to comment.