Commit Graph

50 Commits

Author SHA1 Message Date
f48a5a5495 feat: improve sidebar design - rounded nav items, gradient header accent, better collapsible, refined sublist 2026-06-14 09:48:34 -04:00
36b0d8dfd9 fix: close notification dropdown when opening user menu and vice versa 2026-06-14 09:36:45 -04:00
00bad074d3 fix: remove notifications link from user menu, add view-all button to notification dropdown, fix admin link 2026-06-14 09:31:27 -04:00
74cf9739d6 refactor: replace sidebar user footer with topbar dropdown menu 2026-06-14 09:26:52 -04:00
b7bd4bfe92 fix: append command history row in real-time after execution 2026-06-14 09:12:28 -04:00
49d724cf9c fix: add Accept: application/json to terminal execute fetch 2026-06-14 09:09:40 -04:00
4ce6b27f96 fix: use serverId variable and add Accept: application/json to server-show.js fetch calls 2026-06-14 09:02:13 -04:00
d1da560764 fix: sync CSS classes with refactored layout, restore missing sidebar items, add asset versioning, fix routes and auth 2026-06-14 08:54:37 -04:00
88f3c1f964 refactor: extract inline CSS/JS from views into separate asset files (20+ files)
Phase A — HTML removed from PHP files:
- RateLimitMiddleware.php: heredoc moved to views/errors/429.php
- public/index.php: inline HTML replaced with View::error()
- AuthMiddleware.php: <script> redirect replaced with <meta refresh>

Phase B — Inline CSS/JS extracted from views:
- CSS: landing.css (459 lines), legal.css (shared by terms+privacy)
- JS: 17 new files extracted from ~20 view files
  - main.js (layout sidebar + notifications)
  - dashboard-chart.js, server-show.js, server-services.js
  - nginx-manager.js, database-manager.js
  - terminal.js, team-show.js, team-index.js
  - server-list.js, server-permissions.js (shared by edit+create)
  - server-ssl.js, server-processes.js, system-users.js
  - admin-users.js, audit-log.js, admin-notifications.js, admin-security.js
  - notifications.js

Total: -3264 lines from views, +288 lines in new assets
2026-06-14 08:04:01 -04:00
3639f16757 bump to 1.8.5 (versionCode 17) 2026-06-13 17:51:03 -04:00
19fc37c1f3 fix: remove redundant NotificationPoller to prevent duplicate notifications 2026-06-13 17:44:37 -04:00
a499a1ed8b bump to 1.8.4 (versionCode 16) and rebuild APK 2026-06-13 17:31:32 -04:00
ec38afe3e9 feat: add notifications_enabled toggle for users (web + Android) 2026-06-13 17:31:07 -04:00
585d3e2e76 fix: use created_at_timestamp for Android notification dates; bump to 1.8.3 2026-06-13 17:02:22 -04:00
e1b6650454 feat: notification dropdown panel and /notifications page 2026-06-13 16:48:05 -04:00
25dfb517ee feat: notification bell with modal showing 10 latest notifications 2026-06-13 16:41:56 -04:00
e92f51e36b replace number inputs with range sliders in threshold modal 2026-06-13 16:32:53 -04:00
d37edd7d54 bump to 1.8.2 (versionCode 14) and rebuild APK with FCM registration fix 2026-06-13 14:31:35 -04:00
5ff3b255c4 bump to 1.8.1 (versionCode 13) and rebuild APK 2026-06-13 13:48:51 -04:00
395c84f75e fix: actively fetch FCM token on login if not cached
- LoginViewModel now calls Tasks.await(FirebaseMessaging.getInstance().token)
  to actively fetch the FCM token if not yet saved in prefs
- Previous code relied solely on onNewToken callback, which may not fire
  before the user logs in on a fresh install
2026-06-13 13:23:29 -04:00
988ea118b0 chore: add real Firebase config and messaging dependency
- google-services.json now has real Firebase project values
- Added firebase-messaging-ktx dependency (was missing)
- Updated google-services plugin to 4.4.4
2026-06-13 13:00:54 -04:00
136eebc4c3 feat: Firebase Cloud Messaging push notifications
Backend:
- New user_fcm_tokens table (migration 010) for storing device tokens
- FCMService sends push via Firebase HTTP legacy API (server key from .env)
- POST /api/fcm/register endpoint for Android to register its FCM token
- AdminController::sendNotification() triggers FCM push after DB insert
- FCM config added to config.php

Android:
- Firebase Cloud Messaging service (ServerManagerFirebaseService)
  receives push notifications and shows them via NotificationHelper
