Ignore:
Timestamp:
Dec 21, 2009, 1:11:26 AM (15 years ago)
Author:
broder
Message:

Add terminal page

Location:
package_branches/invirt-web/ajaxterm-rebased/code
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/ajaxterm-rebased/code/main.py

    r2737 r2751  
    3838
    3939from view import View, revertStandardError
     40import ajaxterm
    4041
    4142
     
    388389            else:
    389390                raise InvalidInput('back', back, 'Not a known back page.')
     391
     392        atmulti = ajaxterm.Multiplex()
     393        atsessions = {}
     394
     395        @cherrypy.expose
     396        @cherrypy.tools.mako(filename="/terminal.mako")
     397        def terminal(self, machine_id):
     398            machine = validation.Validate(cherrypy.request.login, cherrypy.request.state, machine_id=machine_id).machine
     399
     400            status = controls.statusInfo(machine)
     401            has_vnc = hasVnc(status)
     402
     403            d = dict(on=status,
     404                     has_vnc=has_vnc,
     405                     machine=machine,
     406                     hostname=cherrypy.request.local.name)
     407            return d
    390408
    391409    machine = MachineView()
  • package_branches/invirt-web/ajaxterm-rebased/code/static/ajaxterm/ajaxterm.css

    r2747 r2751  
    5959pre.term span.b7  { background-color: #bbb; }
    6060
    61 body { background-color: #888; }
    6261#term {
    6362        float: left;
  • package_branches/invirt-web/ajaxterm-rebased/code/templates/info.mako

    r2737 r2751  
    1818% if on:
    1919 % if not machine.type.hvm:
    20   Console access: type
     20  Console access: <a href="machine/${machine.machine_id}/terminal">Web Terminal</a> or type
    2121  <tt>ssh ${machine.name}@${config.console.hostname}</tt>
    2222  on Athena. <a href="https://xvm.scripts.mit.edu/wiki/SerialConsole">(more info)</a>
    2323 % elif has_vnc:
    24   <strong><a href="machine/${machine.machine_id}/vnc">Get Console</a></strong>
     24  <strong><a href="machine/${machine.machine_id}/vnc">Get Console</a> or <a href="machine/${machine.machine_id}/terminal">Web Terminal</a></strong>
    2525 % else:
    2626  VNC console not enabled; still booting?
  • package_branches/invirt-web/ajaxterm-rebased/code/templates/skeleton.mako

    r2750 r2751  
    6262<li><a href="machine/${machine.machine_id}">Info</a></li>
    6363<li><a href="machine/${machine.machine_id}/vnc">Console</a></li>
     64<li><a href="machine/${machine.machine_id}/terminal">Terminal</a></li>
    6465% endif
    6566<li><a href="help">Help</a></li>
Note: See TracChangeset for help on using the changeset viewer.