Initial commit: SenSu Alpha 0.2.0
- 13-service async plugin framework - Textual TUI with CLI fallback - Plugin hot-reload + permission system - Web management panel (aiohttp) - Bridge-based inter-module communication - 10 regression tests Fixes applied: - PBKDF2-SHA256 auth (was plain SHA256) - Auth bypass removed (was allow-all on fail) - Bare excepts replaced with logged errors - CatFramework/DreamSu -> SenSu naming unified - ServiceManager: health checks + startup_order - Env var credentials (SENSU_ADMIN_PASSWORD etc)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { initAuth, api } from './api.js';
|
||||
import { initDashboard } from './modules/dashboard.js';
|
||||
import { initPlugins } from './modules/plugins.js';
|
||||
import { initLogs } from './modules/logs.js';
|
||||
import { initCommands } from './modules/commands.js';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
// 1. 检查登录状态
|
||||
const authState = await initAuth();
|
||||
if (!authState.authenticated) return; // 停留在登录页
|
||||
|
||||
// 2. 初始化各模块
|
||||
initDashboard();
|
||||
initPlugins();
|
||||
initLogs();
|
||||
initCommands();
|
||||
|
||||
// 3. Tab 切换逻辑
|
||||
document.querySelectorAll('.tabs button').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
document.querySelectorAll('.tabs button').forEach(b => b.classList.remove('active'));
|
||||
btn.classList.add('active');
|
||||
|
||||
const tabId = `tab-${btn.dataset.tab}`;
|
||||
document.querySelectorAll('.content section').forEach(s => s.classList.add('hidden'));
|
||||
document.getElementById(tabId).classList.remove('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user