Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit c324774

Browse files
gabrielbrionesalexjch
authored andcommitted
MCE view show only current year records
Signed-off-by: Gabriel Briones Sayeg <[email protected]>
1 parent f2b632b commit c324774

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

telemetryui/telemetryui/static/js/mce.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626

2727
var dataSet = [];
2828
var counter = 0
29-
for(var label in data){
29+
var weekList = Object.keys(data).sort(function(a, b) {return a - b;});
30+
for(var weekIndex in weekList){
31+
var label = weekList[weekIndex];
3032
dataSet.push({
3133
label: "Week "+label,
3234
backgroundColor: rootObj.backgroundColors[counter%14],

telemetryui/telemetryui/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def mce():
458458
"org.clearlinux/mce/SRAR",
459459
"org.clearlinux/mce/UCNA",
460460
]
461-
records = Record.filter_records(None, mce_classes, None).all()
461+
records = Record.filter_records(None, mce_classes, None, from_date="{}-01-01".format(datetime.datetime.now().year)).all()
462462
top10 = []
463463
maxcnt = 0
464464
by_machine_id = {}

0 commit comments

Comments
 (0)