- cleanup

- use localtime for my setup
- add favicon link to the Haiku website
- fix address displayed for vnc when used through NAT.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29767 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2009-03-28 21:11:09 +00:00
parent 50c9917f8f
commit d2bef01cc4
+36 -33
View File
@@ -41,6 +41,9 @@ define("QEMU_BIN", QEMU_BASE . "/bin/qemu");
define("QEMU_KEYMAPS", QEMU_BASE . "/share/qemu/keymaps"); define("QEMU_KEYMAPS", QEMU_BASE . "/share/qemu/keymaps");
// default arguments: no network, emulate tablet, readonly image file. // default arguments: no network, emulate tablet, readonly image file.
define("QEMU_ARGS", "" define("QEMU_ARGS", ""
."-daemonize " /* detach from stdin */
."-localtime " /* not UTC */
."-name 'Haiku Online Demo' "
."-monitor /dev/null " ."-monitor /dev/null "
."-serial none " ."-serial none "
."-parallel none " ."-parallel none "
@@ -48,6 +51,7 @@ define("QEMU_ARGS", ""
."-usbdevice wacom-tablet " ."-usbdevice wacom-tablet "
."-vga vmware " ."-vga vmware "
."-snapshot"); ."-snapshot");
// absolute path to the image. // absolute path to the image.
define("QEMU_IMAGE_PATH","/home/revol/haiku/trunk/generated.x86/haiku.image"); define("QEMU_IMAGE_PATH","/home/revol/haiku/trunk/generated.x86/haiku.image");
// qemu 0.8.2 needs "", qemu 0.9.1 needs ":" // qemu 0.8.2 needs "", qemu 0.9.1 needs ":"
@@ -92,6 +96,7 @@ session_start();
<head> <head>
<meta name="robots" content="noindex, nofollow, noarchive"> <meta name="robots" content="noindex, nofollow, noarchive">
<title>Haiku Online Demo</title> <title>Haiku Online Demo</title>
<link rel="shortcut icon" href="http://www.haiku-os.org/themes/shijin/favicon.ico" type="image/x-icon" />
<style type="text/css"> <style type="text/css">
<!-- <!--
/* basic style */ /* basic style */
@@ -206,7 +211,7 @@ function vnc_port()
function vnc_addr_display() function vnc_addr_display()
{ {
return $_SERVER['SERVER_ADDR'] . ":" . vnc_display(); return $_SERVER['HTTP_HOST'] . ":" . vnc_display();
} }
function vnc_url() function vnc_url()
@@ -292,11 +297,10 @@ function output_options_form()
$idx = qemu_slot(); $idx = qemu_slot();
echo "<form method=\"get\" action=\"" . $_SERVER['PHP_SELF'] . "\">"; echo "<form method=\"get\" action=\"" . $_SERVER['PHP_SELF'] . "\">";
echo "<table border=\"0\" class=\"haiku_online_form\">\n"; echo "<table border=\"0\" class=\"haiku_online_form\">\n";
echo "<tr>\n";
echo "<td align=\"right\">\n"; echo "<tr>\n<td align=\"right\">\n";
echo "Select your keymap:"; echo "Select your keymap:";
echo "</td>\n"; echo "</td>\n<td>\n";
echo "<td>\n";
echo "<select name=\"keymap\">"; echo "<select name=\"keymap\">";
$keymaps = list_keymaps(); $keymaps = list_keymaps();
foreach ($keymaps as $keymap) { foreach ($keymaps as $keymap) {
@@ -309,8 +313,7 @@ function output_options_form()
//echo "</option>"; //echo "</option>";
} }
echo "</select>"; echo "</select>";
echo "</td>\n"; echo "</td>\n</tr>\n";
echo "</tr>\n";
$modes = array("1024x768"/*, "800x600"*/); $modes = array("1024x768"/*, "800x600"*/);
echo "<tr "; echo "<tr ";
@@ -319,8 +322,7 @@ function output_options_form()
echo ">\n"; echo ">\n";
echo "<td align=\"right\">\n"; echo "<td align=\"right\">\n";
echo "Select display size:"; echo "Select display size:";
echo "</td>\n"; echo "</td>\n<td>\n";
echo "<td>\n";
echo "<select name=\"videomode\" "; echo "<select name=\"videomode\" ";
if (count($modes) < 2) if (count($modes) < 2)
echo "disabled"; echo "disabled";
@@ -333,41 +335,42 @@ function output_options_form()
echo ">$mode</option>"; echo ">$mode</option>";
} }
echo "</select>"; echo "</select>";
echo "</td>\n</tr>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr "; echo "<tr ";
if (!$enable_sound) if (!$enable_sound)
echo "class=\"haiku_online_disabled\""; echo "class=\"haiku_online_disabled\"";
echo ">\n"; echo ">\n";
echo "<td align=\"right\">\n"; echo "<td align=\"right\">\n";
echo "Click here to enable sound:"; echo "Check to enable sound:";
echo "</td>\n"; echo "</td>\n<td>\n";
echo "<td>\n"; echo "<input type=\"checkbox\" name=\"sound\" id=\"sound_cb\"";
echo "<input type=\"checkbox\" name=\"sound\" ";
echo "value=\"1\" disabled "; echo "value=\"1\" disabled ";
if ($enable_sound) if ($enable_sound)
echo "checked "; echo "checked ";
echo ">Sound</input>"; echo "><a onClick=\"o=window.document.getElementById('sound_cb');o.checked = !o.checked;\"";
echo "</td>\n"; echo ">Sound</a></input>";
echo "</tr>\n"; echo "</td>\n</tr>\n";
echo "<tr>\n";
echo "<td align=\"right\">\n"; /*
echo "<tr>\n<td align=\"right\">\n";
//out("Click here to enable sound:"); //out("Click here to enable sound:");
echo "</td>\n"; echo "</td>\n<td>\n";
echo "<td>\n"; echo "</td>\n</tr>\n";
echo "</td>\n";
echo "</tr>\n"; echo "<tr>\n<td align=\"right\">\n";
echo "<tr>\n"; //out("Click here to enable sound:");
echo "<td align=\"right\">\n"; echo "</td>\n<td>\n";
echo "</td>\n</tr>\n";
*/
echo "<tr>\n<td align=\"right\">\n";
echo "Click here to start the session:"; echo "Click here to start the session:";
echo "</td>\n"; echo "</td>\n<td>\n";
echo "<td>\n";
echo "<input type=\"submit\" name=\"run\" "; echo "<input type=\"submit\" name=\"run\" ";
echo "value=\"Start!\" />"; echo "value=\"Start!\" />";
echo "</td>\n"; echo "</td>\n</tr>\n";
echo "</tr>\n";
echo "</table>\n"; echo "</table>\n";
echo "</form>\n"; echo "</form>\n";
out("NOTE: You will need a Java-enabled browser to display the VNC Applet needed by this demo."); out("NOTE: You will need a Java-enabled browser to display the VNC Applet needed by this demo.");
@@ -471,6 +474,7 @@ function output_vnc_info()
"or enter <tt>" . vnc_addr_display() . "</tt> in your " . "or enter <tt>" . vnc_addr_display() . "</tt> in your " .
"<a href=\"http://fr.wikipedia.org/wiki/Virtual_Network_Computing\"" . "<a href=\"http://fr.wikipedia.org/wiki/Virtual_Network_Computing\"" .
">VNC viewer</a>.<br />"); ">VNC viewer</a>.<br />");
echo "<br />\n";
} }
function output_applet_code() function output_applet_code()
@@ -544,13 +548,12 @@ if (is_my_session_valid()) {
if ($qemuidx >= 0 && !$do_kill) { if ($qemuidx >= 0 && !$do_kill) {
output_kill_form(); output_kill_form();
output_vnc_info(); output_vnc_info();
echo "<br />\n";
output_applet_code(); output_applet_code();
} else { } else {
output_options_form(); output_options_form();
} }
//phpinfo();
?> ?>