Commit Graph
156 Commits
Author SHA1 Message Date
rzuastiandClaude Sonnet 4.6 97e4bb1000 Add About OOTT page with version, links, and legal notices
Implements the /about route with app description, version info,
clickable links to the source repo and AGPL-3.0 license, and
third-party copyright notices. Adds url_launcher for cross-platform
link handling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 17:29:55 -04:00
rzuastiandClaude Sonnet 4.6 93f40b892d Add NOTICE file for Apache-2.0 dependencies
Lists the four Apache-2.0-only backend dependencies (openssl,
rusqlite_migration, sync_wrapper, zopfli) with their copyright holders,
as required by the Apache License 2.0 for distributed works.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 17:07:14 -04:00
rzuastiandClaude Sonnet 4.6 60dbf56327 Add AGPL v3 license
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 17:00:26 -04:00
rzuastiandClaude Sonnet 4.6 e28eb349ba Align frontend device types with backend canonical list
Replaces the old frontend-only `router` type and adds the full set used
by the backend: network_appliance, home_security, home_appliance, watch,
pc, gaming_console. Adds an `apiName` getter to map camelCase enum values
to the snake_case strings the API expects. Updates the unknown device icon
to a question mark.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 16:44:34 -04:00
rzuastiandClaude Sonnet 4.6 23b8858259 Auto-populate device_type from vendor mapping on first device discovery
Loads vendor-device-type.json at compile time (same pattern as mac-vendors-export.json)
and sets device_type when a new device is detected by the ARP scanner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 16:30:54 -04:00
rzuastiandClaude Sonnet 4.6 b4e226d716 Update TODO and regenerate vendor-device-type mapping with LLM classifications
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 16:17:16 -04:00
rzuastiandClaude Sonnet 4.6 55b5f9ad30 Add LLM classification to vendor update script and update dev shell
Adds --llm flag to update_mac_vendors to classify unmatched vendors via
Claude Haiku 4.5, and --skip-download to reuse existing vendor DB.
Adds the anthropic Python package to the Nix dev shell. Updates CLAUDE.md
with the new script command.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 16:08:14 -04:00
rzuastiandClaude Sonnet 4.6 752b6f95fd Expand vendor keyword rules for broader device-type coverage
Adds high-precision keyword fallbacks to the classification rules:
- network_appliance: broadband, wifi, wlan, modem (standalone)
- server: storage, nas
- home_security: surveillance (standalone)
- tv: streaming (standalone)
- phone: handset, cellular

Classified vendors: 374 → 502 (+34%).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 14:50:14 -04:00
rzuastiandClaude Sonnet 4.6 50cc2a9d53 Add MAC vendor update script and vendor-to-device-type mapping
Introduces backend/data/update_mac_vendors, an executable Python 3 script
that downloads the latest MAC vendor database from maclookup.app and
generates vendor-device-type.json — a mapping of vendor names to device
types (phone, laptop, tablet, server, tv, printer, network_appliance,
home_security, home_appliance, watch, pc, gaming_console) used for
auto-assigning device type on first detection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 14:43:04 -04:00
rzuasti fc2d1f1e5f Updated todo 2026-05-28 11:35:49 -04:00
rzuasti babf1aee41 Updated favicons 2026-05-28 11:32:35 -04:00
rzuastiandClaude Sonnet 4.6 dcb0bcaed1 Update docs, TODO progress, and add run/db helper scripts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 11:28:13 -04:00
rzuastiandClaude Sonnet 4.6 3d7f465c99 Style app title as primary-color pill with Barlow Condensed font
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 11:27:45 -04:00
rzuastiandClaude Sonnet 4.6 c34ff42177 Move favicon assets from lib/assets/ to web/ and wire up HTML/manifest
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 11:19:32 -04:00
rzuastiandClaude Sonnet 4.6 e6ec771f3b Simplify and modularize device, notification, and settings screens
Extract inline widget closures into named StatelessWidgets (_DeviceCard,
_DeviceFilterSheet, _NotificationCard), replace magic ints and hardcoded
repeated widgets with enum-driven loops, fix the InputDecorator/DropdownButton
hack in device_actions, merge symmetric _markAsRead/_markAsNew into _setRead,
and remove dead _isLoading/_isSaving state in settings where operations are
synchronous.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 11:14:29 -04:00
rzuastiandClaude Sonnet 4.6 e1287e5a0f Use server-side date filtering for device event history chart
The device event history chart previously fetched all events and filtered
client-side. This wires the existing created_from API parameter to the
frontend so filtering happens in the backend.

