wok-current rev 2303
Ajaxterm: set blue theme
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Feb 24 17:25:13 2009 +0000 (2009-02-24) |
parents | 8a251dbc2bed |
children | 165dfdf5e37e |
files | ajaxterm/receipt ajaxterm/stuff/usr/share/ajaxterm/ajaxterm.css ajaxterm/stuff/usr/share/ajaxterm/ajaxterm.js ajaxterm/stuff/usr/share/ajaxterm/login |
line diff
1.1 --- a/ajaxterm/receipt Tue Feb 24 11:01:55 2009 +0000 1.2 +++ b/ajaxterm/receipt Tue Feb 24 17:25:13 2009 +0000 1.3 @@ -23,7 +23,7 @@ 1.4 post_install() 1.5 { 1.6 grep ^RUN_DAEMONS $1/etc/rcS.conf | grep -q "ajaxterm" || sed -i \ 1.7 - 's/RUN_DAEMONS="slim/RUN_DAEMONS="slim ajaxterm/' $1/etc/rcS.conf 1.8 + 's/RUN_DAEMONS="/RUN_DAEMONS="ajaxterm /' $1/etc/rcS.conf 1.9 # Configure lighttpd server 1.10 if [ -f $1/usr/lib/lighttpd/mod_proxy.so ]; then 1.11 #https://www.dupnet.org/dotclear/index.php/2007/10/07/11-ajaxterm-et-lighttpd
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/ajaxterm/stuff/usr/share/ajaxterm/ajaxterm.css Tue Feb 24 17:25:13 2009 +0000 2.3 @@ -0,0 +1,61 @@ 2.4 +pre.stat { 2.5 + margin: 0px; 2.6 + padding: 4px; 2.7 + display: block; 2.8 + font-family: monospace; 2.9 + font-weight: bold; 2.10 + white-space: pre; 2.11 + background-color: #00d; 2.12 + border-top: 1px solid #88d; 2.13 + color: white; 2.14 +} 2.15 +pre.stat span { 2.16 + padding: 0px; 2.17 +} 2.18 +pre.stat .on { 2.19 + background-color: #080; 2.20 + cursor: pointer; 2.21 +} 2.22 +pre.stat .off { 2.23 + background-color: #48e; 2.24 + cursor: pointer; 2.25 +} 2.26 +pre.term { 2.27 + margin: 0px; 2.28 + padding: 4px; 2.29 + display: block; 2.30 + font-family: monospace; 2.31 + white-space: pre; 2.32 + background-color: black; 2.33 + border-top: 1px solid white; 2.34 + color: #fff; 2.35 +} 2.36 +pre.term span.f0 { color: #000; } 2.37 +pre.term span.f1 { color: #b00; } 2.38 +pre.term span.f2 { color: #0b0; } 2.39 +pre.term span.f3 { color: #bb0; } 2.40 +pre.term span.f4 { color: #00b; } 2.41 +pre.term span.f5 { color: #b0b; } 2.42 +pre.term span.f6 { color: #0bb; } 2.43 +pre.term span.f7 { color: #bbb; } 2.44 +pre.term span.f8 { color: #666; } 2.45 +pre.term span.f9 { color: #f00; } 2.46 +pre.term span.f10 { color: #0f0; } 2.47 +pre.term span.f11 { color: #ff0; } 2.48 +pre.term span.f12 { color: #00f; } 2.49 +pre.term span.f13 { color: #f0f; } 2.50 +pre.term span.f14 { color: #0ff; } 2.51 +pre.term span.f15 { color: #fff; } 2.52 +pre.term span.b0 { background-color: #000; } 2.53 +pre.term span.b1 { background-color: #b00; } 2.54 +pre.term span.b2 { background-color: #0b0; } 2.55 +pre.term span.b3 { background-color: #bb0; } 2.56 +pre.term span.b4 { background-color: #00b; } 2.57 +pre.term span.b5 { background-color: #b0b; } 2.58 +pre.term span.b6 { background-color: #0bb; } 2.59 +pre.term span.b7 { background-color: #bbb; } 2.60 + 2.61 +body { background-color: #ccc; } 2.62 +#term { 2.63 + float: left; 2.64 +}
3.1 --- a/ajaxterm/stuff/usr/share/ajaxterm/ajaxterm.js Tue Feb 24 11:01:55 2009 +0000 3.2 +++ b/ajaxterm/stuff/usr/share/ajaxterm/ajaxterm.js Tue Feb 24 17:25:13 2009 +0000 3.3 @@ -12,13 +12,13 @@ 3.4 var keybuf=[]; 3.5 var sending=0; 3.6 var rmax=1; 3.7 - var popupargs='width='+(25+(width*7))+ 3.8 - ',height='+(45+(height*14))+',scrollbars=no'; 3.9 + var popupargs='width='+(80+(width*7))+',height='+(70+(height*14))+ 3.10 + ',scrollbars=no,location=no,menubar=no,status=no,toolbar=no'; 3.11 var debugmsg=0; 3.12 + var closed=0; 3.13 3.14 var div=document.getElementById(id); 3.15 var dstat=document.createElement('pre'); 3.16 - var sled=document.createElement('span'); 3.17 var opt_get=document.createElement('a'); 3.18 var opt_color=document.createElement('a'); 3.19 var opt_paste=document.createElement('a'); 3.20 @@ -28,11 +28,10 @@ 3.21 var dterm=document.createElement('div'); 3.22 3.23 function debug(s) { 3.24 - debugmsg=1; 3.25 + debugmsg=(new Date).getTime(); 3.26 sdebug.innerHTML=s; 3.27 } 3.28 function error() { 3.29 - sled.className='off'; 3.30 // debug("Connection lost timeout ts:"+((new Date).getTime())); 3.31 debug("Connection lost "+((new Date).toTimeString())); 3.32 } 3.33 @@ -102,14 +101,16 @@ 3.34 window.open(''+self.location,'',popupargs); 3.35 } 3.36 function do_close(event) { 3.37 + closed=1; 3.38 + debug('Disconnected'); 3.39 window.close(); 3.40 } 3.41 function update() { 3.42 // debug("ts: "+((new Date).getTime())+" rmax:"+rmax); 3.43 + if(debugmsg+5000 < (new Date).getTime()) debugmsg=0; 3.44 if(debugmsg==0) sdebug.innerHTML=(new Date).toString(); 3.45 if(sending==0) { 3.46 sending=1; 3.47 - sled.className='on'; 3.48 var r=new XMLHttpRequest(); 3.49 var send=""; 3.50 while(keybuf.length>0) { 3.51 @@ -146,18 +147,21 @@ 3.52 rmax=2000; 3.53 } 3.54 sending=0; 3.55 - sled.className='off'; 3.56 - timeout=window.setTimeout(update,rmax); 3.57 + if (closed==0) { 3.58 + timeout=window.setTimeout(update,rmax); 3.59 + } 3.60 } else { 3.61 debug("Connection error status:"+r.status); 3.62 } 3.63 } 3.64 } 3.65 - error_timeout=window.setTimeout(error,5000); 3.66 - if(opt_get.className=='on') { 3.67 - r.send(null); 3.68 - } else { 3.69 - r.send(query); 3.70 + if (closed==0) { 3.71 + error_timeout=window.setTimeout(error,5000); 3.72 + if(opt_get.className=='on') { 3.73 + r.send(null); 3.74 + } else { 3.75 + r.send(query); 3.76 + } 3.77 } 3.78 } 3.79 } 3.80 @@ -165,7 +169,9 @@ 3.81 keybuf.unshift(s); 3.82 if(sending==0) { 3.83 window.clearTimeout(timeout); 3.84 - timeout=window.setTimeout(update,1); 3.85 + if (closed==0) { 3.86 + timeout=window.setTimeout(update,1); 3.87 + } 3.88 } 3.89 } 3.90 function keypress(ev) { 3.91 @@ -260,9 +266,6 @@ 3.92 } 3.93 } 3.94 function init() { 3.95 - sled.appendChild(document.createTextNode('\xb7')); 3.96 - sled.className='off'; 3.97 - dstat.appendChild(sled); 3.98 dstat.appendChild(document.createTextNode(' ')); 3.99 opt_add(opt_color,'Colors'); 3.100 opt_color.className='on';
4.1 --- a/ajaxterm/stuff/usr/share/ajaxterm/login Tue Feb 24 11:01:55 2009 +0000 4.2 +++ b/ajaxterm/stuff/usr/share/ajaxterm/login Tue Feb 24 17:25:13 2009 +0000 4.3 @@ -2,12 +2,15 @@ 4.4 4.5 server="" 4.6 if [ -x /usr/bin/ssh ]; then 4.7 - echo -n "Server: " 4.8 + echo -n "SSH server: " 4.9 read -t 300 server || exit 1 4.10 fi 4.11 [ -n "$server" ] || exec /bin/login 4.12 case "$server" in 4.13 -*@*);; *) echo -n "$server login: "; read user; server="$user@$server";; 4.14 +*@*) ;; 4.15 +*) echo -n "$server login: " 4.16 + read -t 30 user || exit 1 4.17 + server="$user@$server";; 4.18 esac 4.19 sshargs="-oPreferredAuthentications=keyboard-interactive,password -oNoHostAuthenticationForLocalhost=yes -oLogLevel=FATAL -F/dev/null"; 4.20 [ -L /usr/bin/ssh ] && sshargs=""