Loading static/js/adc2019.js +8 −10 Changes for static/js/adc2019.js: 8 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ class StatusView { show: true }); _this.container.find('#solver-processing-modal').on('hidden.bs.modal', function(e){ clearInterval(_this.request_refresh_timer); _this.show_problem(); _this.fire('refresh'); }) Loading @@ -73,7 +74,10 @@ class StatusView { _this.stop_solver(); }); _this.get_request_status(request_id, timeout); _this.request_refresh_timer = setInterval((function _t(){ _this.get_request_status(request_id); return _t; }()), 1000); }); } Loading @@ -86,8 +90,7 @@ class StatusView { dataType: "json", url: "/api/stop", }).done((d) => { _this.request_refresh_timer = 'stopped'; alert(d); alert('Stopped'); }); } Loading @@ -108,7 +111,7 @@ class StatusView { }); } get_request_status(request_id, timeout){ get_request_status(request_id){ var _this = this; $.ajax({ type: 'GET', Loading @@ -119,13 +122,8 @@ class StatusView { _this.container.find('#request-status-container').html(d); status = $(d).find('#request-status-value').text(); // console.log(status); if(status == 'done'){ _this.request_refresh_timer = null; }else if(_this.request_refresh_timer == 'stopped'){ _this.request_refresh_timer = null; }else{ _this.request_refresh_timer = setTimeout(_this.get_request_status(request_id, timeout), 1000); clearInterval(_this.request_refresh_timer); } }); } Loading Loading
static/js/adc2019.js +8 −10 Changes for static/js/adc2019.js: 8 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ class StatusView { show: true }); _this.container.find('#solver-processing-modal').on('hidden.bs.modal', function(e){ clearInterval(_this.request_refresh_timer); _this.show_problem(); _this.fire('refresh'); }) Loading @@ -73,7 +74,10 @@ class StatusView { _this.stop_solver(); }); _this.get_request_status(request_id, timeout); _this.request_refresh_timer = setInterval((function _t(){ _this.get_request_status(request_id); return _t; }()), 1000); }); } Loading @@ -86,8 +90,7 @@ class StatusView { dataType: "json", url: "/api/stop", }).done((d) => { _this.request_refresh_timer = 'stopped'; alert(d); alert('Stopped'); }); } Loading @@ -108,7 +111,7 @@ class StatusView { }); } get_request_status(request_id, timeout){ get_request_status(request_id){ var _this = this; $.ajax({ type: 'GET', Loading @@ -119,13 +122,8 @@ class StatusView { _this.container.find('#request-status-container').html(d); status = $(d).find('#request-status-value').text(); // console.log(status); if(status == 'done'){ _this.request_refresh_timer = null; }else if(_this.request_refresh_timer == 'stopped'){ _this.request_refresh_timer = null; }else{ _this.request_refresh_timer = setTimeout(_this.get_request_status(request_id, timeout), 1000); clearInterval(_this.request_refresh_timer); } }); } Loading