Skip to content

Commit

Permalink
Display kernel type ID alongside display name
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Oct 26, 2018
1 parent ae15888 commit ddcc3dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions notebook/static/notebook/js/kernelselector.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ define([
.click( function () {
that.set_kernel(ks.name);
})
.text(ks.spec.display_name)
.text(ks.spec.display_name + " (" + ks.name + ")")
)
);
// Create the File > New Notebook submenu
Expand All @@ -86,7 +86,7 @@ define([
.click( function () {
that.new_notebook(ks.name);
})
.text(ks.spec.display_name)
.text(ks.spec.display_name + " (" + ks.name + ")")
)
);

Expand Down Expand Up @@ -262,13 +262,17 @@ define([
}
names.map(function (name) {
var ks = that.kernelspecs[name];
var display_txt = ks.name;
if (ks.spec.display_name) {
display_txt = ks.spec.display_name + " (" + ks.name + ")"
}
select.append(
$('<option/>').attr('value', ks.name).text(ks.spec.display_name || ks.name)
$('<option/>').attr('value', ks.name).text(display_txt)
);
});

var no_kernel_msg = i18n.msg.sprintf(i18n.msg._("Could not find a kernel matching %s. Please select a kernel:"),
(data.selected.display_name || data.selected.name))
(data.selected.display_name || data.selected.name));
var body = $("<form>").addClass("form-inline").append(
$("<span>").text(no_kernel_msg)
).append(select);
Expand Down
2 changes: 1 addition & 1 deletion notebook/static/tree/js/newnotebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ define([
$('<a>')
.attr('href', '#')
.click($.proxy(this.new_notebook, this, ks.name))
.text(ks.spec.display_name)
.text(ks.spec.display_name + " (" + ks.name + ")")
.attr('title', i18n.sprintf(i18n._('Create a new notebook with %s'), ks.spec.display_name))
);
menu.after(li);
Expand Down

0 comments on commit ddcc3dd

Please sign in to comment.