From ade3745024e9054c6a2af91f6f6f56304e8a12f4 Mon Sep 17 00:00:00 2001 From: c-d-p Date: Sun, 27 Jun 2021 14:26:51 +1000 Subject: [PATCH 1/2] spacing --- main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.py b/main.py index 5767c15..8d8223b 100644 --- a/main.py +++ b/main.py @@ -20,8 +20,10 @@ import socket ####################################### Flask App globals ####################################### PROD_HOST="pa_web" + hostname = socket.gethostname() print( "Running on: {}".format( hostname) ) + app = Flask(__name__) ### what is this value? I gather I should change it? From 26ba27cc0d0d1a8c1f54051cee639d4af6f2b1c3 Mon Sep 17 00:00:00 2001 From: c-d-p Date: Sun, 27 Jun 2021 14:27:46 +1000 Subject: [PATCH 2/2] updated files.py and files.html to add a context menu submenu to look for faces in an image. Doesnt work yet, but the context menu works --- files.py | 4 +++- templates/files.html | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/files.py b/files.py index e6bdf90..288d936 100644 --- a/files.py +++ b/files.py @@ -269,6 +269,8 @@ def files_sp(): noo, grouping, how_many, offset, size, folders, cwd, root = ViewingOptions( request ) entries=[] + people = Person.query.all() + # per storage path, add entries to view settings=Settings.query.first() paths = settings.storage_path.split("#") @@ -279,7 +281,7 @@ def files_sp(): else: entries+=GetEntriesInFlatView( cwd, prefix, noo, offset, how_many ) - return render_template("files.html", page_title='View Files (Storage Path)', entry_data=entries, noo=noo, grouping=grouping, how_many=how_many, offset=offset, size=size, folders=folders, cwd=cwd, root=root ) + return render_template("files.html", page_title='View Files (Storage Path)', entry_data=entries, noo=noo, grouping=grouping, how_many=how_many, offset=offset, size=size, folders=folders, cwd=cwd, root=root, people=people ) ################################################################################ diff --git a/templates/files.html b/templates/files.html index 874ebce..78c78c3 100644 --- a/templates/files.html +++ b/templates/files.html @@ -12,7 +12,6 @@ caption-side: bottom; } -
@@ -467,7 +466,16 @@ $.contextMenu({ details: { name: "Details..." }, view: { name: "View File" }, sep: "---", - move: { name: "Move selected file(s) to new storage folder" } + move: { name: "Move selected file(s) to new storage folder" }, + sep2: "---", + ai: { + name: "Scan file for faces", + items: { + {% for p in people %} + "ai-{{p.tag}}": {"name": "{{p.tag}}"}, + {% endfor %} + } + } } if( SelContainsBinAndNotBin() ) { item_list['both']= { name: 'Cannot delete and restore at same time', disabled: true } @@ -485,6 +493,7 @@ $.contextMenu({ if( key == "move" ) { MoveDBox() } if( key == "del" ) { DelDBox('Delete') } if( key == "undel" ) { DelDBox('Restore') } + if( key.startsWith("ai")) { console.log( key +'was chosen')} }, items: item_list };