mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-10 09:16:16 +00:00
Add initial HTML structure and styles for Microsoft Rewards Bot dashboard
- Created index.html with a complete layout for the dashboard - Added favicon.ico placeholder - Implemented responsive design and styling using CSS variables - Integrated React for dynamic data handling and real-time updates - Set up WebSocket connection for live log updates - Included functionality for starting/stopping the bot and managing accounts
This commit is contained in:
16
src/index.ts
16
src/index.ts
@@ -1325,7 +1325,18 @@ async function main() {
|
||||
// Check for dashboard mode flag (standalone dashboard)
|
||||
if (process.argv.includes('-dashboard')) {
|
||||
const { startDashboardServer } = await import('./dashboard/server')
|
||||
const { dashboardState } = await import('./dashboard/state')
|
||||
log('main', 'DASHBOARD', 'Starting standalone dashboard server...')
|
||||
|
||||
// Load and initialize accounts
|
||||
try {
|
||||
const accounts = loadAccounts()
|
||||
dashboardState.initializeAccounts(accounts.map(a => a.email))
|
||||
log('main', 'DASHBOARD', `Initialized ${accounts.length} accounts in dashboard`)
|
||||
} catch (error) {
|
||||
log('main', 'DASHBOARD', 'Could not load accounts: ' + (error instanceof Error ? error.message : String(error)), 'warn')
|
||||
}
|
||||
|
||||
startDashboardServer()
|
||||
return
|
||||
}
|
||||
@@ -1338,6 +1349,7 @@ async function main() {
|
||||
// Auto-start dashboard if enabled in config
|
||||
if (config.dashboard?.enabled) {
|
||||
const { DashboardServer } = await import('./dashboard/server')
|
||||
const { dashboardState } = await import('./dashboard/state')
|
||||
const port = config.dashboard.port || 3000
|
||||
const host = config.dashboard.host || '127.0.0.1'
|
||||
|
||||
@@ -1345,6 +1357,10 @@ async function main() {
|
||||
process.env.DASHBOARD_PORT = String(port)
|
||||
process.env.DASHBOARD_HOST = host
|
||||
|
||||
// Initialize dashboard with accounts
|
||||
const accounts = loadAccounts()
|
||||
dashboardState.initializeAccounts(accounts.map(a => a.email))
|
||||
|
||||
const dashboardServer = new DashboardServer()
|
||||
dashboardServer.start()
|
||||
log('main', 'DASHBOARD', `Auto-started dashboard on http://${host}:${port}`)
|
||||
|
||||
Reference in New Issue
Block a user