Commit 3d131d83 authored by Marc Duez's avatar Marc Duez

server : admin panel

parent 8176ebc2
# coding: utf8
import gluon.contrib.simplejson
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
## return admin_panel
def index():
return dict(message=T(''))
def result():
return dict(message=T(''))
def run_all():
query = db(
(db.data_file.sequence_file_id==db.sequence_file.id)
& (db.data_file.config_id==db.config.id)
).select()
for row in query:
schedule_run(row.sequence_file.id, row.config.id)
res = {"success" : "true",
"message" : "rerun all"}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
{{extend 'db_layout.html'}}
Bientot vous trouverez içi un magnifique panneau d'administration, en attendant voila un lapin.</br>
<img src="http://upload.wikimedia.org/wikipedia/commons/3/3b/Rabbit_in_montana.jpg" style="width:200px; height:200px;">
</br>
<a class="button" onclick="db.call('admin/result');">liste des fichiers result (data)</a>
{{extend 'db_layout.html'}}
{{
query = db(
(db.data_file.sequence_file_id==db.sequence_file.id)
& (db.sequence_file.patient_id==db.patient.id)
& (db.data_file.config_id==db.config.id)
).select()
}}
<div>
<h3>Hi</h3>
<div id="db_table_container">
<table class="db_table" id="table">
<thead>
<tr>
<td class="column1">file_name</td>
<td class="column2">config</td>
<td> </td>
<td class="column1">patient</td>
<td class="column2">producer</td>
<td class="column2">last process</td>
<td class="column2">status</td>
</tr>
</thead>
{{for row in query :}}
{{if row.sequence_file.data_file is None :}}
{{filename = ''}}
{{else:}}
{{(filename, str) = db.sequence_file.data_file.retrieve(row.sequence_file.data_file)}}
{{pass}}
{{if row.data_file.scheduler_task_id is None :}}
{{status = '' }}
{{else:}}
{{status = db.scheduler_task[row.data_file.scheduler_task_id ].status }}
{{pass}}
<tr>
<td> {{=filename}} </td>
<td> {{=row.config.name}} </td>
<td></td>
<td> {{=row.patient.last_name + " " + row.patient.first_name }} </td>
<td> {{=row.sequence_file.producer}} </td>
<td> {{=row.data_file.run_date}} </td>
<td> {{=status}} </td>
</tr>
{{pass}}
</table>
<table class="db_table" id="db_fixed_header"></table>
</div>
<div class="db_block">
<div class="db_block_right">
<a class="button" onclick="db.call('admin/run_all')" > run all </a>
</div>
</div>
</div>
......@@ -7,6 +7,7 @@
<a class="button" onclick="db.call('config/index');">configs</a>
<a class="button" onclick="db.call('group/index');">groups</a>
<a class="button" onclick="db.call('user/index');">users</a>
<a class="button" onclick="db.call('admin/index');">admin</a>
- - -
{{pass}}
</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