Commit graph

211 commits

Author SHA1 Message Date
518b49318c
routeros fix 2026-01-23 13:16:02 -06:00
a4335a047a
allow nonroutable for me 2026-01-23 13:10:12 -06:00
a0ba9285dd
bring in snmpkit 2026-01-23 12:52:17 -06:00
80d1864700
mac discovery 2026-01-23 09:22:08 -06:00
7bd3b1f9ec
arp 2026-01-23 08:40:57 -06:00
f402dcb7af
fix mikrotik sensors 2026-01-22 18:07:20 -06:00
639ffd4a2c
better discovery 2026-01-22 17:40:58 -06:00
96fc488023
sanitize snmp data and fix some cpu things 2026-01-22 16:53:01 -06:00
2856a0ccda
improved fallabck detection 2026-01-22 13:43:56 -06:00
d401e0b036
mikrotik improvements 2026-01-22 13:05:28 -06:00
0a4482f974
feat: add 5 new vendor modules and fix dialyzer issues
Vendor modules added:
- Aviat (WTM microwave radios)
- Aruba (wireless controllers and APs)
- CiscoWLC (Cisco wireless LAN controllers)
- Teltonika (RUTOS LTE routers)
- Sub10 (mmWave backhaul radios)

Dialyzer fixes:
- Fix unknown type Devices.t/0 in alert.ex and device.ex
- Fix unmatched_return warnings across multiple files
- Add :exq to PLT for Exq function detection
- Remove dead code in base.ex, dynamic.ex, vendor.ex
- Fix Device.t() type spec to allow nil name field

Tests: 1437 tests, 0 failures
Dialyzer: 0 errors
Credo: no issues
2026-01-22 09:34:50 -06:00
605f8c09ec
feat: add discovered sensors table to debug tab
Display discovered sensors in a parsed table format showing type,
description, OID, value with unit, and state description for state
sensors.
2026-01-21 17:18:44 -06:00
12875d7f48
fix device table 2026-01-21 14:44:16 -06:00
c26e379dd7
fix device update handler 2026-01-21 14:42:55 -06:00
1b7c4f6a6a
update 2026-01-21 12:31:01 -06:00
8509a4a64c
feat: display neighbor IP address in device neighbors tab 2026-01-21 11:01:48 -06:00
3abd70e133
use password for user regi 2026-01-21 09:13:08 -06:00
c54b5d81bb
more dark mode 2026-01-20 17:23:11 -06:00
fbad8c64b2
dark mode 2026-01-20 16:56:49 -06:00
23c92b2c44
more tests 2026-01-20 16:38:53 -06:00
00f704cd83
updated agent code 2026-01-19 14:10:54 -06:00
ceded37d9c
improve agent 2026-01-19 13:38:43 -06:00
77d4b25da7
test cleanup 2026-01-19 13:29:38 -06:00
fe7a44e5e2
test improvements 2026-01-19 12:08:48 -06:00
d78c42c8f4
test improvements 2026-01-18 17:15:44 -06:00
1f123bbeb9
add honeybadger and snmp overhaul 2026-01-18 16:16:08 -06:00
adec4b134f
snmp overhaul 2026-01-18 16:00:01 -06:00
94311a48aa
discovery fix and favicon 2026-01-18 13:47:19 -06:00
2324b75e47
fix device identification 2026-01-18 13:35:33 -06:00
55fa754a25
add force rediscovery per site 2026-01-18 13:22:17 -06:00
b325b253f1
add texas footer 2026-01-18 13:16:20 -06:00
6706613f24
add texas footer 2026-01-18 13:15:27 -06:00
212744365f
fix: add timezone attribute to form layouts 2026-01-18 13:07:07 -06:00
9c2f08317f
feat: remove organization slug from sites and devices URLs
- Created new on_mount hook :load_default_organization that automatically loads user's first organization
- Moved sites and devices routes to root path (/ sites, /devices) instead of /orgs/:org_slug
- Updated all navigation links and route references throughout the app
- Dashboard, alerts, and agents still use org-specific routes (/orgs/:org_slug)
- Users can still switch organizations via org selector for other pages
2026-01-18 13:06:23 -06:00
dc9400e6ae
fix: adjust graph x-axis range based on selected time period
- Pass range parameter to SensorChart hook via data-range attribute
- Calculate x-axis min/max dynamically based on selected range (1h, 6h, 12h, 24h, 7d, 30d)
- Show date + time on x-axis labels for ranges > 24 hours
- Show time only for ranges <= 24 hours
- Fixes issue where 7d and 30d graphs showed incorrect time range
2026-01-18 12:56:44 -06:00
16bfd7667d
fix: pass timezone attribute to all layout components 2026-01-18 12:49:01 -06:00
9d667ac162
fix: use Map.get for timezone in layouts to handle missing assigns 2026-01-18 12:46:27 -06:00
d8ee0320dc
fix: use @timezone instead of assigns[:timezone] in footer calls 2026-01-18 12:43:35 -06:00
442a79baa7
fix: use proper function head for default values with multiple clauses 2026-01-18 12:41:39 -06:00
139eb3b147
fix: display deploy timestamp in user's timezone in footer 2026-01-18 12:24:52 -06:00
3dc22b118d
fix: display deploy timestamp in user's timezone in footer 2026-01-18 12:20:59 -06:00
d2e38e351e
feat: display all timestamps in user's timezone
- Add timezone to socket assigns in mount_current_scope
- Detect user timezone from browser using Intl.DateTimeFormat
- Auto-save detected timezone to user profile on first connection
- Update all templates to use TimeHelpers with timezone parameter
- Update agent helper functions to accept timezone parameter
- Templates updated:
  - Alert list (triggered, acknowledged, resolved)
  - Device list (last checked)
  - Agent list and show (created, last seen, updated)
  - Admin dashboard (impersonation logs)
  - Admin org/user lists (created/joined dates)
  - Main dashboard (alert times)
