Commit d5286cc2 authored by Marc Duez's avatar Marc Duez

server/report.js : replace commandline with config command for file from...

server/report.js : replace commandline with config command for file from server (to avoid revealing server's informations)
parent 12adbfa6
......@@ -148,6 +148,9 @@ Report.prototype = {
var sinfo = this.container("Sample info ("+m.getStrTime(time)+")")
var left = $('<div/>', {class: 'flex'}).appendTo(sinfo);
var command = "unknow"
if (typeof m.samples.commandline != 'undefined')
command = m.samples.commandline[time]
var label = $('<div/>', {class: 'float-left'}).appendTo(left);
$('<div/>', {class: 'case label', text : "Filename:" }).appendTo(label);
......@@ -160,7 +163,7 @@ Report.prototype = {
$('<div/>', {class: 'case', text : m.samples.original_names[time]}).appendTo(value);
$('<div/>', {class: 'case', text : m.getSampleTime(time)}).appendTo(value);
$('<div/>', {class: 'case', text : ""}).appendTo(value);
$('<div/>', {class: 'case', text : ""}).appendTo(value);
$('<div/>', {class: 'case', text : command}).appendTo(value);
$('<div/>', {class: 'case', text : ""}).appendTo(value);
var note = $('<div/>', {class: 'float-left'}).appendTo(left);
......
......@@ -112,6 +112,7 @@ def get_data():
patient_name = vidjil_utils.anon(request.vars["patient"], auth.user_id)
config_name = db.config[request.vars["config"]].name
command = db.config[request.vars["config"]].command
data["patient_name"] = patient_name
data["config_name"] = config_name
......@@ -120,12 +121,14 @@ def get_data():
data["samples"]["original_names"] = []
data["samples"]["timestamp"] = []
data["samples"]["info"] = []
data["samples"]["commandline"] = []
## récupération des infos stockées sur la base de données
if sequence_file_list is not None:
sequence_file_list = sequence_file_list.split("_")
for i in range(len(sequence_file_list)-1):
row = db( db.sequence_file.id == int(sequence_file_list[i]) ).select().first()
data["samples"]["commandline"].append(command)
if row is not None:
data["samples"]["original_names"].append(row.filename)
data["samples"]["timestamp"].append(str(row.sampling_date))
......@@ -148,6 +151,7 @@ def get_data():
data["samples"]["original_names"].append(filename)
data["samples"]["timestamp"].append(str(row.sequence_file.sampling_date))
data["samples"]["info"].append(row.sequence_file.info)
data["samples"]["commandline"].append(command)
log.debug("get_data: %s -> %s" % (request.vars["patient"], fused_file))
return gluon.contrib.simplejson.dumps(data, separators=(',',':'))
......@@ -187,15 +191,18 @@ def get_custom_data():
data["samples"]["original_names"] = []
data["samples"]["timestamp"] = []
data["samples"]["info"] = []
data["samples"]["commandline"] = []
for id in request.vars["custom"] :
sequence_file_id = db.results_file[id].sequence_file_id
patient_id = db.sequence_file[sequence_file_id].patient_id
config_id = db.results_file[id].config_id
patient_name = vidjil_utils.anon(patient_id, auth.user_id)
filename = db.sequence_file[sequence_file_id].filename
data["samples"]["original_names"].append(patient_name + "_" + filename)
data["samples"]["timestamp"].append(str(db.sequence_file[sequence_file_id].sampling_date))
data["samples"]["info"].append(db.sequence_file[sequence_file_id].info)
data["samples"]["commandline"].append(db.config[config_id].command)
return gluon.contrib.simplejson.dumps(data, separators=(',',':'))
......
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