Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
import subprocess
|
| 4 |
+
|
| 5 |
+
def get_status():
|
| 6 |
+
# محاولة جلب حالة العقد من العمليات الجارية
|
| 7 |
+
try:
|
| 8 |
+
gaga_check = subprocess.getoutput("ps aux | grep gaganode | grep -v grep")
|
| 9 |
+
titan_check = subprocess.getoutput("ps aux | grep titan | grep -v grep")
|
| 10 |
+
|
| 11 |
+
status = "### 🟢 حالة النظام الحالية:\n"
|
| 12 |
+
status += f"- **GagaNode:** {'✅ يعمل' if 'gaganode' in gaga_check else '❌ متوقف'}\n"
|
| 13 |
+
status += f"- **Titan Network:** {'✅ يعمل' if 'titan' in titan_check else '❌ متوقف'}\n"
|
| 14 |
+
status += "\n*ملاحظة: يتم تحديث الأرصدة في المواقع الرسمية فقط.*"
|
| 15 |
+
return status
|
| 16 |
+
except:
|
| 17 |
+
return "جاري تشغيل المحركات..."
|
| 18 |
+
|
| 19 |
+
with gr.Blocks(title="AI Money Generator 2025") as demo:
|
| 20 |
+
gr.Markdown("# 🚀 منظومة الأرباح الأوتوماتيكية")
|
| 21 |
+
status_output = gr.Markdown(get_status())
|
| 22 |
+
refresh_btn = gr.Button("تحديث الحالة")
|
| 23 |
+
refresh_btn.click(get_status, outputs=status_output)
|
| 24 |
+
|
| 25 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|