2026-01-18 12:19:17 -06:00
e4b3778da4
exq improvements 2026-01-18 11:50:19 -06:00
dab3e29025
fix(telemetry): add comprehensive error handling for Exq API calls
Wrapped all Exq.Api calls in individual try/rescue/catch blocks to handle
GenServer exits and exceptions when Exq hasn't connected to Redis yet.

The "GenServer Exq terminating" errors in logs are from Exq itself crashing
when it receives calls before it's ready, not from our code. These will still
appear in logs as Exq restarts, but our telemetry code won't crash.

Changes:
- Added try/rescue/catch around each queue_size call in the loop
- Added try/rescue/catch around processes/busy calls
- Kept outer try/rescue/catch as a final safety net
- rescue blocks must come before catch blocks in Elixir
2026-01-18 11:32:58 -06:00
eb9ba57f2e
fix(telemetry): handle Exq/Redis connection errors gracefully
Changed pattern matching to proper error handling in telemetry functions
to prevent crashes when Exq or Redis connections aren't available.

Issues fixed:
1. Exq.Api.queue_size/2 calls were using pattern matching {:ok, size} =
   which crashed with FunctionClauseError when Exq wasn't connected to Redis

2. Redix.start_link/1 and Redix.command/2 calls were using pattern matching
   which crashed when Redis wasn't available

Changes:
- publish_exq_stats: Use case statements for queue_size calls
- publish_exq_stats: Use with statement for processes/busy calls
- publish_redis_stats: Use with statement for all Redis operations

This allows the app to start and run even when Redis/Exq connections
aren't immediately available, which is especially important during
container startup and rolling deployments.
2026-01-18 11:25:26 -06:00
a6a2c1cbde
fix(telemetry): use is_nil instead of not for Process.whereis check
The `not` operator in Elixir only works with booleans, not nil values.
When Exq process doesn't exist, Process.whereis(Exq) returns nil, causing
`:badarg` error when used with `not`.

Error:
  Class=:error
  Reason=:badarg
  {:erlang, :not, [nil], [error_info: %{module: :erl_erts_errors}]}

Changed from:
  not Process.whereis(Exq)

To:
  is_nil(Process.whereis(Exq))

This properly checks if the process exists without causing runtime errors.
2026-01-18 11:14:15 -06:00
dcb875ea8c
fix(ui): fix API token success modal z-index issue
The token success modal was missing z-index classes that caused the modal
content to appear behind the grey backdrop. Users could only see the
checkmark icon and couldn't interact with the modal properly.

Changes:
- Added z-0 class to backdrop div
- Added relative z-10 classes to span and modal content div
- Added unique ID to modal (token-success-modal)
- Added unique ID to modal title (token-success-modal-title)

This matches the z-index structure used in the "add token" modal.
2026-01-18 11:10:29 -06:00
8e38e19510
fix duplicate modal-title IDs in user settings 2026-01-18 11:01:05 -06:00
5f8041dcc3
fix API token creation and add raw ICMP ping to Rust agent
API token creation fix:
- Handle both nested (%{"token" => %{...}}) and flat params
- Support URL-encoded form data from LiveView
- Add validation for required name and organization_id fields

Rust agent raw ICMP ping implementation:
- New ping module with async ICMP echo request/reply
- Build ICMP packets manually with proper checksum calculation
- Use socket2 for raw socket creation (requires CAP_NET_RAW)
- Parse both raw ICMP and IP-wrapped responses
- Include unit tests for checksum and packet building
- Dependencies: socket2 v0.5, rand v0.8
- Compiles successfully with release profile optimizations
2026-01-18 10:58:46 -06:00
1b4b7f1773
fix user deletion bug and implement timezone support
User deletion bug:
- Store client IP in socket assigns during mount
- Access stored IP during delete event instead of connect_info
- Fixes RuntimeError when attempting to delete users

Timezone support:
- Add timezone offset maps for common timezones (no external deps)
- Implement shift_timezone/2 helper using DateTime.add/3
- Add timezone-aware format_datetime/2, format_date/2, format_iso8601/2
- Keep backwards-compatible 1-arity versions defaulting to UTC
- Add comprehensive test coverage for timezone conversions
- All tests passing (23 tests, 0 failures)

Note: Timezone offsets are standard time only (no DST handling)
Common timezones supported: America/New_York, America/Los_Angeles,
Europe/London, Europe/Paris, Asia/Tokyo, Asia/Shanghai, Australia/Sydney
2026-01-18 10:51:11 -06:00