Added a first version of the dashboard

This commit is contained in:
2025-08-31 11:49:11 +02:00
parent 877fce9b7a
commit 3b3c49d8df
3 changed files with 63 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
# import requests as r
from flask import jsonify, Flask
from flask import jsonify, Flask, render_template
from poll_services import start_async_loop
from mem import services
import threading
@@ -10,6 +10,11 @@ app = Flask(__name__)
@app.route("/")
def homepage():
return render_template("home.html")
@app.route("/status")
def status():
return jsonify([s.to_dict() for s in services])
@@ -21,4 +26,4 @@ if __name__ == "__main__":
t.start()
# Run flask app
app.run(debug=True, use_reloader=False)
app.run(debug=True, use_reloader=True)

2
static/placeholder.svg Normal file
View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" role="img" xmlns="http://www.w3.org/2000/svg" aria-labelledby="placeholderIconTitle" stroke="#000000" stroke-width="1" stroke-linecap="square" stroke-linejoin="miter" fill="none" color="#000000"> <title id="placeholderIconTitle">Placeholder</title> <rect width="18" height="18" x="3" y="3"/> <path stroke-linecap="round" d="M21 21L3 3 21 21zM21 3L3 21 21 3z"/> </svg>

After

Width:  |  Height:  |  Size: 540 B

54
templates/home.html Normal file
View File

@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="UTF-8">
<title>Debug Divs</title>
<style>
/* Debugging CSS */
div {
outline: 1px solid red;
}
</style>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"
integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI"
crossorigin="anonymous"></script>
</head>
<body class="m-2 bg-light-subtle">
<div class="d-inline-block m-2" 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">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" 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">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" 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">Gitea</h4>
</div>
<div class="ratio ratio-1x1">
<img src="static/placeholder.svg" class="img-fluid">
</div>
</div>
</div>
</body>
</html>