Spaces:
Sleeping
Sleeping
| import random | |
| from flask import Flask, render_template, jsonify, request, session | |
| import os | |
| app = Flask(__name__) | |
| app.secret_key = os.urandom(24) | |
| # ========================================== | |
| # SENSOR DATA | |
| # ========================================== | |
| SCAN_RESULTS = [ | |
| {"id": "CITIZEN-492", "status": "NOMINAL", "note": "Carrying architectural blueprints."}, | |
| {"id": "VEHICLE-XK9", "status": "WARNING", "note": "Unregistered plates. Traces of chemicals."}, | |
| {"id": "UNKNOWN-ENTITY", "status": "DANGER", "note": "Biometrics match criminal database (98%)."}, | |
| {"id": "INFRASTRUCTURE", "status": "DECAY", "note": "Structural integrity at 45%. Collapse imminent."}, | |
| {"id": "NETWORK-NODE", "status": "ACTIVE", "note": "Unauthorized data stream detected."}, | |
| ] | |
| def index(): | |
| return render_template('index.html') | |
| def scan_target(): | |
| # Return a random scan result simulating AI analysis | |
| result = random.choice(SCAN_RESULTS) | |
| return jsonify(result) | |
| if __name__ == '__main__': | |
| app.run(host='0.0.0.0', port=7860, debug=True) | |