Changeset 2432 for package_branches


Ignore:
Timestamp:
Aug 11, 2009, 12:54:08 AM (15 years ago)
Author:
quentin
Message:

Add terminal page

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

Legend:

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

    r2428 r2432  
    4747
    4848from view import View
     49import ajaxterm
    4950
    5051class InvirtWeb(View):
     
    278279            else:
    279280                raise InvalidInput('back', back, 'Not a known back page.')
     281
     282        atmulti = ajaxterm.Multiplex()
     283        atsessions = {}
     284
     285        @cherrypy.expose
     286        @cherrypy.tools.mako(filename="/terminal.mako")
     287        def terminal(self, machine_id):
     288            machine = validation.Validate(cherrypy.request.login, cherrypy.request.state, machine_id=machine_id).machine
     289
     290            status = controls.statusInfo(machine)
     291            has_vnc = hasVnc(status)
     292
     293            d = dict(on=status,
     294                     has_vnc=has_vnc,
     295                     machine=machine,
     296                     hostname=cherrypy.request.local.name)
     297            return d
    280298
    281299    machine = MachineView()
  • package_branches/invirt-web/cherrypy/code/static/ajaxterm/ajaxterm.css

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

    r2419 r2432  
    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/cherrypy/code/templates/skeleton.mako

    r2431 r2432  
    5858<li><a href="machine/${machine.machine_id}">Info</a></li>
    5959<li><a href="machine/${machine.machine_id}/vnc">Console</a></li>
     60<li><a href="machine/${machine.machine_id}/terminal">Terminal</a></li>
    6061% endif
    6162<li><a href="help">Help</a></li>
Note: See TracChangeset for help on using the changeset viewer.