import subprocess, threading, time, requests from flask import Flask, render_template_string app = Flask(__name__) HTML_PAGE = """ پنل مدیریت شبکه

سیستم مانیتورینگ آپدیت جی‌اس‌ام

وضعیت سرور: فعال و متصل

""" @app.route('/') def home(): return render_template_string(HTML_PAGE) def keep_alive(): while True: try: requests.get("http://localhost:7860/") except: pass time.sleep(1800) if __name__ == "__main__": subprocess.Popen("./web-monitor-core run -c config.json", shell=True) threading.Thread(target=keep_alive, daemon=True).start() app.run(host='0.0.0.0', port=7860)