Changeset 14266 for misc/runpugs
- Timestamp:
- 10/12/06 02:11:11 (2 years ago)
- Location:
- misc/runpugs
- Files:
-
- 5 modified
-
cgi-bin/runpugs (modified) (2 diffs)
-
data/runpugs.html (modified) (1 diff)
-
htdocs/runpugs.css (modified) (2 diffs)
-
lib/WebTerminal/Server.pm (modified) (3 diffs)
-
lib/WebTerminal/Server/Terminal.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
misc/runpugs/cgi-bin/runpugs
r14233 r14266 84 84 my $ip=shift; 85 85 my $reply='pugs> '; 86 if ("$ip" ne "130.209.241.223") { 86 my $testing=$query->param('testing')||1; 87 if (not $testing) { 87 88 $reply = "Sorry, runpugs is not available at the moment."; 88 89 } else { … … 97 98 open(HTML,"<../data/runpugs.html"); 98 99 while(<HTML>) { 99 100 s/_TESTING_/$testing/; 100 101 /input.*name=\"sessionid\"/ && do {$html.='<input type="hidden" name="sessionid" value="'.$sessionid.'">'."\n";next }; 101 102 /(pugs\>\;\ \;)/ && do {$html.=$cmd.$reply;next}; -
misc/runpugs/data/runpugs.html
r14233 r14266 26 26 27 27 </head> 28 29 28 <body> 29 <!-- 30 <body onLoad="closing=true" onUnload="if (closing){alert(42); 31 window.open('feather.perl6.nl:8080/cgi-bin/runpugs?action=runpugs&sessionid='+document.terminal.sessionid.value+'&testing=1&cmd=pugs%3E%20%3Aq','newwin');}"> 32 --> 30 33 <div id="mainwindow"> 31 34 <h1>Run Perl6 now -- in your browser!</h1> 32 <form style="text-align: center" name="terminal" action="/cgi-bin/runpugs" method="POST"> 35 <p class="warning">Thank you for trying runpugs, a web terminal for pugs.<br> 36 * This is a test run, it might die unexpectedly!<br> 37 * pugs runs in safe mode<br> 38 * Unicode is not supported 39 </p> 40 <form style="text-align: center" id="term" name="terminal" action="/cgi-bin/runpugs" method="POST"> 33 41 42 <input type="hidden" name="testing" value="_TESTING_"> 34 43 <input type="hidden" name="sessionid" value=""> 35 44 <input type="hidden" name="action" value="runpugs"> -
misc/runpugs/htdocs/runpugs.css
r14202 r14266 1 BODY {width =100%;margin-left:10%;margin-right:10%; margin-top: 10px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; line-height: normal; background-color:#FFFFFF;}1 BODY {width:100%;margin-left:10%;margin-right:10%; margin-top: 10px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; line-height: normal; background-color:#FFFFFF;} 2 2 H1 {font-size: 24pt; 3 3 font-family: Georgia, Serif, Times; … … 10 10 LABEL {font-weight: bold; } 11 11 .copyright {font-size: 9pt} 12 .warning { 13 border: solid 2px #204a87; 14 padding: 5px; 15 } 12 16 #mainwindow { 13 17 width: 750px -
misc/runpugs/lib/WebTerminal/Server.pm
r14233 r14266 47 47 delete $terminals{$id}; 48 48 delete $lastcalled{$id}; 49 $sessions_per_ip{$ip}--; 49 50 } 50 51 if ($lines=~/Aborted/s) { 51 52 delete $terminals{$id}; 52 53 delete $lastcalled{$id}; 54 $sessions_per_ip{$ip}--; 53 55 } 54 56 return $lines; … … 102 104 } elsif (defined $pid) { 103 105 # child here 104 while (getppid()) { 105 sleep 600; 106 kill 'USR1',getppid(); 106 while (getppid()>10) { # a bit ad-hoc. 107 sleep 300; 108 print getppid(),"\n"; 109 kill 'USR1',getppid(); 107 110 } 108 111 } elsif ($! == EAGAIN) { … … 120 123 my $then=$lastcalled{$id}; 121 124 if ($now-$then>600) { 125 if(exists $terminals{$id}) { 122 126 $terminals{$id}->write(':q'); 123 127 delete $terminals{$id}; 128 } 129 if (exists $lastcalled{$id}) { 124 130 delete $lastcalled{$id}; 131 } 125 132 } 126 133 } -
misc/runpugs/lib/WebTerminal/Server/Terminal.pm
r14233 r14266 60 60 # print "L:",$line,":",$msg; 61 61 if($msg=~/timed/) { 62 $lline="pugs> Aborted!\n"; 62 $msg=''; 63 $pugs->errmsg([]); 64 $lline="pugs> Sorry, that took too long! Aborted.\n"; 63 65 $ps='pugs'; 64 66 last;
