Skip to content

Commit

Permalink
refine table display; drop invalid from vega diagram (irrelevant)
Browse files Browse the repository at this point in the history
  • Loading branch information
dginev committed Apr 1, 2019
1 parent be2f791 commit a3248a5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 22 deletions.
5 changes: 5 additions & 0 deletions public/css/cortex.css
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,9 @@ input:checked + .slider:before {
table.history-report {
font-size: 12px;
margin-top: 125px;
}

span.history-footnote {
font-size: 12px;
text-align: left;
}
2 changes: 1 addition & 1 deletion src/backend/reports.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use diesel::dsl::sql;
use diesel::pg::PgConnection;
use diesel::*;
use std::collections::HashMap;
use regex::Regex;
use std::collections::HashMap;

use crate::helpers::TaskStatus;
use crate::models::{Corpus, Service, Task};
Expand Down
9 changes: 1 addition & 8 deletions src/models/historical_runs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,7 @@ impl RunMetadataStack {
let mut runs_meta_vega = Vec::new();
for run in runs_meta.iter() {
let total = run.field_f32("total");
for field in &[
"invalid",
"fatal",
"error",
"warning",
"no_problem",
"in_progress",
] {
for field in &["fatal", "error", "warning", "no_problem", "in_progress"] {
runs_meta_vega.push(RunMetadataStack {
severity: field.to_string(),
severity_numeric: TaskStatus::from_key(field).unwrap().raw(),
Expand Down
30 changes: 19 additions & 11 deletions templates/history.html.tera
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<table class="table table-striped history-report">
<thead>
<tr>
<th class="right">Total</th>
<th class="right">Invalid</th>
<th class="right">Fatal</th>
<th class="right">Error</th>
<th class="right">Warning</th>
<th class="right">No problem</th>
<th class="right">Warning</th>
<th class="right">Error</th>
<th class="right">Fatal</th>
<th class="right">In progress</th>
<th class="right">Total</th>
<th class="right">Invalid</th>
<th class="center">Start time</th>
<th class="center">End time</th>
<th class="left">Owner</th>
Expand All @@ -37,21 +37,29 @@
<tbody>
{% for run in history %}
<tr>
<td class="right">{{run.total}}</td>
<td class="right">{{run.invalid}}</td>
<td class="right">{{run.fatal}}</td>
<td class="right">{{run.error}}</td>
<td class="right">{{run.warning}}</td>
<td class="right">{{run.no_problem}}</td>
<td class="right">{{run.warning}}</td>
<td class="right">{{run.error}}</td>
<td class="right">{{run.fatal}}</td>
<td class="right">{{run.in_progress}}</td>
<td class="right">{{run.total}}</td>
<td class="right">{{run.invalid}}</td>
<td class="center">{{run.start_time}}</td>
<td class="center">{{run.end_time}}</td>
<td class="center">{% if run.end_time %} {{run.end_time}} {% else %} <em>ongoing</em> {% endif %}</td>
<td class="left">{{run.owner}}</td>
<td class="left">{{run.description}}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="text-left"">
<span class=" history-footnote">Note: <strong>invalid</strong> counts are not included in <strong>total</strong>,
and do not
play part in any ratios.</span><br>
<span class="history-footnote">Note: <strong>in_progress</strong> counts are included, and are non-zero when a
new rerun was started before the reported run was completed.
</span><br>
</div>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/vega-history.html.tera
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"color": {
"field": "severity", "type": "nominal",
"scale": {
"domain": ["invalid", "fatal", "error", "warning", "no_problem", "in_progress"],
"range": ["#D3D3D3", "#dc3545", "#FFA500", "#FFFACD", "#28a745", "#eaf7ff"]
"domain": ["fatal", "error", "warning", "no_problem", "in_progress"],
"range": ["#dc3545", "#FFA500", "#FFFACD", "#28a745", "#eaf7ff"]
}
},
"order": { "field": "severity_numeric", "type": "quantitative", "sort": "ascending" }
Expand Down

0 comments on commit a3248a5

Please sign in to comment.