clean up how we create toasts() [no longer try to reuse dom elements, just add new ones each time], support persistent notifications and close button or not [via separate booleans], created a clear message route and use that now in templates/base.html to clear FE messages. This will break for check dups as I am not setting persistence / close buttons correctly for those jobs, that is next. Converted move_files to new format
This commit is contained in:
15
job.py
15
job.py
@@ -90,7 +90,6 @@ def GetJM_Message():
|
||||
# ClearJM_Message: used in html to clear any message just displayed
|
||||
################################################################################
|
||||
def ClearJM_Message(id):
|
||||
print("ClearJM_Message called")
|
||||
PA_JobManager_Message.query.filter(PA_JobManager_Message.id==id).delete()
|
||||
db.session.commit()
|
||||
return
|
||||
@@ -313,9 +312,21 @@ def CheckForJobs():
|
||||
for msg in PA_JobManager_Message.query.all():
|
||||
print("there is a PA_J_MGR status message" )
|
||||
u='<a class="link-light" href="' + url_for('joblog', id=msg.job_id) + '">Job # ' + str(msg.job_id) + '</a>: '
|
||||
sts.append( { 'message': u+msg.message, 'alert': msg.alert } )
|
||||
sts.append( { 'message': u+msg.message, 'alert': msg.alert, 'job_id': msg.job_id } )
|
||||
return make_response( jsonify( num_active_jobs=num, sts=sts ) )
|
||||
|
||||
###############################################################################
|
||||
# / -> POST -> looks for pa_job_manager status to F/E jobs and sends json of
|
||||
# them back to F/E (called form internal/js/jobs.js:CheckForJobs()
|
||||
################################################################################
|
||||
@app.route("/clearmsgforjob/<id>", methods=["POST"])
|
||||
@login_required
|
||||
def ClearMessageForJob(id):
|
||||
PA_JobManager_Message.query.filter(PA_JobManager_Message.job_id==id).delete()
|
||||
db.session.commit()
|
||||
# no real need for this response, as if it succeeded/failed the F/E ignores it
|
||||
return make_response( jsonify( status="success" ) )
|
||||
|
||||
###############################################################################
|
||||
# This func creates a new filter in jinja2 to format the time from the db in a
|
||||
# way that is more readable (converted to local tz too)
|
||||
|
||||
Reference in New Issue
Block a user