Added simple library for progress
This commit is contained in:
parent
0e777c4d75
commit
cce399a7a6
3 changed files with 36 additions and 3 deletions
24
libraries/progress.py
Normal file
24
libraries/progress.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from modules.pastafari2.models.tasks import Task, LogTask
|
||||
from flask import request
|
||||
from paramecio2.libraries.i18n import I18n
|
||||
|
||||
def load_progress(db, t, return_tree='', path_module='admin_app.pastafari2_dashboard'):
|
||||
|
||||
task_id=request.args.get('task_id', '0')
|
||||
|
||||
position=request.args.get('position', '0')
|
||||
|
||||
task=Task(db)
|
||||
|
||||
arr_task=task.set_conditions('WHERE id=%s', [task_id]).select_a_row_where()
|
||||
|
||||
url_return=arr_task['url_return']
|
||||
|
||||
#print(url_return)
|
||||
|
||||
#print(arr_task)
|
||||
if arr_task:
|
||||
return t.load_template('progress.phtml', title=I18n.lang('pastafari2', 'task_progress', 'Task progress'), path_module=path_module, name_task=arr_task['name_task'], description_task=arr_task['description_task'], position=position, task_id=task_id, server=arr_task['server'], hostname=arr_task['hostname'], url_return=url_return, return_tree=return_tree)
|
||||
else:
|
||||
|
||||
return ""
|
||||
Loading…
Add table
Add a link
Reference in a new issue