- FCM token registered with backend on new token and on login
- google-services.json template (must be replaced with real Firebase config)
- firebase-setup.sh script with configuration instructions
- FCM dependency + google-services plugin added to Gradle
- Bump to v1.8.0 (versionCode 12)
2026-06-13 12:37:40 -04:00
bdc4d73d89 feat(android): foreground service for real-time notification polling
- New NotificationForegroundService: persistent foreground coroutine-based
  polling every 30s, keeps app alive in background
- Manifest: FOREGROUND_SERVICE + FOREGROUND_SERVICE_DATA_SYNC permissions,
  service declaration with foregroundServiceType=dataSync
- NotificationHelper: added silent channel for persistent service notification
- ServerManagerApp: starts foreground service on app launch
- MainActivity: removed redundant NotificationWorker.checkNow (service handles
  background polling; NotificationPoller still handles in-app refresh)
- Bump to v1.8.0 (versionCode 12)
2026-06-13 12:20:09 -04:00
12c3e23d9c feat: track notification read receipts per user
- New notification_reads table (migration 008) with unique (notification_id, user_id)
- Notification model: markAsRead inserts into notification_reads; getForUser JOINs
  to show per-user read status; getUnreadCount checks NOT EXISTS in reads table
- getAll() includes read_count subquery for admin view
- Admin view shows 'X / Y' read count for broadcast notifications,
  'Read'/'Unread' badge for user-targeted ones
- Migrates existing read notifications into notification_reads
- AGENTS.md updated with new conventions
2026-06-13 11:48:05 -04:00
0cfed5bf27 feat: validate required SSH permissions before creating server
- New server_permissions table (migration 007) stores required SSH permissions per server
- PermissionValidator service connects via SSH and validates each permission before save
- ServerPermission model for CRUD on server_permissions table
- Web flow: create/edit forms include dynamic permission rows with quick-add presets
- API flow: serverAdd/serverUpdate accept permissions array, return 400 on failure
- Show view displays required permissions on server detail page
- Form input preserved on validation failure (credentials excluded)
- AGENTS.md updated with new conventions
2026-06-13 10:41:18 -04:00
ae09af3e02 Bump app version to 1.7.2 (versionCode 11) and rebuild APK 2026-06-11 21:31:39 -04:00
c88b46ec80 fix: remove bottom nav padding on server detail screen
Scaffold's innerPadding reserved NavigationBar height even when the
bar was hidden (on detail screens). Content like the services list
had extra empty space at the bottom.

Fix: build custom PaddingValues that only includes bottom padding
when inLoggedInArea is true.
2026-06-11 21:26:34 -04:00
1885693f8d fix: 401 logout loop — sync state update, prevent re-navigation
Root cause: LoginViewModel.logout() was async (viewModelScope.launch),
so _uiState.isConnected remained true after navigating to login.
LoginScreen's LaunchedEffect immediately navigated back to dashboard,
where APIs failed with 401 again → infinite loop.

Fixes:
- SessionManager: add _invalidating flag to prevent concurrent 401 handling
- AuthInterceptor: check isSessionValid before invalidating
- LoginViewModel: update _uiState synchronously in logout(), clear token
  before launching coroutine for prefs.clear()
- LoginViewModel: call SessionManager.restoreSession() after successful login
- MainActivity: remove restoreSession() from logout handler (was incorrectly
  re-validating session right after invalidation)

