mirror of
https://github.com/andrey271192/vps_monitoring.git
synced 2026-09-20 11:55:34 +00:00
- Light and dark theme toggle with localStorage persistence - Russian and English language support (full i18n) - Instructions & cheat sheet modal with install/SSH/API/commands - Green pulsing dot for online, red for offline servers - Color-coded metrics: green (ok), yellow (warn >70%), red (crit >90%) - Top bar on server cards: green=online, red=offline Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 lines
545 B
JavaScript
17 lines
545 B
JavaScript
let currentTheme = localStorage.getItem('vps_theme') || 'dark';
|
|
|
|
function applyTheme(theme) {
|
|
currentTheme = theme;
|
|
localStorage.setItem('vps_theme', theme);
|
|
document.documentElement.setAttribute('data-theme', theme);
|
|
const btn = document.getElementById('themeToggleBtn');
|
|
if (btn) btn.textContent = theme === 'dark' ? '☀️' : '🌙';
|
|
}
|
|
|
|
function toggleTheme() {
|
|
applyTheme(currentTheme === 'dark' ? 'light' : 'dark');
|
|
}
|
|
|
|
// Apply on load
|
|
document.addEventListener('DOMContentLoaded', () => applyTheme(currentTheme));
|