diff --git a/app/routes.py b/app/routes.py index e5d2be7..35b6307 100644 --- a/app/routes.py +++ b/app/routes.py @@ -1,11 +1,12 @@ import os +import random -from flask import Blueprint, render_template +from flask import Blueprint, render_template, jsonify from .auth import oidc from .port_utils import get_user_ports from dotenv import load_dotenv -main = Blueprint('main', __name__) +main = Blueprint('main', __name__, static_folder='static') load_dotenv() @@ -33,7 +34,19 @@ def dashboard(): has_server = os.path.exists(server_path) ip = os.getenv("SERVER_IP") ports = get_user_ports(username) - if (has_server): + + if has_server: return render_template('dashboard.html', username=username, ip=ip, ports=ports) else: return render_template('setup.html', username=username, ip=ip, ports=ports) + + +@main.route("/ads/list") +def list_ads(): + ads_dir = os.path.join(main.static_folder, "ads") + files = [ + f"/static/ads/{f}" + for f in os.listdir(ads_dir) + if f.lower().endswith(".png") + ] + return jsonify(files) diff --git a/app/static/ads/giantKitten.png b/app/static/ads/giantKitten.png new file mode 100644 index 0000000..6290fe3 Binary files /dev/null and b/app/static/ads/giantKitten.png differ diff --git a/app/static/ads/iPhoneAd.png b/app/static/ads/iPhoneAd.png new file mode 100644 index 0000000..af4ce4c Binary files /dev/null and b/app/static/ads/iPhoneAd.png differ diff --git a/app/static/style.css b/app/static/style.css index ebb9b51..c685f00 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -86,6 +86,20 @@ h2 { transition: all 0.3s ease; } +/* Ads */ +.ad-banner { + display: flex; + justify-content: center; + margin: 20px 0; +} + +.ad-banner img { + width: 200px; + height: auto; + border-radius: 12px; + box-shadow: 0 0 12px rgba(0, 0, 0, 0.3); +} + /* Tabs */ .tabs { display: grid; diff --git a/app/templates/layout.html b/app/templates/layout.html index e434270..9f7c325 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -30,7 +30,8 @@
{% block content %}{% endblock %}
-

Wersja: v0.1

+
+

Wersja: v0.2