Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
3392d357
Commit
3392d357
authored
May 12, 2014
by
Jonathon Duerig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proper headers to fetchlogfile. Fix embedding for Firefox.
parent
bc7cca49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
+25
-10
www/fetchlogfile.php3
www/fetchlogfile.php3
+22
-0
www/showlogfile_sup.php3
www/showlogfile_sup.php3
+3
-10
No files found.
www/fetchlogfile.php3
View file @
3392d357
<?php
header
(
"Content-type: text/html; charset=utf-8"
);
header
(
"Last-Modified: "
.
gmdate
(
"D, d M Y H:i:s"
)
.
" GMT"
);
header
(
"Expires: Mon, 26 Jul 1997 05:00:00 GMT"
);
header
(
"Cache-Control: no-cache, must-revalidate"
);
header
(
"Pragma: no-cache"
);
?>
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
<script
src=
"apt/js/lib/jquery-2.0.3.min.js"
></script>
...
...
@@ -5,17 +14,29 @@
<script>
$
(
document
).
ready
(
function
()
{
var
lastIndex
=
0
;
// The url is the same as this one with 'spewlogfile.php3' instead of
// the current path.
var
url
=
window
.
location
.
protocol
+
'
//
'
+
window
.
location
.
host
+
'
/spewlogfile.php3
'
+
window
.
location
.
search
;
// Fetch spewlogfile via AJAX call
var
xhr
=
new
XMLHttpRequest
();
// Every time new data comes in or the state variable changes,
// this function is invoked.
xhr
.
onreadystatechange
=
function
()
{
// xhr.responseText contains all data received so far from spewlogfile
if
(
xhr
.
responseText
)
{
// Append only new text
var
newText
=
xhr
.
responseText
.
substr
(
lastIndex
);
lastIndex
=
xhr
.
responseText
.
length
;
// If the user is scrolled to the bottom, make sure they
// stay scrolled to the bottom after appending.
var
shouldScroll
=
(
document
.
body
.
scrollHeight
-
document
.
body
.
clientHeight
==
document
.
body
.
scrollTop
);
$
(
'
pre
'
).
append
(
_
.
escape
(
newText
));
if
(
shouldScroll
)
...
...
@@ -24,6 +45,7 @@
}
}
};
// Invoke the AJAX
xhr
.
open
(
'
get
'
,
url
,
true
);
xhr
.
send
();
});
...
...
www/showlogfile_sup.php3
View file @
3392d357
...
...
@@ -143,20 +143,13 @@ function STARTLOG($object)
"<script type='text/javascript' language='javascript'
src='mungelog.js'>
</script>
\n
"
;
echo
"<script type='text/javascript' language='javascript'>
\n
"
;
echo
"if (is_chrome == false && is_safari == false) {
SetupOutputArea('outputframe', true);
}
\n
"
;
echo
"</script><div>
<iframe id='downloader' name='downloader'
echo
"<iframe id='downloader' name='downloader'
class='downloader' src='
$url
'
onload='ml_handleReadyState(LOG_STATE_LOADED);'>
</iframe></div>
\n
"
;
echo
"<script type='text/javascript' language='javascript'>
\n
"
;
echo
"if (is_chrome || is_safari) {
HideFrame('outputframe');
ShowDownLoader('downloader');
}
\n
"
;
echo
" HideFrame('outputframe');
\n
"
;
echo
" ShowDownLoader('downloader');
\n
"
;
echo
"</script>"
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment