Minacrypto commited on
Commit
bbfcdf1
·
verified ·
1 Parent(s): 514126a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +62 -35
app.py CHANGED
@@ -1,45 +1,72 @@
1
  import streamlit as st
2
- from datetime import datetime
3
  import time
4
 
5
- st.set_page_config(page_title="Crypto Mining Control Panel", layout="wide")
6
 
7
- st.title("⚡ Panel de Control - Minería Full Automática")
8
- st.markdown("Monitoreo quirúrgico de plataformas piloto.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
- # Simulación de estado de las 3 plataformas piloto
11
- if 'platforms' not in st.session_state:
12
- st.session_state.platforms = {
13
- "Plataforma 1 (BlockDAG)": {"status": "Activa", "last_run": "2026-07-25 02:00", "errors": 0},
14
- "Plataforma 2 (Sinbad)": {"status": "Pendiente", "last_run": "Nunca", "errors": 0},
15
- "Plataforma 3 (Rubi)": {"status": "Fallida", "last_run": "2026-07-24 18:30", "errors": 2}
 
 
16
  }
17
 
18
- # Visualización en Tabla / Panel
19
- col1, col2, col3 = st.columns(3)
20
 
21
- for i, (name, data) in enumerate(st.session_state.platforms.items()):
22
- with [col1, col2, col3][i]:
23
- st.subheader(name)
24
- if data["status"] == "Activa":
25
- st.success(f"Estado: {data['status']}")
26
- elif data["status"] == "Pendiente":
27
- st.warning(f"Estado: {data['status']}")
28
- else:
29
- st.error(f"Estado: {data['status']}")
30
 
31
- st.text(f"Última ejecución: {data['last_run']}")
32
- st.text(f"Fallos registrados: {data['errors']}")
 
33
 
34
- if st.button(f"Forzar Ejecución", key=name):
35
- st.toast(f"Ejecutando script para {name}...")
36
- time.sleep(1)
37
- st.rerun()
38
-
39
- st.markdown("---")
40
- st.subheader("Logs de Automatización en Tiempo Real")
41
- st.code("""
42
- [03:25:00] [INFO] Iniciando ciclo automático de 24h...
43
- [03:25:01] [SUCCESS] Plataforma 1: Minado activado correctamente.
44
- [03:25:05] [WARNING] Plataforma 3: Error de autenticación por Token caducado. Requiere revisión.
45
- """, language="text")
 
 
 
 
 
1
  import streamlit as st
 
2
  import time
3
 
4
+ st.set_page_config(page_title="Control 300 Apps", layout="centered")
5
 
6
+ # Inyectamos CSS para reducir márgenes y hacer el panel ultra compacto para móvil
7
+ st.markdown("""
8
+ <style>
9
+ .block-container {
10
+ padding-top: 1rem;
11
+ padding-bottom: 1rem;
12
+ padding-left: 0.5rem;
13
+ padding-right: 0.5rem;
14
+ }
15
+ h1 { font-size: 1.4rem !important; margin-bottom: 0px; }
16
+ p { font-size: 0.85rem !important; }
17
+ .row-container {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: space-between;
21
+ padding: 4px 8px;
22
+ margin-bottom: 4px;
23
+ background-color: #1e1e1e;
24
+ border-radius: 6px;
25
+ border-left: 4px solid #555;
26
+ }
27
+ .row-active { border-left-color: #28a745; }
28
+ .row-error { border-left-color: #dc3545; }
29
+ .app-name { font-size: 0.8rem; font-weight: bold; color: #fff; width: 35%%; }
30
+ .app-status { font-size: 0.75rem; width: 30%%; }
31
+ </style>
32
+ """, unsafe_allow_html=True)
33
 
34
+ st.title("⚡ Control 300 Apps (Modo Compacto)")
35
+ st.text("Vista de alta densidad para iPhone")
36
+
37
+ # Simulación de generación de 300 apps (puedes cargar tu lista real aquí)
38
+ if 'apps_list' not in st.session_state:
39
+ st.session_state.apps_list = {
40
+ f"App_{i:03d}": {"active": i % 3 != 0, "last": "02:00"}
41
+ for i in range(1, 301)
42
  }
43
 
44
+ # Buscador rápido para filtrar entre las 300
45
+ search = st.text_input("🔍 Filtrar App...", placeholder="Ej: App_045")
46
 
47
+ # Contenedor con scroll para ver muchas en poco espacio vertical
48
+ with st.container():
49
+ for name, data in st.session_state.apps_list.items():
50
+ if search and search.lower() not in name.lower():
51
+ continue
 
 
 
 
52
 
53
+ is_active = data["active"]
54
+ border_class = "row-active" if is_active else "row-error"
55
+ status_text = "🟢 Activa" if is_active else "🔴 Detenida"
56
 
57
+ # Estructura en fila usando columnas de Streamlit ultra ajustadas
58
+ cols = st.columns([3, 2, 2])
59
+
60
+ with cols[0]:
61
+ st.markdown(f"<p style='margin:0; font-size:0.8rem;'><b>{name}</b></p>", unsafe_allow_html=True)
62
+
63
+ with cols[1]:
64
+ st.markdown(f"<p style='margin:0; font-size:0.75rem;'>{status_text}</p>", unsafe_allow_html=True)
65
+
66
+ with cols[2]:
67
+ if st.button("Ejecutar", key=f"btn_{name}", help=f"Forzar {name}"):
68
+ st.toast(f"🚀 Ejecutando {name}...")
69
+ time.sleep(0.5)
70
+ st.rerun()
71
+
72
+ st.markdown("<hr style='margin:2px 0; border-color:#333;'>", unsafe_allow_html=True)