Initial mithal monitoring dashboard
هذا الالتزام موجود في:
32
app.py
Normal file
32
app.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from flask import Flask, send_file, jsonify
|
||||
import os
|
||||
import json
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
DATA_FILE = "monitoring-data.json"
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def dashboard():
|
||||
return send_file("dashboard.html")
|
||||
|
||||
|
||||
@app.route("/monitoring-data.json")
|
||||
def monitoring_data():
|
||||
if not os.path.exists(DATA_FILE):
|
||||
return jsonify([])
|
||||
|
||||
with open(DATA_FILE, "r") as f:
|
||||
return jsonify(json.load(f))
|
||||
|
||||
|
||||
@app.route("/health")
|
||||
def health():
|
||||
return jsonify({
|
||||
"status": "healthy"
|
||||
})
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=5000)
|
||||
المرجع في مشكلة جديدة
حظر مستخدم