diff --git a/api/app.py b/api/app.py index f1b45bd..92b8655 100644 --- a/api/app.py +++ b/api/app.py @@ -196,6 +196,32 @@ def server_stats(): 'timestamp': time.time() }) +# ─── Top Processes ─────────────────────────────────── +@app.route('/api/processes') +def top_processes(): + try: + raw = shell("ps aux --sort=-%cpu | awk 'NR>1 && NR<=8{print $2,$3,$4,$11}' | head -7") + procs = [] + for line in raw.strip().split('\n'): + parts = line.split(None, 3) + if len(parts) >= 4: + procs.append({ + 'pid': parts[0], + 'cpu': float(parts[1]), + 'mem': float(parts[2]), + 'name': parts[3].split('/')[-1][:20] + }) + elif len(parts) == 3: + procs.append({ + 'pid': parts[0], + 'cpu': float(parts[1]), + 'mem': float(parts[2]), + 'name': 'unknown' + }) + return jsonify(procs) + except Exception as e: + return jsonify([]), 200 + # ─── Services Status ───────────────────────────────── @app.route('/api/services') def services(): diff --git a/css/style.css b/css/style.css index a56bf01..429d7c8 100644 --- a/css/style.css +++ b/css/style.css @@ -2078,3 +2078,148 @@ a:hover { color: #fff; text-shadow: none; } font-size: 0.68rem; } } + +/* ============================ + 3D GLOBE PANEL + ============================ */ +.globe-panel { + min-height: 300px; +} + +.globe-container { + position: relative; + display: flex; + align-items: center; + justify-content: center; + padding: 0.5rem; + overflow: hidden; + min-height: 280px; +} + +#globeViz { + display: flex; + align-items: center; + justify-content: center; +} + +#globeViz canvas { + cursor: grab; +} + +#globeViz canvas:active { + cursor: grabbing; +} + +.globe-data-overlay { + position: absolute; + bottom: 0.5rem; + left: 0.75rem; + right: 0.75rem; + display: flex; + justify-content: space-around; + gap: 0.5rem; + pointer-events: none; +} + +.globe-coord-block { + text-align: center; +} + +.globe-coord-block .coord-label { + display: block; + font-family: var(--font-mono); + font-size: 0.45rem; + letter-spacing: 2px; + color: var(--text-secondary); +} + +.globe-coord-block .coord-value { + display: block; + font-family: var(--font-mono); + font-size: 0.65rem; + color: var(--status-green); + text-shadow: 0 0 6px var(--status-green-glow); +} + +/* ============================ + TOP PROCESSES TABLE + ============================ */ +.proc-display { + padding: 0.5rem !important; +} + +.proc-table { + width: 100%; + border-collapse: collapse; + font-family: var(--font-mono); + font-size: 0.6rem; +} + +.proc-table th { + text-align: left; + padding: 0.3rem 0.4rem; + font-size: 0.5rem; + letter-spacing: 2px; + color: var(--text-secondary); + border-bottom: 1px solid var(--border); + font-weight: 400; +} + +.proc-table td { + padding: 0.25rem 0.4rem; + color: #999; + border-bottom: 1px solid rgba(255, 255, 255, 0.02); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100px; +} + +.proc-table tr:hover td { + color: var(--status-green); + background: rgba(0, 204, 51, 0.02); +} + +.proc-table .proc-cpu-high { + color: var(--mil-red); + text-shadow: 0 0 4px rgba(139, 0, 0, 0.4); +} + +.proc-table .proc-cpu-med { + color: var(--amber); +} + +.proc-table .proc-cpu-low { + color: var(--status-green); +} + +.proc-loading { + text-align: center; + color: #555; + letter-spacing: 2px; + font-size: 0.5rem; + padding: 1rem !important; + animation: hintPulse 2s ease-in-out infinite; +} + +/* Globe responsive */ +@media (max-width: 1024px) { + .globe-panel { + min-height: 240px; + } + .globe-container { + min-height: 220px; + } +} + +@media (max-width: 768px) { + .globe-panel { + min-height: 200px; + } + .globe-container { + min-height: 180px; + } + .proc-table { + font-size: 0.55rem; + } +} diff --git a/index.html b/index.html index e4aa5d6..a58ff4b 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,7 @@ +
@@ -74,58 +75,26 @@| PID | +NAME | +CPU | +MEM | +
|---|---|---|---|
| SCANNING... | |||