mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
ok, Running tab is working now
This commit is contained in:
parent
3b109de563
commit
cb1bb62272
@ -12,13 +12,35 @@
|
||||
var IPython = (function (IPython) {
|
||||
"use strict";
|
||||
|
||||
|
||||
var utils = IPython.utils;
|
||||
|
||||
var KernelList = function (selector, options) {
|
||||
IPython.NotebookList.call(this, selector, options);
|
||||
IPython.NotebookList.call(this, selector, options, 'running');
|
||||
};
|
||||
|
||||
KernelList.prototype = IPython.NotebookList.prototype;
|
||||
KernelList.prototype = Object.create(IPython.NotebookList.prototype);
|
||||
|
||||
KernelList.prototype.sessions_loaded = function (d) {
|
||||
// clear out the previous list
|
||||
this.clear_list();
|
||||
var len = d.length;
|
||||
var item;
|
||||
for (var i=0; i < d.length; i++) {
|
||||
var path = utils.url_path_join(d[i].notebook.path, d[i].notebook.name);
|
||||
var name = d[i].name;
|
||||
item = this.new_notebook_item(i);
|
||||
this.add_link(path, path, item);
|
||||
this.sessions[path] = d[i].id;
|
||||
this.add_shutdown_button(item,this.sessions[path]);
|
||||
}
|
||||
|
||||
if (len > 0) {
|
||||
$('#' + this.element_name + '_list_header').hide();
|
||||
} else {
|
||||
$('#' + this.element_name + '_list_header').show();
|
||||
}
|
||||
}
|
||||
|
||||
IPython.KernelList = KernelList;
|
||||
|
||||
return IPython;
|
||||
|
@ -24,7 +24,7 @@ $(document).ready(function () {
|
||||
};
|
||||
IPython.notebook_list = new IPython.NotebookList('#notebook_list', opts);
|
||||
IPython.cluster_list = new IPython.ClusterList('#cluster_list', opts);
|
||||
IPython.kernel_list = new IPython.KernelList('#kernel_list', opts);
|
||||
IPython.kernel_list = new IPython.KernelList('#running_list', opts);
|
||||
IPython.login_widget = new IPython.LoginWidget('#login_widget', opts);
|
||||
|
||||
var interval_id=0;
|
||||
@ -37,6 +37,7 @@ $(document).ready(function () {
|
||||
if($('.upload_button').length == 0)
|
||||
{
|
||||
IPython.notebook_list.load_sessions();
|
||||
IPython.kernel_list.load_sessions();
|
||||
IPython.cluster_list.load_list();
|
||||
}
|
||||
if (!interval_id){
|
||||
@ -44,6 +45,7 @@ $(document).ready(function () {
|
||||
if($('.upload_button').length == 0)
|
||||
{
|
||||
IPython.notebook_list.load_sessions();
|
||||
IPython.kernel_list.load_sessions();
|
||||
IPython.cluster_list.load_list();
|
||||
}
|
||||
}, time_refresh*1000);
|
||||
|
@ -14,7 +14,9 @@ var IPython = (function (IPython) {
|
||||
|
||||
var utils = IPython.utils;
|
||||
|
||||
var NotebookList = function (selector, options) {
|
||||
var NotebookList = function (selector, options, element_name) {
|
||||
// allow code re-use by just changing element_name in kernellist.js
|
||||
this.element_name = element_name || 'notebook';
|
||||
this.selector = selector;
|
||||
if (this.selector !== undefined) {
|
||||
this.element = $(selector);
|
||||
@ -28,10 +30,10 @@ var IPython = (function (IPython) {
|
||||
};
|
||||
|
||||
NotebookList.prototype.style = function () {
|
||||
$('#notebook_toolbar').addClass('list_toolbar');
|
||||
$('#' + this.element_name + '_toolbar').addClass('list_toolbar');
|
||||
$('#drag_info').addClass('toolbar_info');
|
||||
$('#notebook_buttons').addClass('toolbar_buttons');
|
||||
$('#notebook_list_header').addClass('list_header');
|
||||
$('#' + this.element_name + '_buttons').addClass('toolbar_buttons');
|
||||
$('#' + this.element_name + '_list_header').addClass('list_header');
|
||||
this.element.addClass("list_container");
|
||||
};
|
||||
|
||||
|
@ -70,14 +70,16 @@ data-base-kernel-url="{{base_kernel_url}}"
|
||||
</div>
|
||||
<div class="span4" class="clearfix">
|
||||
<span id="running_buttons" class="pull-right">
|
||||
<button id="refresh_running_list" title="Refresh cluster list" class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||
<button id="refresh_running_list" title="Refresh running list" class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="running_list">
|
||||
<div id="running_list_header" class="row-fluid list_header">
|
||||
</div>
|
||||
<div id="running_list_header" class="row-fluid list_header" style='display:none'>
|
||||
<div> There are no actively running kernels </div>
|
||||
<!-- damn it, I seem to need this stupid placeholder, otherwise items don't get added to the list -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user