mirror of
https://github.com/andrey271192/vps_monitoring.git
synced 2026-09-20 11:55:34 +00:00
feat: add light/dark theme, RU/EN i18n, instructions page, green/red monitoring
- 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>
This commit is contained in:
16
server/static/js/theme.js
Normal file
16
server/static/js/theme.js
Normal file
@@ -0,0 +1,16 @@
|
||||
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));
|
||||
Reference in New Issue
Block a user