Skip to content

Commit 60afa3f

Browse files
authored
Merge pull request #298 from flask-dashboard/issues_257_and_295
fixed the sorting of the columns containing error counts
2 parents 9821f8f + 30c6e90 commit 60afa3f

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

flask_monitoringdashboard/static/css/custom.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,3 +501,10 @@ footer.sticky-footer {
501501

502502
.greenText {color:green;}
503503
.redText {color:red;}
504+
505+
.table_cell_with_error_count:after {
506+
content:attr(error-count);
507+
color: red;
508+
vertical-align: super;
509+
font-size: small;
510+
}

flask_monitoringdashboard/static/pages/overview.html

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,33 @@
4444
<tbody>
4545
<tr ng-repeat="row in table" style="cursor: pointer"
4646
ng-click="go('/endpoint/' + row.id + '/hourly_load')">
47+
4748
<td style="background-color: {{ row.color }}"></td>
4849
<td style="max-width: 200px;">{{ row.name }}</td>
4950

50-
<td ng-show="isHits" style="text-align: right;">
51+
52+
<td class="table_cell_with_error_count"
53+
ng-show="isHits"
54+
style="text-align: right;"
55+
ng-attr-error-count="{{ (row['hits-today-errors'] > 0) ? row['hits-today-errors'] : ''}}">
5156
{{ row['hits-today'] | number }}
52-
<span ng-show="row['hits-today-errors'] > 0"
53-
style="color: red">({{ row['hits-today-errors'] }})</span>
5457
</td>
55-
<td ng-show="isHits" style="text-align: right;">
56-
{{ row['hits-week'] | number }}
57-
<span ng-show="row['hits-week-errors'] > 0"
58-
style="color: red">({{ row['hits-week-errors'] }})</span>
5958

59+
60+
<td class="table_cell_with_error_count"
61+
ng-show="isHits" style="text-align: right;"
62+
ng-attr-error-count="{{ (row['hits-week-errors'] > 0) ? row['hits-week-errors'] : ''}}">
63+
{{ row['hits-week'] | number }}
6064
</td>
65+
6166
<td ng-show="isHits" style="text-align: right;">
6267
{{ row['hits-overall'] | number }}
6368
</td>
6469

6570
<td ng-show="isHits==false" style="text-align: right;">{{ row['median-today'] | duration_ms }}</td>
6671
<td ng-show="isHits==false" style="text-align: right;">{{ row['median-week'] | duration_ms }}</td>
67-
<td ng-show="isHits==false" style="text-align: right;">{{ row['median-overall'] | duration_ms }}</td>
72+
<td ng-show="isHits==false"
73+
style="text-align: right;">{{ row['median-overall'] | duration_ms }}</td>
6874
<td style="text-align: center;">{{ row['last-accessed'] | dateDifference }}</td>
6975
<td ng-click="$event.stopPropagation()">
7076
<monitorlevel name="row.name" value="row.monitor"></monitorlevel>

0 commit comments

Comments
 (0)