feat: Implementação completa do NoIdle - Cliente, Backend e Scripts
- Cliente Windows com modo silencioso e auto-start robusto - Backend Node.js + API REST - Frontend Next.js + Dashboard - Scripts PowerShell de configuração e diagnóstico - Documentação completa - Build scripts para Windows e Linux - Solução de auto-start após reinicialização Resolução do problema: Cliente não voltava ativo após reboot Solução: Registro do Windows + Task Scheduler + Modo silencioso
This commit is contained in:
27
backend/create_tables.sql
Normal file
27
backend/create_tables.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- Criar tabela browsing_history para armazenar histórico de navegação
|
||||
CREATE TABLE IF NOT EXISTS browsing_history (
|
||||
id SERIAL PRIMARY KEY,
|
||||
device_id VARCHAR(255) NOT NULL,
|
||||
url TEXT NOT NULL,
|
||||
title VARCHAR(500),
|
||||
browser VARCHAR(100),
|
||||
visited_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
created_at TIMESTAMP NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Criar tabela session_events para armazenar eventos de logon/logoff
|
||||
CREATE TABLE IF NOT EXISTS session_events (
|
||||
id SERIAL PRIMARY KEY,
|
||||
device_id VARCHAR(255) NOT NULL,
|
||||
event_type VARCHAR(20) NOT NULL CHECK (event_type IN ('logon', 'logoff')),
|
||||
username VARCHAR(255),
|
||||
event_time TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
created_at TIMESTAMP NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Criar índices para melhor performance
|
||||
CREATE INDEX IF NOT EXISTS idx_browsing_history_device_id ON browsing_history(device_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_browsing_history_visited_at ON browsing_history(visited_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_session_events_device_id ON session_events(device_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_session_events_event_time ON session_events(event_time DESC);
|
||||
|
||||
Reference in New Issue
Block a user