Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50654 views
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
});
39
40