##// END OF EJS Templates
Merge pull request #6554 from Carreau/itsallaboutme...
Min RK -
r18541:59eb81f4 merge
parent child Browse files
Show More
@@ -0,0 +1,38 b''
1 // Copyright (c) IPython Development Team.
2 // Distributed under the terms of the Modified BSD License.
3 require([
4 'jquery',
5 'base/js/dialog',
6 'underscore',
7 'base/js/namespace'
8 ], function ($, dialog, _, IPython) {
9 'use strict';
10 $('#notebook_about').click(function () {
11 // use underscore template to auto html escape
12 var text = 'You are using IPython notebook.<br/><br/>';
13 text = text + 'The version of the notebook server is ';
14 text = text + _.template('<b><%- version %></b>')({ version: sys_info.ipython_version });
15 if (sys_info.commit_hash) {
16 text = text + _.template('-<%- hash %>')({ hash: sys_info.commit_hash });
17 }
18 text = text + _.template(' and is running on:<br/><pre>Python <%- pyver %></pre>')({ pyver: sys_info.sys_version });
19 var kinfo = $('<div/>').attr('id', '#about-kinfo').text('Waiting for kernel to be available...');
20 var body = $('<div/>');
21 body.append($('<h4/>').text('Server Information:'));
22 body.append($('<p/>').html(text));
23 body.append($('<h4/>').text('Current Kernel Information:'));
24 body.append(kinfo);
25 dialog.modal({
26 title: 'About IPython Notebook',
27 body: body,
28 buttons: { 'OK': {} }
29 });
30 try {
31 IPython.notebook.session.kernel.kernel_info(function (data) {
32 kinfo.html($('<pre/>').text(data.content.banner));
33 });
34 } catch (e) {
35 kinfo.html($('<p/>').text('unable to contact kernel'));
36 }
37 });
38 });
@@ -25,6 +25,7 b' except ImportError:'
25 app_log = logging.getLogger()
25 app_log = logging.getLogger()
26
26
27 import IPython
27 import IPython
28 from IPython.utils.sysinfo import get_sys_info
28
29
29 from IPython.config import Application
30 from IPython.config import Application
30 from IPython.utils.path import filefind
31 from IPython.utils.path import filefind
@@ -36,6 +37,8 b' from IPython.html.utils import is_hidden, url_path_join, url_escape'
36 #-----------------------------------------------------------------------------
37 #-----------------------------------------------------------------------------
37 non_alphanum = re.compile(r'[^A-Za-z0-9]')
38 non_alphanum = re.compile(r'[^A-Za-z0-9]')
38
39
40 sys_info = json.dumps(get_sys_info())
41
39 class AuthenticatedHandler(web.RequestHandler):
42 class AuthenticatedHandler(web.RequestHandler):
40 """A RequestHandler with an authenticated user."""
43 """A RequestHandler with an authenticated user."""
41
44
@@ -221,6 +224,7 b' class IPythonHandler(AuthenticatedHandler):'
221 logged_in=self.logged_in,
224 logged_in=self.logged_in,
222 login_available=self.login_available,
225 login_available=self.login_available,
223 static_url=self.static_url,
226 static_url=self.static_url,
227 sys_info=sys_info
224 )
228 )
225
229
226 def get_json_body(self):
230 def get_json_body(self):
@@ -20,6 +20,7 b' require(['
20 'notebook/js/config',
20 'notebook/js/config',
21 'notebook/js/kernelselector',
21 'notebook/js/kernelselector',
22 'codemirror/lib/codemirror',
22 'codemirror/lib/codemirror',
23 'notebook/js/about',
23 // only loaded, not used, please keep sure this is loaded last
24 // only loaded, not used, please keep sure this is loaded last
24 'custom/custom'
25 'custom/custom'
25 ], function(
26 ], function(
@@ -41,6 +42,7 b' require(['
41 config,
42 config,
42 kernelselector,
43 kernelselector,
43 CodeMirror,
44 CodeMirror,
45 about,
44 // please keep sure that even if not used, this is loaded last
46 // please keep sure that even if not used, this is loaded last
45 custom
47 custom
46 ) {
48 ) {
@@ -259,7 +259,7 b' class="notebook_app"'
259 ("http://nbviewer.ipython.org/github/ipython/ipython/tree/2.x/examples/Index.ipynb", "Notebook Help", True),
259 ("http://nbviewer.ipython.org/github/ipython/ipython/tree/2.x/examples/Index.ipynb", "Notebook Help", True),
260 ),(
260 ),(
261 ("http://docs.python.org","Python",True),
261 ("http://docs.python.org","Python",True),
262 ("http://help.github.com/articles/github-flavored-markdown","Markdown",True),
262 ("http://help.github.com/articles/github-flavored-markdown","Markdown",True),
263 ("http://docs.scipy.org/doc/numpy/reference/","NumPy",True),
263 ("http://docs.scipy.org/doc/numpy/reference/","NumPy",True),
264 ("http://docs.scipy.org/doc/scipy/reference/","SciPy",True),
264 ("http://docs.scipy.org/doc/scipy/reference/","SciPy",True),
265 ("http://matplotlib.org/contents.html","Matplotlib",True),
265 ("http://matplotlib.org/contents.html","Matplotlib",True),
@@ -280,7 +280,8 b' class="notebook_app"'
280 <li class="divider"></li>
280 <li class="divider"></li>
281 {% endif %}
281 {% endif %}
282 {% endfor %}
282 {% endfor %}
283 </li>
283 <li class="divider"></li>
284 <li title="About IPython Notebook"><a id="notebook_about" href="#">About</a></li>
284 </ul>
285 </ul>
285 </li>
286 </li>
286 </ul>
287 </ul>
@@ -316,6 +317,9 b' class="notebook_app"'
316
317
317 {% block script %}
318 {% block script %}
318 {{super()}}
319 {{super()}}
320 <script type="text/javascript">
321 sys_info = {{sys_info}};
322 </script>
319
323
320 <script src="{{ static_url("components/text-encoding/lib/encoding.js") }}" charset="utf-8"></script>
324 <script src="{{ static_url("components/text-encoding/lib/encoding.js") }}" charset="utf-8"></script>
321
325
General Comments 0
You need to be logged in to leave comments. Login now