Changeset 2753
- Timestamp:
- Dec 21, 2009, 1:11:35 AM (15 years ago)
- Location:
- package_branches/invirt-web/ajaxterm-rebased/code
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/ajaxterm-rebased/code/ajaxterm.py
r2749 r2753 321 321 def dumplatin1(self): 322 322 return self.dump().translate(self.trl1) 323 def dumphtml(self,color=1 ):323 def dumphtml(self,color=1,force=False): 324 324 h=self.height 325 325 w=self.width … … 344 344 span+='\n' 345 345 r='<?xml version="1.0" encoding="ISO-8859-1"?><pre class="term">%s</pre>'%r 346 if self.last_html==r :346 if self.last_html==r and not force: 347 347 return '<?xml version="1.0"?><idem></idem>' 348 348 else: … … 437 437 except (IOError,OSError): 438 438 self.proc_kill(fd) 439 def dump(self,fd,color=1 ):439 def dump(self,fd,color=1,force=False): 440 440 try: 441 return self.proc[fd]['term'].dumphtml(color )441 return self.proc[fd]['term'].dumphtml(color, force) 442 442 except KeyError: 443 443 return False -
package_branches/invirt-web/ajaxterm-rebased/code/main.py
r2752 r2753 408 408 409 409 @cherrypy.expose 410 def at(self, machine_id, k=None, c=0 ):410 def at(self, machine_id, k=None, c=0, force=0): 411 411 machine = validation.Validate(cherrypy.request.login, cherrypy.request.state, machine_id=machine_id).machine 412 412 if machine_id in self.atsessions: … … 420 420 self.atmulti.proc_write(term,k) 421 421 time.sleep(0.002) 422 dump=self.atmulti.dump(term,c )422 dump=self.atmulti.dump(term,c,int(force)) 423 423 cherrypy.response.headers['Content-Type']='text/xml' 424 424 if isinstance(dump,str): 425 425 return dump 426 426 else: 427 print "Removing session for", machine_id 427 428 del self.atsessions[machine_id] 428 429 return '<?xml version="1.0"?><idem></idem>' -
package_branches/invirt-web/ajaxterm-rebased/code/static/ajaxterm/ajaxterm.js
r2752 r2753 13 13 var sending=0; 14 14 var rmax=1; 15 var force=true; 15 16 16 17 var div=document.getElementById(id); … … 103 104 } 104 105 var query=query1+send; 106 if (force) { 107 query=query+"&force=1"; 108 force=false; 109 } 105 110 if(opt_get.className=='on') { 106 111 r.open("GET",base_path+"?"+query,true); … … 270 275 document.onkeypress=keypress; 271 276 document.onkeydown=keydown; 277 force=true; 272 278 timeout=window.setTimeout(update,100); 273 279 }
Note: See TracChangeset
for help on using the changeset viewer.