Check if sys_info is null

pull/1412/head
Safia Abdalla 10 years ago
parent 3d176dd620
commit fb4cb19aa6

@ -8,19 +8,27 @@ require([
'use strict';
$('#notebook_about').click(function () {
// use underscore template to auto html escape
var text = 'You are using Jupyter notebook.<br/><br/>';
text = text + 'The version of the notebook server is ';
text = text + _.template('<b><%- version %></b>')({ version: sys_info.notebook_version });
if (sys_info.commit_hash) {
text = text + _.template('-<%- hash %>')({ hash: sys_info.commit_hash });
if (sys_info) {
var text = 'You are using Jupyter notebook.<br/><br/>';
text = text + 'The version of the notebook server is ';
text = text + _.template('<b><%- version %></b>')({ version: sys_info.notebook_version });
if (sys_info.commit_hash) {
text = text + _.template('-<%- hash %>')({ hash: sys_info.commit_hash });
}
text = text + _.template(' and is running on:<br/><pre>Python <%- pyver %></pre>')({
pyver: sys_info.sys_version });
var kinfo = $('<div/>').attr('id', '#about-kinfo').text('Waiting for kernel to be available...');
var body = $('<div/>');
body.append($('<h4/>').text('Server Information:'));
body.append($('<p/>').html(text));
body.append($('<h4/>').text('Current Kernel Information:'));
body.append(kinfo);
} else {
var text = 'Could not access sys_info variable for version information.';
var body = $('<div/>');
body.append($('<h4/>').text('Cannot find sys_info!'));
body.append($('<p/>').html(text));
}
text = text + _.template(' and is running on:<br/><pre>Python <%- pyver %></pre>')({ pyver: sys_info.sys_version });
var kinfo = $('<div/>').attr('id', '#about-kinfo').text('Waiting for kernel to be available...');
var body = $('<div/>');
body.append($('<h4/>').text('Server Information:'));
body.append($('<p/>').html(text));
body.append($('<h4/>').text('Current Kernel Information:'));
body.append(kinfo);
dialog.modal({
title: 'About Jupyter Notebook',
body: body,

Loading…
Cancel
Save