Show More
@@ -173,6 +173,7 b' class NotebookWebApplication(web.Application):' | |||||
173 | mathjax_url=ipython_app.mathjax_url, |
|
173 | mathjax_url=ipython_app.mathjax_url, | |
174 | config=ipython_app.config, |
|
174 | config=ipython_app.config, | |
175 | jinja2_env=env, |
|
175 | jinja2_env=env, | |
|
176 | terminals_available=False, # Set later if terminals are available | |||
176 | ) |
|
177 | ) | |
177 |
|
178 | |||
178 | # allow custom overrides for the tornado web app. |
|
179 | # allow custom overrides for the tornado web app. | |
@@ -765,10 +766,9 b' class NotebookApp(BaseIPythonApplication):' | |||||
765 | try: |
|
766 | try: | |
766 | from .terminal import initialize |
|
767 | from .terminal import initialize | |
767 | initialize(self.web_app) |
|
768 | initialize(self.web_app) | |
768 | self.web_app.terminals_available = True |
|
769 | self.web_app.settings['terminals_available'] = True | |
769 | except ImportError as e: |
|
770 | except ImportError as e: | |
770 | self.log.info("Terminals not available (error was %s)", e) |
|
771 | self.log.info("Terminals not available (error was %s)", e) | |
771 | self.web_app.terminals_available = False |
|
|||
772 |
|
772 | |||
773 | def init_signal(self): |
|
773 | def init_signal(self): | |
774 | if not sys.platform.startswith('win'): |
|
774 | if not sys.platform.startswith('win'): |
@@ -46,7 +46,11 b' require([' | |||||
46 | kernel_list = new kernellist.KernelList('#running_list', $.extend({ |
|
46 | kernel_list = new kernellist.KernelList('#running_list', $.extend({ | |
47 | session_list: session_list}, |
|
47 | session_list: session_list}, | |
48 | common_options)); |
|
48 | common_options)); | |
49 | terminal_list = new terminallist.TerminalList('#terminal_list', common_options); |
|
49 | ||
|
50 | if (utils.get_body_data("terminalsAvailable") === "True") { | |||
|
51 | terminal_list = new terminallist.TerminalList('#terminal_list', common_options); | |||
|
52 | } | |||
|
53 | ||||
50 | login_widget = new loginwidget.LoginWidget('#login_widget', common_options); |
|
54 | login_widget = new loginwidget.LoginWidget('#login_widget', common_options); | |
51 |
|
55 | |||
52 | $('#new_notebook').click(function (e) { |
|
56 | $('#new_notebook').click(function (e) { |
@@ -12,6 +12,7 b'' | |||||
12 |
|
12 | |||
13 | data-base-url="{{base_url}}" |
|
13 | data-base-url="{{base_url}}" | |
14 | data-notebook-path="{{notebook_path}}" |
|
14 | data-notebook-path="{{notebook_path}}" | |
|
15 | data-terminals-available="{{terminals_available}}" | |||
15 |
|
16 | |||
16 | {% endblock %} |
|
17 | {% endblock %} | |
17 |
|
18 | |||
@@ -24,7 +25,9 b' data-notebook-path="{{notebook_path}}"' | |||||
24 | <ul id="tabs" class="nav nav-tabs"> |
|
25 | <ul id="tabs" class="nav nav-tabs"> | |
25 | <li class="active"><a href="#notebooks" data-toggle="tab">Notebooks</a></li> |
|
26 | <li class="active"><a href="#notebooks" data-toggle="tab">Notebooks</a></li> | |
26 | <li><a href="#running" data-toggle="tab">Running</a></li> |
|
27 | <li><a href="#running" data-toggle="tab">Running</a></li> | |
|
28 | {% if terminals_available %} | |||
27 | <li><a href="#terminals" data-toggle="tab">Terminals</a></li> |
|
29 | <li><a href="#terminals" data-toggle="tab">Terminals</a></li> | |
|
30 | {% endif %} | |||
28 | <li><a href="#clusters" data-toggle="tab">Clusters</a></li> |
|
31 | <li><a href="#clusters" data-toggle="tab">Clusters</a></li> | |
29 | </ul> |
|
32 | </ul> | |
30 |
|
33 | |||
@@ -80,7 +83,8 b' data-notebook-path="{{notebook_path}}"' | |||||
80 | </div> |
|
83 | </div> | |
81 | </div> |
|
84 | </div> | |
82 | </div> |
|
85 | </div> | |
83 |
|
86 | |||
|
87 | {% if terminals_available %} | |||
84 | <div id="terminals" class="tab-pane"> |
|
88 | <div id="terminals" class="tab-pane"> | |
85 |
|
89 | |||
86 | <div id="terminal_toolbar" class="row"> |
|
90 | <div id="terminal_toolbar" class="row"> | |
@@ -101,6 +105,7 b' data-notebook-path="{{notebook_path}}"' | |||||
101 | </div> |
|
105 | </div> | |
102 | </div> |
|
106 | </div> | |
103 | </div> |
|
107 | </div> | |
|
108 | {% endif %} | |||
104 |
|
109 | |||
105 | <div id="clusters" class="tab-pane"> |
|
110 | <div id="clusters" class="tab-pane"> | |
106 |
|
111 |
@@ -55,7 +55,8 b' class TreeHandler(IPythonHandler):' | |||||
55 | self.write(self.render_template('tree.html', |
|
55 | self.write(self.render_template('tree.html', | |
56 | page_title=page_title, |
|
56 | page_title=page_title, | |
57 | notebook_path=path, |
|
57 | notebook_path=path, | |
58 | breadcrumbs=breadcrumbs |
|
58 | breadcrumbs=breadcrumbs, | |
|
59 | terminals_available=self.settings['terminals_available'], | |||
59 | )) |
|
60 | )) | |
60 |
|
61 | |||
61 |
|
62 |
General Comments 0
You need to be logged in to leave comments.
Login now