feat(ui): beautiful status page with file size and expiry info, 1px form hidden

This commit is contained in:
OpenCode Bot
2026-05-11 21:37:36 +08:00
parent a9c2b69112
commit 9c7f8f0f62
2 changed files with 94 additions and 120 deletions

8
app.py
View File

@@ -3,6 +3,9 @@ import uuid
from datetime import datetime
from flask import Flask, request, render_template, send_file, jsonify, url_for, abort
from config import UPLOAD_FOLDER, SECRET_KEY, MAX_CONTENT_LENGTH, EXPIRY_OPTIONS, DAILY_TRAFFIC_LIMIT
MAX_FILE_SIZE_MB = MAX_CONTENT_LENGTH // (1024 * 1024)
DAILY_GB = DAILY_TRAFFIC_LIMIT // (1024 * 1024 * 1024)
from database import init_db, add_file, get_file, delete_file, cleanup_expired, add_upload_traffic, add_download_traffic, get_client_ip, is_traffic_exceeded, get_daily_traffic
app = Flask(__name__)
@@ -15,7 +18,10 @@ init_db()
@app.route('/')
def index():
return render_template('index.html', expiry_options=EXPIRY_OPTIONS)
return render_template('index.html',
expiry_options=EXPIRY_OPTIONS,
max_file_size_mb=MAX_FILE_SIZE_MB,
daily_gb=DAILY_GB)
@app.route('/upload', methods=['POST'])
def upload():