feat: perfil BD, historial sesiones, UX login y config Android
- Perfil conectado a BD: nombre real, edición con iniciales auto - Historial de sesiones: nueva página con duración y badge activa - Ayuda y soporte navega a MensajeriaPage - InicioPage: nombre real desde BD, click avatar → tab perfil - Login: foco automático, Enter = ingresar, click card = foco - ApplicationId: net.siaxsystem.sentinelone en todos los manifests - Linux: libsqlite3-dev requerido en CMakeLists, error amigable en app - BD ruta Linux corregida a ~/.local/share/sentinel_one/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
1184ab5fe2
commit
3e2294faf6
@@ -130,8 +130,15 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
try {
|
||||
// Borra la BD existente
|
||||
if (Platform.isLinux || Platform.isWindows) {
|
||||
final dbPath = p.join(Directory.current.path, 'sentinel_one.db');
|
||||
await databaseFactoryFfi.deleteDatabase(dbPath);
|
||||
final String dbDir;
|
||||
if (Platform.isLinux) {
|
||||
final home = Platform.environment['HOME'] ?? Directory.current.path;
|
||||
dbDir = p.join(home, '.local', 'share', 'sentinel_one');
|
||||
} else {
|
||||
dbDir = Directory.current.path;
|
||||
}
|
||||
await databaseFactoryFfi.deleteDatabase(
|
||||
p.join(dbDir, 'sentinel_one.db'));
|
||||
} else {
|
||||
final dbPath = p.join(await getDatabasesPath(), 'sentinel_one.db');
|
||||
await deleteDatabase(dbPath);
|
||||
@@ -147,12 +154,73 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
_snack('Base de datos inicializada correctamente', esError: false);
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
_snack('Error al inicializar: $e');
|
||||
final msg = e.toString();
|
||||
if (msg.contains('libsqlite3.so')) {
|
||||
_mostrarErrorSqlite();
|
||||
} else {
|
||||
_snack('Error al inicializar: $e');
|
||||
}
|
||||
} finally {
|
||||
if (mounted) setState(() => _iniciandoBd = false);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Error libsqlite3.so ────────────────────────────────────────────────────
|
||||
void _mostrarErrorSqlite() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => AlertDialog(
|
||||
backgroundColor: AppColors.surfaceHigh,
|
||||
title: Text('Dependencia faltante',
|
||||
style: appHeadline(size: 16, weight: FontWeight.w700,
|
||||
color: AppColors.error)),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'La librería SQLite no está instalada en este sistema Linux.',
|
||||
style: appLabel(size: 13),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text('Abre una terminal y ejecuta:',
|
||||
style: appLabel(size: 12,
|
||||
color: AppColors.onSurfaceVariant)),
|
||||
const SizedBox(height: 8),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.surfaceLowest,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
'sudo apt install libsqlite3-dev',
|
||||
style: appLabel(size: 13,
|
||||
color: AppColors.primary,
|
||||
weight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text('Luego reinicia la aplicación.',
|
||||
style: appLabel(size: 12,
|
||||
color: AppColors.onSurfaceVariant)),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text('Entendido',
|
||||
style: appLabel(size: 13,
|
||||
weight: FontWeight.bold,
|
||||
color: AppColors.primary)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// ── Sincronización ─────────────────────────────────────────────────────────
|
||||
Future<void> _iniciarSincronizacion() async {
|
||||
setState(() => _sincronizando = true);
|
||||
|
||||
Reference in New Issue
Block a user