mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
fixed shutdown button refresh on dashboard
This commit is contained in:
parent
d41544865a
commit
e4a7b724a6
@ -77,7 +77,7 @@ class SessionHandler(IPythonHandler):
|
||||
kernel = km.kernel_model(kernel_id, self.ws_url)
|
||||
sm.delete_mapping_for_session(session_id)
|
||||
model = sm.session_model(session_id, notebook_name, path, kernel)
|
||||
return model
|
||||
self.finish(jsonapi.dumps(model))
|
||||
|
||||
@web.authenticated
|
||||
def delete(self, session_id):
|
||||
@ -87,6 +87,8 @@ class SessionHandler(IPythonHandler):
|
||||
kernel_id = sm.get_kernel_from_session(session_id)
|
||||
km.shutdown_kernel(kernel_id)
|
||||
sm.delete_mapping_for_session(session_id)
|
||||
self.set_status(204)
|
||||
self.finish()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
@ -103,12 +103,14 @@ var IPython = (function (IPython) {
|
||||
};
|
||||
|
||||
NotebookList.prototype.load_sessions = function(){
|
||||
console.log("DID IT MAKE IT?");
|
||||
var that = this;
|
||||
var settings = {
|
||||
processData : false,
|
||||
cache : false,
|
||||
type : "GET",
|
||||
dataType : "json",
|
||||
success : $.proxy(this.sessions_loaded, this)
|
||||
success : $.proxy(that.sessions_loaded, this)
|
||||
};
|
||||
var url = this.baseProjectUrl() + 'api/sessions';
|
||||
$.ajax(url,settings);
|
||||
@ -116,7 +118,7 @@ var IPython = (function (IPython) {
|
||||
|
||||
|
||||
NotebookList.prototype.sessions_loaded = function(data){
|
||||
this.sessions=new Object();
|
||||
this.sessions = new Object();
|
||||
var len = data.length;
|
||||
if (len != 0) {
|
||||
for (var i=0; i<len; i++) {
|
||||
@ -238,7 +240,7 @@ var IPython = (function (IPython) {
|
||||
cache : false,
|
||||
type : "DELETE",
|
||||
dataType : "json",
|
||||
success : function (data, status, xhr) {
|
||||
success : function () {
|
||||
that.load_sessions();
|
||||
}
|
||||
};
|
||||
@ -278,12 +280,7 @@ var IPython = (function (IPython) {
|
||||
parent_item.remove();
|
||||
}
|
||||
};
|
||||
if (notebooklist.notebookPath() == "") {
|
||||
var url = notebooklist.baseProjectUrl() + 'api/notebooks/' + nbname +'.ipynb';
|
||||
}
|
||||
else {
|
||||
var url = notebooklist.baseProjectUrl() + 'api/notebooks/' + notebooklist.notebookPath() + nbname + '.ipynb';
|
||||
}
|
||||
var url = notebooklist.baseProjectUrl() + 'api/notebooks/' + notebooklist.notebookPath() + nbname + '.ipynb';
|
||||
$.ajax(url, settings);
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user