Loading main.py +1 −4 Changes for main.py: 1 added line, 4 removed lines. Original line number Diff line number Diff line Loading @@ -44,12 +44,9 @@ def webui_part_solver_status(): else: return abort(404) # @webui.route('/part/request/<request_id>') @webui.route('/part/request/<problem_name>') # def webui_part_request_status(request_id=None): def webui_part_request_status(problem_name=None): if (adc2019system.role is not None) and (adc2019system.role.type == 'host'): # request_status = adc2019system.role.get_request_status(float(request_id)) request_status = adc2019system.role.get_request_by_problem(problem_name) return render_template('part_request_status.html', status=request_status) else: Loading @@ -64,7 +61,7 @@ def webui_part_problem_status(name=None): if (adc2019system.role is not None) and (adc2019system.role.type == 'host'): problem = adc2019system.role.get_problem(name) workers = adc2019system.role.get_workers() solutions = reversed(sorted(problem.get_solutions().items(), key=lambda x:x[0])) solutions = reversed(sorted(problem.get_solutions().items(), key=lambda x:x[1].timestamp)) if problem is None: return abort(404) else: Loading roles/host.py +6 −3 Changes for roles/host.py: 6 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -354,6 +354,8 @@ class Request(object): self.solvers = solvers self.response = dict() for w in self.solvers: self.response[w] = list() @property def request_data(self): Loading @@ -370,7 +372,8 @@ class Request(object): def store_response(self, data): worker = data['worker'] self.response[worker] = data self.response[worker].append(data) # self.response[worker] = data def get_status(self): worker_count = 0 Loading Loading @@ -401,8 +404,8 @@ class Request(object): worker_status = dict() for v in self.solvers: if v in self.response: worker_status[v] = self.response[v]['status'] if v in self.response and len(self.response[v]) > 0: worker_status[v] = self.response[v][0]['status'] else: if self.worker_manager.workers[v].status == 'Not connected': worker_status[v] = 'Not connected' Loading static/js/adc2019.js +4 −32 Changes for static/js/adc2019.js: 4 added lines, 32 removed lines. Original line number Diff line number Diff line Loading @@ -63,10 +63,10 @@ class StatusView { } }).trigger('change'); // _this.solver_status_refresh_timer = setInterval((function _t(){ // _this.refresh_solver_status(); // return _t; // }()), 1000); _this.request_refresh_timer = setInterval((function _t(){ _this.get_request_status(); return _t; }()), 1000); }); } Loading Loading @@ -114,11 +114,6 @@ class StatusView { // _this.stop_solver(); // }); _this.request_refresh_timer = setInterval((function _t(){ // _this.get_request_status(request_id); _this.get_request_status(); return _t; }()), 1000); }); } Loading Loading @@ -174,22 +169,6 @@ class StatusView { }); } // get_request_status(request_id){ // var _this = this; // $.ajax({ // type: 'GET', // dataType: 'html', // url: '/part/request/' + request_id // }).done((d) => { // _this.container.find('#request-status-container').empty(); // _this.container.find('#request-status-container').html(d); // status = $(d).find('#request-status-value').text(); // if(status == 'done'){ // clearInterval(_this.request_refresh_timer); // } // }); // } get_request_status(){ var _this = this; $.ajax({ Loading @@ -199,13 +178,6 @@ class StatusView { }).done((d) => { _this.container.find('#request-table-container').empty(); _this.container.find('#request-table-container').html(d); // status = $(d).find('#request-status-value').text(); // if(status == 'done'){ // clearInterval(_this.request_refresh_timer); // } // _this.fire('refresh'); }); } Loading templates/part_problem_status.html +0 −20 Changes for templates/part_problem_status.html: 0 added lines, 20 removed lines. Original line number Diff line number Diff line Loading @@ -86,23 +86,3 @@ </div> </div> <div class="modal fade" id="solver-processing-modal" tabindex="-1" role="dialog" aria-labelledby="solver-processing-modal-title" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="solver-processing-modal-title">{{problem.name}}</h5> <!-- <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> --> </div> <div class="modal-body" id="request-status-container"> 処理中... </div> <div class="modal-footer"> <button type="button" class="btn btn-danger stop-button">Stop</button> <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button> </div> </div> </div> </div> Loading
main.py +1 −4 Changes for main.py: 1 added line, 4 removed lines. Original line number Diff line number Diff line Loading @@ -44,12 +44,9 @@ def webui_part_solver_status(): else: return abort(404) # @webui.route('/part/request/<request_id>') @webui.route('/part/request/<problem_name>') # def webui_part_request_status(request_id=None): def webui_part_request_status(problem_name=None): if (adc2019system.role is not None) and (adc2019system.role.type == 'host'): # request_status = adc2019system.role.get_request_status(float(request_id)) request_status = adc2019system.role.get_request_by_problem(problem_name) return render_template('part_request_status.html', status=request_status) else: Loading @@ -64,7 +61,7 @@ def webui_part_problem_status(name=None): if (adc2019system.role is not None) and (adc2019system.role.type == 'host'): problem = adc2019system.role.get_problem(name) workers = adc2019system.role.get_workers() solutions = reversed(sorted(problem.get_solutions().items(), key=lambda x:x[0])) solutions = reversed(sorted(problem.get_solutions().items(), key=lambda x:x[1].timestamp)) if problem is None: return abort(404) else: Loading
roles/host.py +6 −3 Changes for roles/host.py: 6 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -354,6 +354,8 @@ class Request(object): self.solvers = solvers self.response = dict() for w in self.solvers: self.response[w] = list() @property def request_data(self): Loading @@ -370,7 +372,8 @@ class Request(object): def store_response(self, data): worker = data['worker'] self.response[worker] = data self.response[worker].append(data) # self.response[worker] = data def get_status(self): worker_count = 0 Loading Loading @@ -401,8 +404,8 @@ class Request(object): worker_status = dict() for v in self.solvers: if v in self.response: worker_status[v] = self.response[v]['status'] if v in self.response and len(self.response[v]) > 0: worker_status[v] = self.response[v][0]['status'] else: if self.worker_manager.workers[v].status == 'Not connected': worker_status[v] = 'Not connected' Loading
static/js/adc2019.js +4 −32 Changes for static/js/adc2019.js: 4 added lines, 32 removed lines. Original line number Diff line number Diff line Loading @@ -63,10 +63,10 @@ class StatusView { } }).trigger('change'); // _this.solver_status_refresh_timer = setInterval((function _t(){ // _this.refresh_solver_status(); // return _t; // }()), 1000); _this.request_refresh_timer = setInterval((function _t(){ _this.get_request_status(); return _t; }()), 1000); }); } Loading Loading @@ -114,11 +114,6 @@ class StatusView { // _this.stop_solver(); // }); _this.request_refresh_timer = setInterval((function _t(){ // _this.get_request_status(request_id); _this.get_request_status(); return _t; }()), 1000); }); } Loading Loading @@ -174,22 +169,6 @@ class StatusView { }); } // get_request_status(request_id){ // var _this = this; // $.ajax({ // type: 'GET', // dataType: 'html', // url: '/part/request/' + request_id // }).done((d) => { // _this.container.find('#request-status-container').empty(); // _this.container.find('#request-status-container').html(d); // status = $(d).find('#request-status-value').text(); // if(status == 'done'){ // clearInterval(_this.request_refresh_timer); // } // }); // } get_request_status(){ var _this = this; $.ajax({ Loading @@ -199,13 +178,6 @@ class StatusView { }).done((d) => { _this.container.find('#request-table-container').empty(); _this.container.find('#request-table-container').html(d); // status = $(d).find('#request-status-value').text(); // if(status == 'done'){ // clearInterval(_this.request_refresh_timer); // } // _this.fire('refresh'); }); } Loading
templates/part_problem_status.html +0 −20 Changes for templates/part_problem_status.html: 0 added lines, 20 removed lines. Original line number Diff line number Diff line Loading @@ -86,23 +86,3 @@ </div> </div> <div class="modal fade" id="solver-processing-modal" tabindex="-1" role="dialog" aria-labelledby="solver-processing-modal-title" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="solver-processing-modal-title">{{problem.name}}</h5> <!-- <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> --> </div> <div class="modal-body" id="request-status-container"> 処理中... </div> <div class="modal-footer"> <button type="button" class="btn btn-danger stop-button">Stop</button> <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button> </div> </div> </div> </div>