From 7050792f6785d57ddbc4dbf629ad6f5f4ea493c1 2013-10-17 21:07:51 From: Zachary Sailer Date: 2013-10-17 21:07:51 Subject: [PATCH] fixed shutdown button refresh on dashboard --- diff --git a/IPython/html/services/sessions/handlers.py b/IPython/html/services/sessions/handlers.py index 97022bb..8ca801c 100644 --- a/IPython/html/services/sessions/handlers.py +++ b/IPython/html/services/sessions/handlers.py @@ -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() #----------------------------------------------------------------------------- diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index 9622ec2..1810b3d 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -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