Bump to v1.7.1 (versionCode 10)
2026-06-11 21:12:39 -04:00
6e4bf2ad1d build: compile APK v1.7.0 (versionCode 9) 2026-06-11 17:26:54 -04:00
4d00f0d8b1 bump to 1.6.1 2026-06-09 19:31:42 -04:00
92bc12355c fix: show stopped services in list + loading bar on action
- API: --all flag in systemctl list-units to show inactive services
- API: removed head -50 limit
- Android: LinearProgressIndicator while service action is running
2026-06-09 19:29:36 -04:00
3e13ac60f1 feat: v1.6.0 — fix service 500, search bar, modal redesign
- Fix 500 error: cast to string before preg_replace
- Search bar to filter services by name/description
- Redesigned service action modal with status badge + colored buttons
- Version 1.6.0
2026-06-09 19:20:18 -04:00
c4277c937f feat: v1.5.0 + service actions + remove duplicate apk
- Services tab: start/stop/restart/reload via dialog
- Backend: POST /api/servers/:id/service-action
- Removed duplicate APK download from dashboard view
- Version bump to 1.5.0
2026-06-09 19:02:41 -04:00
d4ab8c7b40 bump to 1.4.0 2026-06-09 18:31:46 -04:00
eaf3045d13 feat: header gradiente, scrollable tabs, logout en perfil
- Dashboard: header con gradiente, avatar circular con inicial
- ServerDetail: ScrollableTabRow, header gradiente
- Notifications: header gradiente
- Profile: boton Sign Out que redirige a Login
- Bottom nav simplificado (3 items)
- Version 1.3.0
2026-06-09 18:30:23 -04:00
e6717d0578 bump to 1.3.0 + teams filter client-side sin recarga 2026-06-09 18:19:27 -04:00
af3315e6ab feat: dashboard version local, bottom nav simplificado, services+actions tabs
- Dashboard muestra version del gradle (no API)
- Header sin iconos duplicados (notifications solo en bottom nav)
- Bottom nav: Dashboard, Servers, Alerts (sin Profile ni Logout)
- ServerDetail: tab Services con lista de systemd services
- ServerDetail: tab Actions con Test/Reboot/Shutdown
- Backend: API endpoints para services, reboot, shutdown, test
2026-06-09 18:15:04 -04:00
13f14416a4 feat: teams redesign — cards, filter, user autocomplete
- Teams index: cards with animation, search filter
- Team detail: user autocomplete via AJAX (search on type)
- CSS: card grid styles, autocomplete dropdown
- Backend: searchUsers endpoint, filter support
2026-06-09 18:11:20 -04:00
b1fc0e2cfe bump version to 1.2.0 2026-06-09 17:54:47 -04:00
a43e0ae3a4 feat: instant notifications + Notifications screen
- NotificationPoller polls every 30s while app is in foreground
- Poller auto-starts on resume, stops on pause
- New NotificationsScreen with mark-as-read, mark-all-read, infinite scroll
- Bottom nav: Alerts tab with unread badge
- Dashboard: bell icon with unread badge
- Backend: GET /api/notifications/unread-count endpoint
- App version 1.1.0
2026-06-09 17:51:55 -04:00
ddec27ca5c fix: notification worker reliability + version bump to 1.1.0
- Bump android versionCode=2 versionName=1.1.0
- NotificationWorker: use UPDATE policy to reschedule after login
- Immediate notification check on login via LaunchedEffect
- Added logging for debugging notification delivery
- DB already has test notification inserted
- Fixed admin app version form (POST redirect)
2026-06-09 17:31:26 -04:00
1f67fc1fcd feat: push notifications via WorkManager background polling
- NotificationWorker checks for new notifications every 15 min (WorkManager)
- Shows Android system notifications with Mark Read action
- Notification channels for general + alerts
- Permission request on Android 13+
- Boot persistence via WorkManager
- On-app-open immediate notification check
2026-06-09 17:22:01 -04:00
53e9b92a8d feat: admin app version mgmt + notification system
- New tables: app_config, notifications
- Admin views: App Version editor, Notification sender
- API: GET /api/notifications, POST /api/notifications/:id/read, POST /api/notifications/read-all
- App version now stored in DB, editable by super admin
- Notifications: send to all users or specific user
- Android notification models + API client
- Sidebar: App Version + Notifications links for super_admin
2026-06-09 17:06:22 -04:00
3a4e8eb52c feat: add auto-update mechanism with in-app APK download 2026-06-09 16:59:08 -04:00
b613e43ab3 feat: redesign Android app with animations, charts, profile, and registration
- Register screen with validation (username, email, password, confirm)
- Profile screen with email editing and password change
- User greeting on dashboard showing logged-in username
- 401 auto-logout via SessionManager + AuthInterceptor
- MetricsChart with Canvas line graphs (CPU, RAM, Disk)
- Animated StatCard with counters and icons
- ServerCard with progress bars, pulsating status dot, dynamic elevation
- Shimmer loading placeholders
- Dark mode support with Material3
- Navigation transitions (slide + fade)
- New server rack launcher icon
- Splash screen
- Backend API: register, profile (GET/PUT) endpoints
2026-06-09 16:38:04 -04:00
5789c77d9a Fix icon click propagation in sidebar — add pointer-events: none to all nav icons 2026-06-07 13:10:32 -04:00
c45354db11 Fix theme toggle (add light theme CSS) and improve mobile sidebar usability 2026-06-07 13:02:31 -04:00
cd24cc53a0 Add per-column filters, smart pagination (25/page), and date range filter to audit logs 2026-06-07 12:43:50 -04:00
516ffbb579 Add user registration page with default operator role 2026-06-06 19:41:03 -04:00
9c0bc7f189 ServerManager project files 2026-06-06 17:58:34 -04:00