Also fixes a bug where the Today filter returned no results: rusqlite was
storing datetimes with a space separator ("YYYY-MM-DD HH:MM:SS+00:00")
while SQL filters used RFC 3339 with a T separator, causing string
comparisons to fail for same-day events. All datetime storage across
device_events, devices, and notifications is now consistently RFC 3339.
A migration converts existing records.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:51:19 -04:00
rzuastiandClaude Sonnet 4.6 2e8604a354 Add created_from date filter to device events list endpoint
Filters events at the query level using the existing composite index
(mac_address, created_on DESC), so no schema changes are needed.
Adds two unit tests covering the filtered and unfiltered cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:16:24 -04:00
rzuastiandClaude Sonnet 4.6 8e3eb96371 Add device event history chart to device details page
Displays a scatter chart timeline of when the device was seen online,
with a time range selector (Today → Last Year). Tooltips show event
date/time, type, and highlight any IP or vendor changes relative to
the current device data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:05:49 -04:00
rzuastiandClaude Sonnet 4.6 e8df0a3980 Mark notification as read when navigating to device
Tapping a notification row or selecting "View device" from the popup
menu now marks the notification as read (if unread) before navigating
to the device detail page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 09:26:14 -04:00
rzuastiandClaude Sonnet 4.6 22d30a146c Document retention.window parameter and add storage sizing guidance
Adds the retention.window option to the NixOS module and documents it
in the README alongside a new Storage considerations section covering
per-network-size estimates and guidance on tuning scan timings and the
retention window to meet storage requirements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 09:18:46 -04:00
rzuastiandClaude Sonnet 4.6 40685837b0 Add indexes on notifications table for query performance
Adds two indexes to eliminate full table scans at scale:
- idx_notifications_created_on (created_on DESC) for purge and unfiltered listing
- idx_notifications_is_new_created_on (is_new, created_on DESC) for filtered listing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 09:06:19 -04:00
rzuastiandClaude Sonnet 4.6 c7e1678407 Add retention policy for device_events and notifications
Purges records older than a configurable window (default 365d) once per day.
Also adds a composite index on device_events(mac_address, created_on DESC) for
efficient scan history queries at scale, and fixes a non-deterministic pagination
order by adding id as a tiebreaker to ORDER BY.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 09:00:36 -04:00
rzuastiandClaude Sonnet 4.6 888f18603f Add device_events table and scan history API endpoint
Records a DeviceEvent row on every scan: NewDevice when a device is first
seen, DeviceSeen on subsequent scans. Exposes GET /api/devices/{mac}/events
with pagination, ordered by date descending.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 21:22:13 -04:00
rzuastiandClaude Sonnet 4.6 47a76c4bf8 Fix run_tests.sh to use sudo with explicit CARGO_HOME
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 20:07:28 -04:00
rzuastiandClaude Sonnet 4.6 18604a6d65 Mark device list owner/type filters task as complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 20:07:22 -04:00
rzuastiandClaude Sonnet 4.6 2007bd2390 Match notification list item appearance to device list card style
Replace the Column+Divider wrapper with a Card widget and move the
dynamic background color from ListTile.tileColor to Card.color,
matching the pattern used in the device list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 20:06:25 -04:00
rzuastiandClaude Sonnet 4.6 171e7516bc Apply M3 filter placement recommendations to device and notification lists
Move status filter chips into AppBar bottom slot (left-aligned, sticky) on
both list screens. On the device list, relocate owner and type filters into
a modal bottom sheet behind a badged filter icon, and dismiss the sheet on
clear so fields always reflect the current filter state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 20:00:59 -04:00
rzuastiandClaude Sonnet 4.6 e7d075ec29 Add owner and device type filters to device list
Owner filter uses a server-side substring match (LIKE '%VALUE%');
device type filter matches the stored value exactly, sending an
empty string for unknown/unclassified devices. Both filters combine
with the existing registration status chip via AND logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 19:46:19 -04:00
rzuastiandClaude Sonnet 4.6 bf74cbb38e Add registered status pill to device list items
Shows the green 'Registered' badge next to the IP address for registered
devices, matching the existing behaviour in the device detail screen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 19:19:13 -04:00
rzuastiandClaude Sonnet 4.6 4b88de1198 Fix device icon color in detail screen to match IP text
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 19:16:29 -04:00
rzuastiandClaude Sonnet 4.6 b15cb46c43 Extract device forget/register dialogs into shared device_actions utility
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 19:13:50 -04:00
rzuastiandClaude Sonnet 4.6 1b470fc28f Extract DeviceType as an enum with icon and label getters
Mirrors the NotificationType pattern. Removes duplicated _deviceTypes
list and _deviceIcon() helper from both device screens, centralising
all type-to-icon logic in the model.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 19:06:09 -04:00
rzuastiandClaude Sonnet 4.6 2da339a2b0 Add device detail screen and navigate to it from notifications and devices
- New /devices/:macAddress route showing all device fields with Register/Forget actions
- Device list items are now tappable; popup menu gains a "View details" item
- Notification list items with a linked device are tappable; popup menu gains a "View device" item
- Backend: new DB migration adds optional mac_address column to notifications
- Device-related notifications (NewDeviceFound, DeviceOnlineAfterTime, DeviceChanged) now store the triggering device's MAC address

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 18:24:35 -04:00
rzuastiandClaude Sonnet 4.6 07f7d54531 Extract snackbar notifications to UISnackbars utility
Centralises all SnackBar calls behind UISnackbars.showError/showSuccess/
showWarning/showInfo, each themed via AppColorExtension. New warning and
info colour tokens added to both themes. Calling any method clears any
visible snackbar before showing the new one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 17:43:01 -04:00
rzuastiandClaude Sonnet 4.6 3094753587 Add Register and Forget actions to devices list
Adds a context menu to each device card with contextual actions:
- Unregistered devices show a Register option (dialog with owner field
  and device type dropdown)
