Commit b8620087 authored by HERBERT Ryan's avatar HERBERT Ryan

Analysis Report log

Added patient/run log to the monitor report
parent b251ff0c
......@@ -56,6 +56,7 @@ Report.prototype = {
.addGraph()
.readsStat()
.cloneList()
.sampleLog()
self.m.resize()
self.m.resume()
......@@ -565,6 +566,31 @@ Report.prototype = {
}
return clone
},
sampleLog: function() {
var log = this.container("Report Log")
var table = $('<table/>', {'class': 'log-table flex'}).appendTo(log);
for (var i=0; i < this.m["logs"].length; i++ ){
line = this.logLine(m["logs"][i]);
if(i % 2 == 0)
line.addClass('even');
else
line.addClass('odd');
line.appendTo(table);
}
return this
},
logLine: function(log_line) {
var line = $('<tr/>', {'class': 'log-row'});
console.log(log_line)
console.log(log_line["message"])
$('<td/>', {'class': 'log-date', 'text': log_line['created']}).appendTo(line);
$('<td/>', {'class': 'log-message', 'text': log_line['message']}).appendTo(line);
return line;
}
}
......
......@@ -241,6 +241,14 @@
text-align: center;
width: 50px;
}
.log-date{
width: 150px;
opacity: 0.8;
padding-right: 10px;
}
.odd{
background-color: #ddd;
}
</style>
<!-- graph style-->
......
......@@ -249,9 +249,11 @@ def get_data():
run_name = ""
config_name = db.config[request.vars["config"]].name
command = db.config[request.vars["config"]].command
log_reference_id = request.vars["sample_set_id"]
if (sample_set.sample_type == "patient") :
for row in db( db.patient.sample_set_id == request.vars["sample_set_id"] ).select() :
log_reference_id = row.id
patient_name = vidjil_utils.anon_ids(row.id)
data["dataFileName"] = patient_name + " (" + config_name + ")"
data["info"] = db.patient[row.id].info
......@@ -260,12 +262,21 @@ def get_data():
if (sample_set.sample_type == "run") :
for row in db( db.run.sample_set_id == request.vars["sample_set_id"] ).select() :
log_reference_id = row.id
run_name = db.run[row.id].name
data["dataFileName"] = run_name + " (" + config_name + ")"
data["info"] = db.run[row.id].info
data["run_id"] = row.id
data["run_name"] = run_name
log_query = db( ( db.user_log.record_id == log_reference_id )
& ( db.user_log.table_name == sample_set.sample_type )
).select(db.user_log.ALL, orderby=db.user_log.created)
data["logs"] = []
for row in log_query:
data["logs"].append({'message': row.msg, 'created': str(row.created)})
## récupération des infos stockées sur la base de données
query = db( ( db.sample_set.id == request.vars["sample_set_id"] )
& ( db.sample_set.id == db.sample_set_membership.sample_set_id )
......
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