mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Basic infrastructure for terminal page
This commit is contained in:
parent
368763d4cd
commit
d211ebf067
@ -190,6 +190,7 @@ class NotebookWebApplication(web.Application):
|
|||||||
handlers.extend(load_handlers('notebook.handlers'))
|
handlers.extend(load_handlers('notebook.handlers'))
|
||||||
handlers.extend(load_handlers('nbconvert.handlers'))
|
handlers.extend(load_handlers('nbconvert.handlers'))
|
||||||
handlers.extend(load_handlers('kernelspecs.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.kernels.handlers'))
|
||||||
handlers.extend(load_handlers('services.contents.handlers'))
|
handlers.extend(load_handlers('services.contents.handlers'))
|
||||||
handlers.extend(load_handlers('services.clusters.handlers'))
|
handlers.extend(load_handlers('services.clusters.handlers'))
|
||||||
|
12
IPython/html/static/terminal/js/main.js
Normal file
12
IPython/html/static/terminal/js/main.js
Normal 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){
|
||||||
|
|
||||||
|
});
|
@ -29,6 +29,7 @@
|
|||||||
highlight: 'components/highlight.js/build/highlight.pack',
|
highlight: 'components/highlight.js/build/highlight.pack',
|
||||||
moment: "components/moment/moment",
|
moment: "components/moment/moment",
|
||||||
codemirror: 'components/codemirror',
|
codemirror: 'components/codemirror',
|
||||||
|
termjs: "components/term.js/src/term"
|
||||||
},
|
},
|
||||||
shim: {
|
shim: {
|
||||||
underscore: {
|
underscore: {
|
||||||
|
27
IPython/html/templates/terminal.html
Normal file
27
IPython/html/templates/terminal.html
Normal 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 %}
|
0
IPython/html/terminal/__init__.py
Normal file
0
IPython/html/terminal/__init__.py
Normal file
24
IPython/html/terminal/handlers.py
Normal file
24
IPython/html/terminal/handlers.py
Normal 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),
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user