Dynamically build the page. Automatically update by refreshing page

This commit is contained in:
2025-08-31 12:12:49 +02:00
parent fd0cb02615
commit 071c15f40d
2 changed files with 8 additions and 25 deletions

View File

@@ -11,7 +11,7 @@ app = Flask(__name__)
@app.route("/")
def homepage():
return render_template("home.html")
return render_template("home.html", services=services)
@app.route("/status")

View File

@@ -2,7 +2,7 @@
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="UTF-8">
<meta charset="UTF-8" http-equiv="refresh" content="1">
<title>Debug Divs</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
@@ -11,37 +11,20 @@
crossorigin="anonymous"></script>
</head>
<body class="m-2 bg-light-subtle">
<div class="d-inline-block m-2 border border-success border-3" style="width: 200px">
<body id="main_body" class="m-2 bg-light-subtle">
{% for s in services %}
<div class="d-inline-block m-2 border {{'border-success' if s.online else 'border-danger'}} border-3"
style="width: 200px">
<div class="bg-body-tertiary d-flex flex-column align-items-center">
<div class="bg-dark w-100">
<h4 class="text-center text-truncate m-0" style="font-size: 1.5rem;">Gitea</h4>
</div>
<div class="ratio ratio-1x1">
<img src="static/placeholder.svg" class="img-fluid">
</div>
</div>
</div>
<div class="d-inline-block m-2 border border-danger border-3" style="width: 200px">
<div class="bg-body-tertiary d-flex flex-column align-items-center">
<div class="bg-dark w-100">
<h4 class="text-center text-truncate m-0" style="font-size: 1.5rem;">Gitea</h4>
</div>
<div class="ratio ratio-1x1">
<img src="static/placeholder.svg" class="img-fluid">
</div>
</div>
</div>
<div class="d-inline-block m-2 border border-success border-3" style="width: 200px">
<div class="bg-body-tertiary d-flex flex-column align-items-center">
<div class="bg-dark w-100">
<h4 class="text-center text-truncate m-0" style="font-size: 1.5rem;">Gitea</h4>
<h4 class="text-center text-truncate m-0" style="font-size: 1.5rem;">{{s.url}}</h4>
</div>
<div class="ratio ratio-1x1">
<img src="static/placeholder.svg" class="img-fluid">
</div>
</div>
</div>
{% endfor %}
</body>