Commit 5add8727 authored by Marc Duez's avatar Marc Duez
Browse files
parents d896ca33 31a5bd1b
......@@ -49,7 +49,7 @@ def monitor():
last_results = last_results)
def log():
def showlog():
if auth.has_membership("admin"):
......
......@@ -94,8 +94,8 @@ def init_from_csv():
try:
db.import_from_csv_file(open(defs.DB_BACKUP_FILE, 'rb'), null='')
db.scheduler_task.truncate()
db.scheduler_run.truncate()
# db.scheduler_task.truncate()
# db.scheduler_run.truncate()
except Exception as e:
res = {"success": "false", "message": "!" + str(e)}
log.error(res)
......
......@@ -269,7 +269,7 @@ def index():
db.patient.id, db.patient.last_name, db.patient.first_name
)
for i, row in enumerate(query5) :
if row.patient.id in keys :
if row.id in keys :
result[row.id]['name'] = row.last_name + " " + row.first_name
......
......@@ -3,6 +3,9 @@
import defs
from gluon import current
# AUTODELETE should be set to False before any maintenance operation on the DB
AUTODELETE = True
#########################################################################
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
......@@ -89,8 +92,6 @@ use_janrain(auth, filename='private/janrain.key')
## >>> for row in rows: print row.id, row.myfield
#########################################################################
autodelete = True
db.define_table('patient',
Field('first_name','string'),
Field('last_name','string'),
......@@ -120,7 +121,7 @@ db.define_table('sequence_file',
Field('provider','reference auth_user'),
Field('data_file', 'upload',
uploadfolder=defs.DIR_SEQUENCES,
length=4294967295, autodelete=autodelete))
length=4294967295, autodelete=AUTODELETE))
......@@ -130,7 +131,7 @@ db.define_table('standard_file',
Field('info','text'),
Field('data_file', 'upload',
uploadfolder=defs.DIR_SEQUENCES,
autodelete=autodelete, length=4294967295))
autodelete=AUTODELETE, length=4294967295))
......@@ -149,7 +150,7 @@ db.define_table('results_file',
Field('scheduler_task_id', 'integer'),
Field('data_file', 'upload',
uploadfolder=defs.DIR_RESULTS,
length=4294967295, autodelete=autodelete))
length=4294967295, autodelete=AUTODELETE))
db.define_table('fused_file',
Field('patient_id', 'reference patient'),
......@@ -159,7 +160,7 @@ db.define_table('fused_file',
Field('sequence_file_list', 'string'),
Field('fused_file', 'upload',
uploadfolder=defs.DIR_RESULTS,
length=4294967295, autodelete=autodelete))
length=4294967295, autodelete=AUTODELETE))
db.define_table('analysis_file',
Field('patient_id', 'reference patient'),
......@@ -168,8 +169,7 @@ db.define_table('analysis_file',
Field('status', 'string'),
Field('analysis_file', 'upload',
uploadfolder=defs.DIR_RESULTS,
length=4294967295, autodelete=autodelete))
length=4294967295, autodelete=AUTODELETE))
## after defining tables, uncomment below to enable auditing
......
......@@ -92,7 +92,7 @@ def log_links(s):
>>> log_links("abcdef")
'abcdef'
>>> log_links("[1234]abcdef")
'[<a class="loglink pointer" onclick="db.call(\\'admin/log\\', {\\'file\\': \\'../..//mnt/result/tmp/out-001234/001234.vidjil.log\\', \\'format\\': \\'raw\\'})">1234</a>]abcdef'
'[<a class="loglink pointer" onclick="db.call(\\'admin/showlog\\', {\\'file\\': \\'../..//mnt/result/tmp/out-001234/001234.vidjil.log\\', \\'format\\': \\'raw\\'})">1234</a>]abcdef'
>>> log_links("abcdef(234)")
'abcdef(<a class="loglink pointer" onclick="db.call(\\'patient/info\\', {\\'id\\': \\'234\\'})">234</a>)'
>>> log_links("abcdef(234)abcdef c11")
......@@ -128,7 +128,7 @@ def log_links(s):
end -= 1
if task:
call = "admin/log"
call = "admin/showlog"
args = {'file': '../../' + defs.DIR_OUT_VIDJIL_ID % task + defs.BASENAME_OUT_VIDJIL_ID % task + '.vidjil.log', 'format': 'raw'}
(start, end) = m_task.span()
start += 1
......
......@@ -16,13 +16,13 @@
<hr>
</br>Vidjil server:
<a class="button" onclick="db.call('admin/log', {'file' : 'vidjil.log', 'format': 'vidjil'} );">vidjil.log</a>
<a class="button" onclick="db.call('admin/log', {'file' : 'vidjil-debug.log', 'format': 'vidjil'} );">debug.log</a>
<a class="button" onclick="db.call('admin/showlog', {'file' : 'vidjil.log', 'format': 'vidjil'} );">vidjil.log</a>
<a class="button" onclick="db.call('admin/showlog', {'file' : 'vidjil-debug.log', 'format': 'vidjil'} );">debug.log</a>
<a class="button" href="/admin/default/errors/vidjil">web2py tickets</a>
</br>Ngnix:
<a class="button" onclick="db.call('admin/log', {'file' : '../log/nginx/access.log'} );">access.log</a>
<a class="button" onclick="db.call('admin/log', {'file' : '../log/nginx/error.log'} );">error.log</a>
<a class="button" onclick="db.call('admin/showlog', {'file' : '../log/nginx/access.log'} );">access.log</a>
<a class="button" onclick="db.call('admin/showlog', {'file' : '../log/nginx/error.log'} );">error.log</a>
......
......@@ -15,7 +15,7 @@
<div class="db_block_left">
search
<input id="db_filter_input" type="text" value="{{=request.vars["filter"]}}"
onchange="db.call('admin/log', {'file' : '{{=request.vars["file"]}}', 'filter' : this.value, 'format': '{{=request.vars["format"]}}' } )" >
onchange="db.call('admin/showlog', {'file' : '{{=request.vars["file"]}}', 'filter' : this.value, 'format': '{{=request.vars["format"]}}' } )" >
</div>
</div>
......
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