Skip to content
Snippets Groups Projects
Commit 9cc1a721 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

highlight max value

parent 30587a93
No related branches found
No related tags found
3 merge requests!83Master,!82Master,!81Dev nico
...@@ -59,6 +59,16 @@ p.title { ...@@ -59,6 +59,16 @@ p.title {
font-size: 13pt; font-size: 13pt;
} }
.info {
background-color: #E0F8F8;
}
.max {
font-weight: bold;
color: darkgray;
background-color: lightgreen;
}
.form-signin { .form-signin {
width: 100%; width: 100%;
max-width: 330px; max-width: 330px;
......
...@@ -335,6 +335,25 @@ def human_readable(size_in_bytes): ...@@ -335,6 +335,25 @@ def human_readable(size_in_bytes):
return "0" return "0"
def highlight_value(values, value_to_highlight):
# find 'class' left of the value
pos_value = values.find(str(value_to_highlight))
# split up the values, left and right of the search area
part1 = values[:pos_value - 15]
part2 = values[pos_value:]
substring = values[pos_value - 15:pos_value]
if 'inactive' in substring:
new_substring = substring.replace('inactive', 'max')
else:
new_substring = substring.replace('active', 'max')
values = part1 + new_substring + part2
return values
def construct_tasks_per_workflow_html(request, workflow_results): def construct_tasks_per_workflow_html(request, workflow_results):
# --- Progress of tasks per active workflow --- # --- Progress of tasks per active workflow ---
...@@ -369,15 +388,19 @@ def construct_tasks_per_workflow_html(request, workflow_results): ...@@ -369,15 +388,19 @@ def construct_tasks_per_workflow_html(request, workflow_results):
values += "<td colspan='8'></td></tr><tr>" values += "<td colspan='8'></td></tr><tr>"
d = workflow_result['nr_of_tasks_per_status'] d = workflow_result['nr_of_tasks_per_status']
max = 0
for key in d: for key in d:
try: try:
percentage = round(int(d[key]) / int(workflow_result['nr_of_tasks']) * 100) percentage = round(int(d[key]) / int(workflow_result['nr_of_tasks']) * 100)
if (percentage > max) and (key in settings.ALL_STATUSSES):
max = percentage
except: except:
percentage = 0 percentage = 0
# distinguish active statusses # distinguish active statusses
style = "" style = "inactive"
if key in settings.ACTIVE_STATUSSES or key=='active': if key in settings.ACTIVE_STATUSSES or key=='active':
style = "active" style = "active"
...@@ -394,6 +417,9 @@ def construct_tasks_per_workflow_html(request, workflow_results): ...@@ -394,6 +417,9 @@ def construct_tasks_per_workflow_html(request, workflow_results):
# values += "<td>" + str(human_readable(workflow_result['size_processed'])) + " ("+ str(percentage) + "%) </td>" # values += "<td>" + str(human_readable(workflow_result['size_processed'])) + " ("+ str(percentage) + "%) </td>"
# values += "<td>" + str(workflow_result['total_processing_time']) + "</td>" # values += "<td>" + str(workflow_result['total_processing_time']) + "</td>"
if max>0:
values = highlight_value(values, max)
results_tasks += "</tr><tr>" + values + "</tr>" results_tasks += "</tr><tr>" + values + "</tr>"
results_tasks = "<tbody>" + results_tasks + "</tbody>" results_tasks = "<tbody>" + results_tasks + "</tbody>"
......
...@@ -60,9 +60,13 @@ p.title { ...@@ -60,9 +60,13 @@ p.title {
} }
.info { .info {
font-size: 13pt;
background-color: #E0F8F8; background-color: #E0F8F8;
} }
.max {
font-weight: bold;
color: green;
background-color: lightgreen;
}
.form-signin { .form-signin {
width: 100%; width: 100%;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment