diff --git a/tbsetup/template_exprun.in b/tbsetup/template_exprun.in index eb573f6a225eeea24a3f430e8cf66f0828cba413..f41ebc38d11ee9dd8f99d5ecec8c55bc0f568506 100644 --- a/tbsetup/template_exprun.in +++ b/tbsetup/template_exprun.in @@ -408,8 +408,6 @@ if (! ($debug || $foreground)) { TBdbfork(); } -sleep(60); - # # When in waitmode, must put ourselves in another process group so that # an interrupt to the parent will not have any effect on the backend. diff --git a/tbsetup/template_swapin.in b/tbsetup/template_swapin.in index 7de2d10f3e1d4a7ffb1390c180f9a182ec96f6b8..07b72543d630a05c27e6567cfe439059709f9a56 100644 --- a/tbsetup/template_swapin.in +++ b/tbsetup/template_swapin.in @@ -444,6 +444,9 @@ sub ParseArgs() if (defined($options{"w"})) { $waitmode = 1; } + if (defined($options{"f"})) { + $foreground = 1; + } } # diff --git a/www/emulab_sup.js b/www/emulab_sup.js index b063462862be69dbe3f1fe12314eeba90795b718..9b568fdce57bd9d8f4625e3b1fde45a3b51a2955 100644 --- a/www/emulab_sup.js +++ b/www/emulab_sup.js @@ -59,12 +59,10 @@ function GraphChange(which) { return false; } -function SetupOutputArea(id) { +function GetMaxHeight(id) { var Iframe = document.getElementById(id); - var IframeDoc = IframeDocument(id); - var winheight = 0; - var yoff = 0; + var yoff = 0; // This tells us the total height of the browser window. if (window.innerHeight) // all except Explorer @@ -80,19 +78,79 @@ function SetupOutputArea(id) { // Now get the Y offset of the outputframe. yoff = Iframe.offsetTop; + if (winheight != 0) { + // Now calculate how much room is left and make the iframe + // big enough to use most of the rest of the window. + if (yoff != 0) + winheight = winheight - (yoff + 175); + else + winheight = winheight * 0.7; + } + return winheight; +} + +function SetupOutputArea(id) { + var Iframe = document.getElementById(id); + var IframeDoc = IframeDocument(id); + var winheight = GetMaxHeight(id); + IframeDoc.open(); IframeDoc.write('
');
     IframeDoc.close();
 
-    if (winheight != 0)
+    Iframe.style.border = "2px solid";
+    Iframe.height       = winheight;
+    Iframe.width        = "100%";
+    Iframe.scrolling    = "auto";
+    Iframe.frameBorder  = "1";
+}
+
+function HideFrame(id) {
+    var Iframe    = document.getElementById(id);
+    var IframeDoc = IframeDocument(id);
+
+    Iframe.style.border = "0px none";
+    Iframe.frameBorder  = 0;
+    Iframe.height       = 0;
+    Iframe.width        = 0;
+    Iframe.scrolling    = "no";
+}
+
+function ShowDownLoader(id) {
+    var Iframe    = document.getElementById(id);
+    var IframeDoc = IframeDocument(id);
+
+    var winheight = 0;
+    var yoff = 0;
+
+    // This tells us the total height of the browser window.
+    if (window.innerHeight) // all except Explorer
+	winheight = window.innerHeight;
+    else if (document.documentElement &&
+	     document.documentElement.clientHeight)
+	// Explorer 6 Strict Mode
+	winheight = document.documentElement.clientHeight;
+    else if (document.body)
+	// other Explorers
+	winheight = document.body.clientHeight;
+
+    // Now get the Y offset of the outputframe.
+    yoff = Iframe.offsetTop;
+
+    if (winheight != 0) {
 	// Now calculate how much room is left and make the iframe
 	// big enough to use most of the rest of the window.
 	if (yoff != 0)
 	    winheight = winheight - (yoff + 175);
 	else
 	    winheight = winheight * 0.7;
-    
-    Iframe.height = winheight;
+    }
+
+    Iframe.style.border = "2px solid";
+    Iframe.height       = winheight;
+    Iframe.width        = "100%";
+    Iframe.scrolling    = "auto";
+    Iframe.frameBorder  = "1";
 }
 
 /* @return The innerHeight of the window. */
