diff --git a/IPython/frontend/html/notebook/clustermanager.py b/IPython/frontend/html/notebook/clustermanager.py index 4fc8626..a089b8e 100644 --- a/IPython/frontend/html/notebook/clustermanager.py +++ b/IPython/frontend/html/notebook/clustermanager.py @@ -77,6 +77,7 @@ class ClusterManager(LoggingConfigurable): 'launcher': launcher, 'n': n } + return self.profile_info(profile) def stop_cluster(self, profile): """Stop a cluster for a given profile.""" @@ -84,6 +85,7 @@ class ClusterManager(LoggingConfigurable): raise web.HTTPError(409, u'cluster not running') launcher = self.profiles.pop(profile)['launcher'] launcher.stop() + return self.profile_info(profile) def stop_all_clusters(self): for p in self.profiles.values(): diff --git a/IPython/frontend/html/notebook/handlers.py b/IPython/frontend/html/notebook/handlers.py index eb9e9cd..3a1a9a5 100644 --- a/IPython/frontend/html/notebook/handlers.py +++ b/IPython/frontend/html/notebook/handlers.py @@ -691,10 +691,10 @@ class ClusterActionHandler(AuthenticatedHandler): cm = self.application.cluster_manager if action == 'start': n = int(self.get_argument('n', default=4)) - cm.start_cluster(profile, n) + data = cm.start_cluster(profile, n) if action == 'stop': - cm.stop_cluster(profile) - self.finish() + data = cm.stop_cluster(profile) + self.finish(jsonapi.dumps(data)) #----------------------------------------------------------------------------- diff --git a/IPython/frontend/html/notebook/static/css/projectdashboard.css b/IPython/frontend/html/notebook/static/css/projectdashboard.css index 9c8dfe4..640fb84 100644 --- a/IPython/frontend/html/notebook/static/css/projectdashboard.css +++ b/IPython/frontend/html/notebook/static/css/projectdashboard.css @@ -38,6 +38,8 @@ padding: 3px 5px; } + + .list_item { height: 25px; line-height: 25px; @@ -48,6 +50,23 @@ text-decoration: none; } +.profile_col { +} + +.status_col { + float: right; + width: 325px; +} + +.engines_col { + float: right; + width: 325px; +} + +.action_col { + float: right; +} + .item_buttons { float: right; } diff --git a/IPython/frontend/html/notebook/static/js/clusterlist.js b/IPython/frontend/html/notebook/static/js/clusterlist.js index f8e38e3..2779d8d 100644 --- a/IPython/frontend/html/notebook/static/js/clusterlist.js +++ b/IPython/frontend/html/notebook/static/js/clusterlist.js @@ -24,7 +24,11 @@ var IPython = (function (IPython) { $('#cluster_toolbar').addClass('list_toolbar'); $('#cluster_list_info').addClass('toolbar_info'); $('#cluster_buttons').addClass('toolbar_buttons'); - $('div#cluster_header').addClass('list_header ui-widget ui-widget-header'); + $('div#cluster_header').addClass('list_header ui-widget ui-widget-header ui-helper-clearfix'); + $('div#cluster_header').children().eq(0).addClass('profile_col'); + $('div#cluster_header').children().eq(1).addClass('action_col'); + $('div#cluster_header').children().eq(2).addClass('engines_col'); + $('div#cluster_header').children().eq(3).addClass('status_col'); $('#refresh_cluster_list').button({ icons : {primary: 'ui-icon-arrowrefresh-1-s'}, text : false @@ -58,17 +62,13 @@ var IPython = (function (IPython) { } ClusterList.prototype.load_list_success = function (data, status, xhr) { - console.log(data); this.clear_list(); var len = data.length; for (var i=0; i'); - item_div.addClass('list_item ui-widget ui-widget-content ui-helper-clearfix'); - item_div.css('border-top-style','none'); var item = new ClusterItem(item_div); item.update_state(data[i]); item_div.data('item', item); - console.log('appending item', item); this.element.append(item_div); }; }; @@ -77,9 +77,15 @@ var IPython = (function (IPython) { var ClusterItem = function (element) { this.element = $(element); this.data = null; + this.style(); }; + ClusterItem.prototype.style = function () { + this.element.addClass('list_item ui-widget ui-widget-content ui-helper-clearfix'); + this.element.css('border-top-style','none'); + } + ClusterItem.prototype.update_state = function (data) { this.data = data; if (data.status === 'running') { @@ -92,29 +98,78 @@ var IPython = (function (IPython) { ClusterItem.prototype.state_stopped = function () { - var item_name = $('').addClass('item_name').text(this.data.profile); - var item_buttons = $('').addClass('item_buttons'); + var that = this; + this.element.empty(); + var profile_col = $('').addClass('profile_col').text(this.data.profile); + var status_col = $('').addClass('status_col').html('stopped'); + var engines_col = $('').addClass('engines_col'); + var label = $('