- Registered devices show a Forget option (confirmation dialog)

Also fixes CORS to allow PUT and DELETE methods, adds device type
tooltips on the icon, and renames the "New" filter/badge to
"Not registered".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 15:33:24 -04:00
rzuastiandClaude Sonnet 4.6 d0b9855bad Add devices screen to the Flutter frontend
Lists devices with New/Registered/All filtering, pull-to-refresh,
device-type icons, and visual differentiation between new and registered
devices. Introduces a reusable StatusBadge widget for colour-coded labels.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 14:58:11 -04:00
rzuastiandClaude Sonnet 4.6 6d72ba7202 Update project docs and dev environment
- Add linter commands to CLAUDE.md
- Add clippy to Nix dev shell
- Add TODO.md with project task list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 14:09:02 -04:00
rzuastiandClaude Sonnet 4.6 4f5a228aec Improve notifications list UX with auto-refresh and friendly timestamps
- Show "Just now" for notifications 2 minutes old or less
- Auto-refresh the list every minute, preserving the active filter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 14:08:30 -04:00
rzuastiandClaude Sonnet 4.6 f34dfe8386 Fix all dart analyze warnings in the Flutter frontend
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 13:57:03 -04:00
rzuastiandClaude Sonnet 4.6 cb2b3c6af7 Fix all clippy warnings in the Rust backend
Addresses all 31 warnings emitted by cargo clippy: redundant field
names in struct initialisers, unnecessary unwrap after is_some checks
(replaced with if-let), needless borrows, filter+next replaced with
find, iter().count() replaced with len(), clone on Copy type, and
manual match-to-Option replaced with .ok().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 13:48:33 -04:00
rzuastiandClaude Sonnet 4.6 44d593fccc Add OpenAPI documentation via Utoipa
Annotates all API handlers and model structs with Utoipa macros to generate
an OpenAPI 3.0 spec at runtime. Serves an interactive Swagger UI at /api/docs
and the raw JSON spec at /api/docs/openapi.json, both publicly accessible
outside the auth middleware.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 13:36:05 -04:00
rzuastiandClaude Sonnet 4.6 6002597383 Add mark all as read action to notifications list
Shows a done_all icon button in the AppBar when the New filter is active
and the list is non-empty, calling the notifications/mark_all_as_old endpoint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 12:10:02 -04:00
rzuastiandClaude Sonnet 4.6 bda7b87cc7 Add mark all as old API endpoint for notifications
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 11:55:30 -04:00
rzuastiandClaude Sonnet 4.6 a647e0d061 Add theme selection to settings page
Adds a dropdown in the settings page to switch between available themes
(Catppuccin Mocha, Gruvbox Dark). The selected theme is applied immediately
on save and persisted across restarts via SharedPreferences.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 11:38:16 -04:00
rzuastiandClaude Sonnet 4.6 527e2bd6c8 Style notification list items by read/unread status
Unread notifications (isNew=true) now show a secondaryContainer background,
bold title, and primary-colored icon per Material 3 guidelines. State changes
via mark-as-read/unread update the item's styling immediately in the All filter
view using mapItems with a copyWith, ensuring PagingStateBase's deep equality
check detects the change and triggers a rebuild.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 11:00:46 -04:00
rzuastiandClaude Sonnet 4.6 e320d54b38 Add mark as unread action to notifications list
Adds a "Mark as unread" option to the notification popup menu (shown only
for already-read items) and a swipe-right gesture, mirroring the existing
"Mark as read" actions. Swipe/menu actions respect the active filter:
items are removed from the list only when filtered to New or Old, and
snap back when viewing All.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 10:43:10 -04:00
rzuastiandClaude Sonnet 4.6 c04e76157e Add run.sh and fix run_tests.sh to use user's cargo cache
Add run.sh script to start the backend (erases db, runs cargo with sudo
using user's CARGO_HOME to avoid full recompilation). Remove sudo from
cargo test in run_tests.sh for the same reason.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 10:21:43 -04:00
rzuastiandClaude Sonnet 4.6 8153a216b9 Add mark as new API endpoint for notifications
POST /api/notifications/{id}/mark_as_new sets is_new=1, allowing a notification to be flagged as unread after it has been read.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 10:13:56 -04:00
rzuastiandClaude Sonnet 4.6 913bf0e839 Add mark as read action to notifications list
Users can now mark a notification as read via a popup menu on each list
item or by swiping left. Both actions call the backend API, remove the
item from the list, and show a snackbar confirmation. Swiping an already
read notification shows an error snackbar and bounces the item back.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 09:58:39 -04:00
rzuasti 09b67c2707 Added claude to the dev environment 2026-05-27 08:24:48 -04:00