diff --git a/www/menu.php3 b/www/menu.php3
index a870856dee292402c5c16cdfa0d3db4dfaf7a03e..152a26c933bc80d7ca39fc38c136c45c1eb27e46 100644
--- a/www/menu.php3
+++ b/www/menu.php3
@@ -1114,7 +1114,6 @@ function STARTBUSY($msg) {
     echo "
\n"; echo "$msg ...
\n"; echo "This will take a few moments; please be patient.
\n"; - echo "
\n"; echo "". " Working ..."; echo "

\n"; diff --git a/www/mungelog.js b/www/mungelog.js index 470836c778ca73af88dd7e1dd65ca3b31bc09370..38576d396d1ce1d503d88e7d6cfae5228892b716 100644 --- a/www/mungelog.js +++ b/www/mungelog.js @@ -19,7 +19,7 @@ var lastLine = ""; // The last line of the download text. var getPNodeProgress = 0; var nextState = LOG_STATE_LOADING; // The state of the log download. -var docTriesLeft = 2; // Tries before giving up on getting the document. +var docTriesLeft = 5; // Tries before giving up on getting the document. var lastError = -2; var maxLineLength = 110; @@ -44,10 +44,15 @@ function GetPNodes_cb(data) { } /* Clear the various 'loading' indicators. */ -function ml_loadFinished() { +function ml_loadFinished(done) { clearInterval(upInterval); - ClearLoadingIndicators("
Done!
"); + if (done) { + ClearLoadingIndicators("
Done!
"); + } + else { + ClearLoadingIndicators(" "); + } nextState = LOG_STATE_LOADED; } @@ -166,6 +171,11 @@ function ml_handleReadyState(state) { var oa = idoc.getElementById('outputarea'); var dl = document.getElementById('downloader'); + if (docTriesLeft < 0) { + /* Already decided we were broken; just ignore */ + return; + } + if ((rt = ml_getBodyText(dl)) == null) { /* * Browsers that do not support DOMs for text/plain files or are a @@ -175,25 +185,26 @@ function ml_handleReadyState(state) { */ docTriesLeft -= 1; if (docTriesLeft < 0) { - /* Give up, turn off the spinner and */ - ml_loadFinished(); - - /* ... try to make the iframe visible. */ - dl.border = 1; - dl.width = "90%"; - - dl.height = 500; - - dl.style.width = "90%"; - dl.style.height = 500; - dl.style.border = 1; - } + /* Give up, turn off the spinner */ + ml_loadFinished(0); + + /* Hide the outputarea */ + HideFrame("outputframe"); + /* Make the downloader frame visible. */ + var winheight = GetMaxHeight('downloader'); + + dl.style.border = "2px solid"; + dl.height = winheight; + dl.width = "100%"; + dl.scrolling = "auto"; + dl.frameBorder = "1"; + } return; } if (state == LOG_STATE_LOADED) { - ml_loadFinished(); + ml_loadFinished(1); } if (state == LOG_STATE_LOADING || state == LOG_STATE_LOADED) { diff --git a/www/showlogfile_sup.php3 b/www/showlogfile_sup.php3 index c090a3ecc654b320d049999e32ff747c76503089..8f74bccf72897631dfa63e9a32bfbd663ac80e8c 100644 --- a/www/showlogfile_sup.php3 +++ b/www/showlogfile_sup.php3 @@ -93,43 +93,6 @@ function STARTLOG($pid, $eid) global $BASEPATH; STARTWATCHER($pid, $eid); - - echo "\n"; echo "
\n"; echo " @@ -147,16 +110,16 @@ function STARTLOG($pid, $eid) \n"; echo " + echo "
\n"; + border=0 frameborder=0> +
\n"; } # See if this request is to one of the above functions. Does not return