allow close of errors that are not checkdups jobs from FE

This commit is contained in:
2021-09-24 12:50:02 +10:00
parent 0f5f21d266
commit 3ee81a66f2
3 changed files with 32 additions and 9 deletions

17
TODO
View File

@@ -1,14 +1,21 @@
## GENERAL
* when there is an actual error sent from B/E to F/E, you can't clear it other than deleting via sql
* add an option on the person menu to run_ai_on all photos (or at least import/storage)
* maybe strip unnecessary / at end of directory name. i think i have left behind empty folders, e.g. check switzerland and austria
- also should allow move to existing folder soon...
* move all unsorted photos/* -> import/
fix: BUG-64 first
* metadata at folder level with file level to add more richness
* add an option on the person menu to run_ai_on all photos (or at least import/storage)
* when hitting back button to a search, it doesnt handle the post, etc.
$(document).ready(function() {
window.history.pushState(null, "", window.location.href);
window.onpopstate = function() {
window.history.pushState(null, "", window.location.href);
};
});
* get build process to create a random string for secret for PROD, otherwise use builtin for dev
@@ -26,8 +33,6 @@
* fix up logging in general
* metadata at folder level with file level to add more richness
* support animated gifs in html5 canvas
* if a video is really mostly black, then we dont get a thumbnail... (see: 20210526_205257_01.mp4)

View File

@@ -1,6 +1,6 @@
from wtforms import SubmitField, StringField, HiddenField, validators, Form
from flask_wtf import FlaskForm
from flask import request, render_template, redirect, send_from_directory
from flask import request, render_template, redirect, send_from_directory, url_for
from main import db, app, ma
from sqlalchemy import Sequence
from sqlalchemy.exc import SQLAlchemyError
@@ -138,7 +138,7 @@ class FileType(db.Model):
name = db.Column(db.String, unique=True, nullable=False )
def __repr__(self):
return "<id: {}, name={}>".format(self.id, self.name )
return f"<id: {self.id}, name={self.name}>"
################################################################################
# Class describing PA_JobManager_Message and in the DB (via sqlalchemy)
@@ -152,8 +152,9 @@ class PA_JobManager_Message(db.Model):
job_id = db.Column(db.Integer, db.ForeignKey('job.id') )
alert = db.Column(db.String)
message = db.Column(db.String)
job = db.relationship ("Job" )
def __repr__(self):
return "<id: {}, job_id: {}, alert: {}, message: {}".format(self.id, self.job_id, self.alert, self.message)
return f"<id: {self.id}, job_id: {self.job_id}, alert: {self.alert}, message: {self.message}, job: {self.job}"
################################################################################
@@ -257,6 +258,16 @@ def GetEntries( OPT ):
entries+=GetEntriesInFlatView( OPT, prefix )
return entries
################################################################################
# /clear_jm_msg -> with a dismissable error (ie. anything not success, that is
# not showing duplicates (so rare errors) - allow them to be dismissed
################################################################################
@app.route("/clear_jm_msg/<id>", methods=["POST"])
@login_required
def clear_jm_msg(id):
ClearJM_Message(id)
return redirect( url_for("main_page") )
################################################################################
# /file_list -> show detailed file list of files from import_path(s)
################################################################################

View File

@@ -126,10 +126,17 @@
{% set msg=GetJM_Message() %}
{% if request.endpoint != "fix_dups" and request.endpoint != "rm_dups" %}
<div class="py-2 mx-1 alert alert-{{msg.alert}}">
{% if msg.job.name != "checkdups" %}
<form id="_dismiss" action="{{url_for('clear_jm_msg', id=msg.id)}}" method="POST">
<button type="button" class="close btn border-secondary me-3" aria-label="Close" onClick="$('#_dismiss').submit()">
<span aria-hidden="true">&times;</span>
</button>
{% endif %}
{% if msg.job_id %}
<a href="{{url_for('joblog', id=msg.job_id)}}">Job #{{msg.job_id}}</a>:
{% endif %}
{{msg.message|safe}}
</form>
</div>
{# if a JM is a danger message, allow code to remove the status, it should be 'permanent' until addressed -- e.g. you have duplicates, fix them #}
{% if msg.alert != "danger" %}