Basic infrastructure for terminal page

This commit is contained in:
Thomas Kluyver 2014-09-29 17:59:54 -07:00
parent 368763d4cd
commit d211ebf067
6 changed files with 65 additions and 0 deletions

View File

@ -190,6 +190,7 @@ class NotebookWebApplication(web.Application):
handlers.extend(load_handlers('notebook.handlers'))
handlers.extend(load_handlers('nbconvert.handlers'))
handlers.extend(load_handlers('kernelspecs.handlers'))
handlers.extend(load_handlers('terminal.handlers'))
handlers.extend(load_handlers('services.kernels.handlers'))
handlers.extend(load_handlers('services.contents.handlers'))
handlers.extend(load_handlers('services.clusters.handlers'))

View File

@ -0,0 +1,12 @@
// Copyright (c) IPython Development Team.
// Distributed under the terms of the Modified BSD License.
require([
'jquery',
'termjs',
'custom/custom',
], function(
$,
termjs){
});

View File

@ -29,6 +29,7 @@
highlight: 'components/highlight.js/build/highlight.pack',
moment: "components/moment/moment",
codemirror: 'components/codemirror',
termjs: "components/term.js/src/term"
},
shim: {
underscore: {

View File

@ -0,0 +1,27 @@
{% extends "page.html" %}
{% block title %}{{page_title}}{% endblock %}
{% block params %}
data-base-url="{{base_url}}"
{% endblock %}
{% block site %}
<div id="ipython-main-app" class="container">
<div id="terminado-container"/>
</div>
{% endblock %}
{% block script %}
{{super()}}
<script src="{{ static_url("terminal/js/main.js") }}" type="text/javascript" charset="utf-8"></script>
{% endblock %}

View File

View File

@ -0,0 +1,24 @@
"""Tornado handlers for the terminal emulator."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from tornado import web
from ..base.handlers import IPythonHandler
class TerminalHandler(IPythonHandler):
"""Render the tree view, listing notebooks, clusters, etc."""
@web.authenticated
def get(self, path='', name=None):
self.write(self.render_template('terminal.html'))
#-----------------------------------------------------------------------------
# URL to handler mappings
#-----------------------------------------------------------------------------
default_handlers = [
(r"/terminal", TerminalHandler),
]