Commit a4c73f4e authored by Kento HASEGAWA's avatar Kento HASEGAWA

Improve UI

parent 491bda31
...@@ -40,7 +40,6 @@ def webui_parte_workers(): ...@@ -40,7 +40,6 @@ def webui_parte_workers():
def webui_part_request_status(request_id=None): def webui_part_request_status(request_id=None):
if (adc2019system.role is not None) and (adc2019system.role.type == 'host'): 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_status(float(request_id))
print(request_status)
return render_template('part_request_status.html', status=request_status) return render_template('part_request_status.html', status=request_status)
else: else:
return abort(404) return abort(404)
......
...@@ -189,7 +189,7 @@ class Worker(object): ...@@ -189,7 +189,7 @@ class Worker(object):
self.host = params['host'] self.host = params['host']
self.role = params['role'] self.role = params['role']
self.params = params self.params = params
self.status = 'Setting up' self.status = 'Ready'
self.configure() self.configure()
...@@ -220,7 +220,6 @@ class Request(object): ...@@ -220,7 +220,6 @@ class Request(object):
self.timeout = timeout self.timeout = timeout
self.request_id = time.time() self.request_id = time.time()
self.broadcast_time = None self.broadcast_time = None
self.response = dict() self.response = dict()
...@@ -267,11 +266,13 @@ class Request(object): ...@@ -267,11 +266,13 @@ class Request(object):
progress_time = (time.time() - self.broadcast_time) / self.timeout * 100 progress_time = (time.time() - self.broadcast_time) / self.timeout * 100
progress = min(100, max(progress_problem, progress_time)) progress = min(100, max(progress_problem, progress_time))
worker_list = self.worker_manager.get_workers().keys()
worker_status = dict() worker_status = dict()
for v in all_workers: for v in all_workers:
if v in self.response: if v in self.response:
worker_status[v] = self.response[v]['status'] worker_status[v] = self.response[v]['status']
else:
if self.worker_manager.workers[v].status == 'Not connected':
worker_status[v] = 'Not connected'
else: else:
worker_status[v] = 'Waiting for response' worker_status[v] = 'Waiting for response'
......
...@@ -129,7 +129,6 @@ class ADC2019BoardViewer { ...@@ -129,7 +129,6 @@ class ADC2019BoardViewer {
.attr("stroke", "#d00") .attr("stroke", "#d00")
.attr("stroke-width", 2); .attr("stroke-width", 2);
let colors = d3.schemeCategory10 let colors = d3.schemeCategory10
// Reference // Reference
...@@ -175,7 +174,7 @@ class ADC2019BoardViewer { ...@@ -175,7 +174,7 @@ class ADC2019BoardViewer {
var cellContainer = itemContainer.append('g') var cellContainer = itemContainer.append('g')
.attr('class', 'cellContainer') .attr('class', 'cellContainer')
.attr('data-color', (d, i) => colors[i]) .attr('data-color', (d, i) => colors[i % colors.length])
.attr('x', 0) .attr('x', 0)
.attr('y', 0) .attr('y', 0)
...@@ -240,7 +239,7 @@ class ADC2019BoardViewer { ...@@ -240,7 +239,7 @@ class ADC2019BoardViewer {
var lineContainer = lineItemContainer.append('g') var lineContainer = lineItemContainer.append('g')
.attr('class', 'lineContainer') .attr('class', 'lineContainer')
.attr('data-color', (d, i) => lineColors[i]); .attr('data-color', (d, i) => lineColors[i % lineColors.length]);
lineContainer.selectAll('g') lineContainer.selectAll('g')
.data((d) => d) .data((d) => d)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment