first-pass of popups for job creation for more than just move files, and fix BUG-112 (after move highlighting is broken)

This commit is contained in:
2023-01-04 12:26:25 +11:00
parent 7e115902fc
commit c3971eb495
7 changed files with 21 additions and 12 deletions

1
BUGs
View File

@@ -6,4 +6,3 @@ BUG-106: cant add trudy /pat? as refimgs via FaceDBox
(it came from a face bbox, BUT, I have grown the face seln by 10%?)
BUG-109: add mich force override, removed it, then re-added it, then rebuild DB form scratch and metadata has a duplicate
- redo disco metadata with md5 not UUID of face dataS
BUG-112: with 'move_files' staying on same page, highlighting is now broken as ecnt is in the wrong order

3
TODO
View File

@@ -1,5 +1,8 @@
### GENERAL
* get all status messages to use toasts AND get func to also increase/descrease the job counter as appropriate)
- [DONE] all status messages use toasts
-- [TODO] make a helper func for setting toast body and use it in base.html && file_support.js
-- [TODO] make a helper func for setting 'Active Jobs' text/badge and call it when document ready (rather/both than start of base.html)
* ignore face should ignore ALL matching faces (re: Declan)

View File

@@ -502,7 +502,7 @@ def search(search_term):
def scannow():
job=NewJob("scannow" )
st.SetMessage("scanning for new files in:&nbsp;<a href=/job/{}>Job #{}</a>&nbsp;(Click the link to follow progress)".format( job.id, job.id) )
return render_template("base.html")
return redirect("/jobs")
################################################################################
# /files/forcescan -> deletes old data in DB, and does a brand new scan
@@ -512,7 +512,7 @@ def scannow():
def forcescan():
job=NewJob("forcescan" )
st.SetMessage("force scan & rebuild data for files in:&nbsp;<a href=/job/{}>Job #{}</a>&nbsp;(Click the link to follow progress)".format( job.id, job.id) )
return render_template("base.html")
return redirect("/jobs")
################################################################################
# /files/scan_sp -> allows us to force a check for new files
@@ -522,7 +522,7 @@ def forcescan():
def scan_sp():
job=NewJob("scan_sp" )
st.SetMessage("scanning for new files in:&nbsp;<a href=/job/{}>Job #{}</a>&nbsp;(Click the link to follow progress)".format( job.id, job.id) )
return render_template("base.html")
return redirect("/jobs")
################################################################################

View File

@@ -61,6 +61,8 @@ function MoveSubmit()
{
// remove the images being moved
$("[name^=eid-]").each( function() { $('#'+$(this).attr('value')).remove() } )
// reorder the images via ecnt again, so highlighting can work
document.mf_id=0; $('.figure').each( function() { $(this).attr('ecnt', document.mf_id ); document.mf_id++ } )
$('#dbox').modal('hide')
$.ajax({ type: 'POST', data: $('#mv_fm').serialize(), url: '/move_files', success: function(data){ $('.toast-body').html( "Created&nbsp;<a class='link-light' href=/job/" + data.job_id + ">Job #" + data.job_id + "</a>&nbsp;to move selected file(s)" ); $('.toast').toast("show"); return false; } })
}

2
job.py
View File

@@ -197,7 +197,7 @@ def joblog(id):
@login_required
def wakeup():
WakePAJobManager()
return render_template("base.html")
return redirect("/")
################################################################################
@app.route("/stale_job/<id>", methods=["POST"])

View File

@@ -242,7 +242,7 @@ def person(id):
person = Person.query.get(id)
if not person:
st.SetMessage( f"No such person with id: {id}", "danger" )
return render_template("base.html" )
return redirect("/")
form = PersonForm(request.values, obj=person)
return render_template("person.html", person=person, form=form, page_title = page_title)

View File

@@ -133,12 +133,6 @@
</div class="container-fluid">
</nav>
{% if GetMessage()|length %}
<div id="status" class="py-2 mx-1 alert alert-{{GetAlert()}}">
{{ GetMessage()|safe}}
{{ ClearStatus() }}
</div>
{% endif %}
{% if GetJM_Message() != None %}
{% set msg=GetJM_Message() %}
{% if request.endpoint != "fix_dups" and request.endpoint != "rm_dups" and request.endpoint != "stale_jobs" %}
@@ -178,6 +172,17 @@
</div>
</div>
</div>
{% if GetMessage()|length %}
<script>
$(document).ready(function() {
msg = "{{ GetMessage()|safe }}"
msg=msg.replace('href=', 'class=link-light href=')
$('.toast-body').html( msg )
$('.toast').toast("show");
} )
</script>
{{ ClearStatus() }}
{% endif %}
</body>
</html>
{% endif %}