Private
Public Access
1
0

with jquery to refresh when tasks are complete

jquery lives in basebase.html. Perhaps should live in individual pages
This commit is contained in:
Sander Roosendaal
2017-10-30 22:32:34 +01:00
parent 21be4d278b
commit 98abc68289
5 changed files with 41 additions and 9 deletions

View File

@@ -208,7 +208,8 @@ def get_job_result(jobid):
verbose_job_status = {
'updatecp': 'Critical Power Calculation for Ergometer Workouts',
'updatecpwater': 'Critical Power Calculation for OTW Workouts',
'otwsetpower': 'Rowing Physics OTW Power Calculation'
'otwsetpower': 'Rowing Physics OTW Power Calculation',
'make_plot': 'Create static chart',
}
def get_job_status(jobid):
@@ -3539,7 +3540,7 @@ def oterankings_view(request,theuser=0,
request.session['async_tasks'] += [(job.id,'updatecp')]
except KeyError:
request.session['async_tasks'] = [(job.id,'updatecp')]
messages.info(request,'New calculation queued. Refresh page or resubmit the date form to get the result')
messages.info(request,'New calculation queued.')
powerdf = pd.DataFrame({
'Delta':delta,
@@ -7468,9 +7469,14 @@ def workout_add_chart_view(request,id,plotnr=1):
u = w.user.user
r = getrower(u)
title = w.name
res = uploads.make_plot(r,w,f1,w.csvfilename,'timeplot',title,plotnr=plotnr,
imagename=imagename)
res,jobid = uploads.make_plot(
r,w,f1,w.csvfilename,'timeplot',title,plotnr=plotnr,
imagename=imagename
)
try:
request.session['async_tasks'] += [(jobid,'make_plot')]
except KeyError:
request.session['async_tasks'] = [(jobid,'make_plot')]
try:
url = request.session['referer']