mirror of
https://github.com/StefBuwalda/dashboard_test.git
synced 2025-10-30 03:09:59 +00:00
Dynamically build the page. Automatically update by refreshing page
This commit is contained in:
2
main.py
2
main.py
@@ -11,7 +11,7 @@ app = Flask(__name__)
|
|||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def homepage():
|
def homepage():
|
||||||
return render_template("home.html")
|
return render_template("home.html", services=services)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/status")
|
@app.route("/status")
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en" data-bs-theme="dark">
|
<html lang="en" data-bs-theme="dark">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" http-equiv="refresh" content="1">
|
||||||
<title>Debug Divs</title>
|
<title>Debug Divs</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet"
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||||
integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
||||||
@@ -11,37 +11,20 @@
|
|||||||
crossorigin="anonymous"></script>
|
crossorigin="anonymous"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="m-2 bg-light-subtle">
|
<body id="main_body" class="m-2 bg-light-subtle">
|
||||||
<div class="d-inline-block m-2 border border-success border-3" style="width: 200px">
|
{% 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-body-tertiary d-flex flex-column align-items-center">
|
||||||
<div class="bg-dark w-100">
|
<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>
|
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ratio ratio-1x1">
|
<div class="ratio ratio-1x1">
|
||||||
<img src="static/placeholder.svg" class="img-fluid">
|
<img src="static/placeholder.svg" class="img-fluid">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user