JSFiddle - React, Tailwind, and code Playground
by velo_ninja
HTML
# =============================================================================
# 26. EMERGENCY UI (cls_emergency_mode) — v3.2 PLUG & PLAY • CRASH-PROOF
# =============================================================================
class cls_emergency_mode:
"""
Fallback interface: Full standalone admin UI when templates missing.
✅ Zero-template fallback • ✅ Toast API • ✅ Atomic SAVE • ✅ 6-section responsive
✅ Per-card SAVE + SAVE-ALL • ✅ Smart route-aware module opening
✅ Console launcher generator • ✅ Crash-proof with safe MSE access
✅ Self-contained CSS/JS • ✅ Dynamic grid layout • ✅ Graceful degradation
✅ Real backend integration • ✅ Visual feedback on all actions
"""
ENABLED = True
_CSS_VARS = {
'--bg': '#0f172a', '--card': '#1e293b', '--border': '#334155', '--text': '#e2e8f0',
'--muted': '#94a3b8', '--primary': '#38bdf8', '--success': '#16a34a',
'--warning': '#d97706', '--error': '#dc2626', '--radius': '8px',
'--font-mono': 'ui-monospace, SFMono-Regular, Menlo, monospace'
}
# ✅ COMPLETE Card-to-config mapping (ALL fields)
_CARD_CONFIG_MAP = {
'server_stats': ['server_title', 'server_host', 'server_port', 'server_threads'],
'server_info': ['debug_mode', 'log_file', 'server_backup_count', 'server_rate_limiting'],
'module_stats': [], # Read-only
'automations': [
'server_hot_reload', 'auto_install_dependencies', 'auto_open_browser',
'auto_heal_configs', 'auto_structure_folders', 'auto_hardware_check'
],
'logging': ['log_cmd', 'log_file', 'debug_mode', 'log_level'],
'server_options': [
'server_rate_limiting', 'server_host', 'server_port',
'server_protocol', 'server_threads', 'server_session_timeout',
'server_upload_size', 'server_execution_time_max',
'server_memory_per_request_max', 'server_requests_per_minute_max'
...