diff --git "a/ajaxterm/\\" "b/ajaxterm/\\" new file mode 100644 index 000000000..5dbd2e887 --- /dev/null +++ "b/ajaxterm/\\" @@ -0,0 +1,23 @@ +#!/usr/local/bin/perl +# Start the Ajaxterm webserver on a random port, then print an iframe for +# a URL that proxies to it + +BEGIN { push(@INC, ".."); }; +use WebminCore; +use Socket; +&init_config(); + +&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1); + +# Check for python +if (!&has_command("python")) { + &ui_print_endpage(&text('index_epython', "python")); + } + +# Pick a free port +&get_miniserv_config(\%miniserv); + +# Show the iframe + +&ui_print_footer("/", $text{'index'}); + diff --git a/ajaxterm/ajaxterm/ajaxterm.css b/ajaxterm/ajaxterm/ajaxterm.css index b9a5f8771..8042fb2a5 100644 --- a/ajaxterm/ajaxterm/ajaxterm.css +++ b/ajaxterm/ajaxterm/ajaxterm.css @@ -58,7 +58,7 @@ pre.term span.b5 { background-color: #b0b; } pre.term span.b6 { background-color: #0bb; } pre.term span.b7 { background-color: #bbb; } -body { background-color: #888; } +body { background-color: #ffffff; } #term { float: left; } diff --git a/ajaxterm/ajaxterm/qweb.pyc b/ajaxterm/ajaxterm/qweb.pyc new file mode 100644 index 000000000..5e1bf0907 Binary files /dev/null and b/ajaxterm/ajaxterm/qweb.pyc differ diff --git a/ajaxterm/config b/ajaxterm/config new file mode 100644 index 000000000..6091b45d2 --- /dev/null +++ b/ajaxterm/config @@ -0,0 +1 @@ +timeout=120 diff --git a/ajaxterm/config.info b/ajaxterm/config.info new file mode 100644 index 000000000..7472cef64 --- /dev/null +++ b/ajaxterm/config.info @@ -0,0 +1 @@ +timeout=Idle timeout before closing connection,0,5,,seconds diff --git a/ajaxterm/index.cgi b/ajaxterm/index.cgi index ee7d27ff9..11b5eac46 100755 --- a/ajaxterm/index.cgi +++ b/ajaxterm/index.cgi @@ -10,7 +10,8 @@ use Socket; &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1); # Check for python -if (!&has_command("python")) { +$python = &has_command("python"); +if (!$python) { &ui_print_endpage(&text('index_epython', "python")); } @@ -28,14 +29,24 @@ while(1) { close(TEST); # Run the Ajaxterm webserver -system("cd $module_root_directory/ajaxterm ; python ajaxterm.py --port $port --log >/tmp/ajaxterm.out 2>&1 /dev/null"); + #untie(*STDERR); open(STDERR, ">/dev/null"); + untie(*STDOUT); open(STDOUT, ">/tmp/ajaxterm.out"); + untie(*STDERR); open(STDERR, ">/tmp/ajaxterm.out"); + exec($python, "ajaxterm.py", "--port", $port, "--log"); + exit(1); + } # Wait for it to come up $try = 0; while(1) { my $err; &open_socket("localhost", $port, TEST2, \$err); - last if ($err); + last if (!$err); $try++; if ($try > 30) { &error(&text('index_estart', 30, $port)); @@ -45,8 +56,34 @@ while(1) { close(TEST2); # Show the iframe +print "