Fixed receipt file previews not loading

This commit is contained in:
Jadowyne Ulve 2025-08-03 20:03:34 -05:00
parent 8192018e0c
commit 71f1c4f85d
36 changed files with 11 additions and 19 deletions

View File

@ -241,7 +241,7 @@ def uploadFile(receipt_id):
file_type, _ = mimetypes.guess_type(file.filename)
preview_image = ""
if file_type == "application/pdf":
output_path = "static/files/receipts/previews/"
output_path = f"{current_app.config['FILES_FOLDER']}/receipts/previews/"
preview_image = receipts_processes.create_pdf_preview(file_path, output_path)
file_size = os.path.getsize(file_path)
@ -259,6 +259,13 @@ def getFile(file_name):
print(path_)
return send_from_directory(path_, file_name)
@receipt_api.route('/api/getPreview/<file_name>')
@access_api.login_required
def getPreview(file_name):
path_ = current_app.config['FILES_FOLDER'] + "/receipts/previews"
print(path_)
return send_from_directory(path_, file_name)
@receipt_api.route('/api/checkAPI', methods=["POST"])
@access_api.login_required
def checkAPI():

View File

@ -217,8 +217,10 @@ async function replenishFilesCards(files) {
console.log(files[key])
let baseStaticUrl = '/static/files/receipts/previews/';
let baseStaticUrl = `/receipts/api/getPreview/`;
let imgSrc = `${baseStaticUrl}${files[key].preview_image}`;
console.log(imgSrc)
let media_div = document.createElement('div')
media_div.setAttribute('class', 'uk-card-media-top')

View File

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 874 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

View File

@ -1,16 +0,0 @@
version: '3.4'
services:
speedtest-tracker:
container_name: speedtest-tracker
ports:
- 8080:80
- 8443:443
environment:
- PUID=1000
- PGID=1000
- DB_CONNECTION=sqlite
volumes:
- ./data:/config
- ./keys:/config/keys
image: lscr.io/linuxserver/speedtest-tracker:latest
restart: unless-stopped

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 MiB

View File

@ -20,7 +20,6 @@ oauth.init_app(app)
swagger = Swagger(app)
app.config.from_pyfile('application.cfg.py')
print(app.config['UPLOAD_FOLDER'])
oauth.register(
name=app.config['OAUTH_NAME'],
client_id=app.config['OAUTH_CLIENT_ID'],