Commit Graph

569 Commits

Author SHA1 Message Date
Arvuno
6819f14448 feat(server): optional default for get_setting_value
get_setting_value returns an empty string when a key is not found,
which forces every call site to remember to treat '' as a sentinel
and provide its own fallback. The fallback is sometimes a hard-coded
default and sometimes a different code path entirely, leading to
inconsistent handling across the codebase.

Add an optional  argument that defaults to '' (preserves
the existing behaviour for every call site) and is returned when
the key is not present. New call sites can opt into a more
meaningful default without changing the function's signature for
existing callers.

Refs #1626.
2026-06-03 19:54:35 +00:00
Jokob @NetAlertX
fb054e9144 merge 2026-05-24 22:08:06 +00:00
Jokob @NetAlertX
c20891d176 Refactor storage path initialization in sync endpoint to use environment variable 2026-05-24 21:28:29 +00:00
jokob-sk
c933376deb BE: SYNC API logging 2026-05-24 22:09:09 +10:00
Jokob @NetAlertX
5910a7c2a1 BE: Refactor sync endpoint to accept JSON payloads and update related tests #1652 2026-05-24 01:11:00 +00:00
Jokob @NetAlertX
0cb7ad6332 BE:Fix push mode for plugins #1652 2026-05-24 00:36:23 +00:00
Jokob @NetAlertX
87a89f3a28 Add active_labels parameter to resolve_devices for selective strategy execution 2026-05-22 23:00:25 +00:00
Jokob @NetAlertX
88231d97c8 Enhance documentation and implement SET_ALWAYS functionality for device name resolution #1650 2026-05-22 22:50:33 +00:00
jokob-sk
292223e062 BE+FE: timestamps for sessions and emails corrected #1639 2026-05-16 14:21:39 +10:00
jokob-sk
bf4e0b4a7c BE+FE: timestamps for sessions and emails corrected #1639 2026-05-16 14:13:59 +10:00
jokob-sk
13f8858319 BE: Less verbose SYNC plugin #1164 2026-05-14 20:36:23 +10:00
Jokob @NetAlertX
9575692a39 Fix unsupported object format handling in UpdateFieldAction and DeleteObjectAction 2026-05-09 23:39:47 +00:00
jokob-sk
8f7f7eaed7 BE: Trigger failing if object non-existent + emoji removal in upgrade message
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-05-10 08:45:52 +10:00
jokob-sk
48e587f580 BE: DEEP_SLEEP #1555 co-author @legionGer
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-04-24 08:09:47 +10:00
jokob-sk
2fa62a2c0c BE: DEEP_SLEEP #1555 co-author @legionGer
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-04-24 07:47:33 +10:00
jokob-sk
604a8312ee BE: DEEP_SLEEP #1555 co-author @legionGer
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-04-24 07:46:09 +10:00
jokob-sk
f5046ff862 BE: DEEP_SLEEP #1555
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-04-22 21:46:37 +10:00
jokob-sk
7c7beaaf96 BE: empty checks fix
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-04-15 10:43:22 +10:00
jokob-sk
c0462984e7 BE: feedback + unify null / empty checks
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-04-15 10:35:09 +10:00
Jokob @NetAlertX
89139fed60 Add update_sync_hub_node function and corresponding tests for backfilling devSyncHubNode #1609 2026-04-14 20:59:36 +00:00
Jokob @NetAlertX
285bd3ec22 Enhance device filters: support label for dropdown options and improve SQL queries #1611 2026-04-14 20:38:37 +00:00
jokob-sk
4267a5c30c FE+BE: Filters
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-04-15 05:51:04 +10:00
Jokob @NetAlertX
c275bf447d fixes 2026-04-13 13:02:34 +00:00
Jokob @NetAlertX
8abecb7a0d PLG: Implement selective recording for Plugins_History to prevent unbounded growth 2026-04-12 23:09:34 +00:00
Jokob @NetAlertX
c80dc9c36a PLG: Centralize SQL condition to skip forced-online devices in event inserts 2026-04-10 22:13:09 +00:00
Jokob @NetAlertX
50be56c8bb PLG: Enhance device event handling for forced-online status #1602 2026-04-10 21:44:03 +00:00
copilot-swe-agent[bot]
a6d3b85614 Fix set-alias endpoint: return HTTP 200 with normalized error key on failure
Agent-Logs-Url: https://github.com/netalertx/NetAlertX/sessions/05ab18a3-4ac2-492d-bb80-67a1cc089bd9

Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-04-08 23:28:50 +00:00
copilot-swe-agent[bot]
e3a4c62d5f Fix set_alias 404 check: simplify to match generic updateDeviceColumn pattern
Agent-Logs-Url: https://github.com/netalertx/NetAlertX/sessions/661c66ce-45e8-4f96-b51d-1bb0b918c669

Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-04-08 23:05:54 +00:00
Jokob @NetAlertX
da8b694a49 Update API documentation and schemas: clarify lock/unlock behavior for device fields and enhance error handling in device alias update 2026-04-08 22:38:43 +00:00
Jokob @NetAlertX
b530a6e635 Enhance API documentation and schemas: add new device field locking/unlocking endpoints and expand allowed column names for updates #1598 2026-04-08 21:57:58 +00:00
Jokob @NetAlertX
bda8ca3bd8 Fix timezone resolution in format_date_iso: handle specific exceptions for invalid configurations 2026-04-05 22:55:02 +00:00
Jokob @NetAlertX
2b3d9549dc Fix timezone handling in format_date_iso: ensure fallback to UTC for invalid configurations 2026-04-05 22:48:44 +00:00
sebingel
4c117db463 Fix elementOptions: rename typo 'ordeable' to 'orderable'
The key 'ordeable' in elementOptions was a long-standing typo for the
correct English word 'orderable'. Since the JS check in settings_utils.js
used the same misspelled key, the feature appeared to work — but it was
relying on the consistent propagation of a typo across the entire codebase.

Two pre-existing entries in front/plugins/ui_settings/config.json already
used the correct spelling 'orderable', but these had no effect because the
JavaScript check (option.ordeable === 'true') never matched them. As a
result, orderable behavior was silently disabled for those two settings.

Changes:
- front/js/settings_utils.js: renamed option.ordeable → option.orderable
  and isOrdeable → isOrderable (6 occurrences, lines 792/823/824/880/1079/
  1192/1228). The JS key check is the authoritative definition of the
  elementOptions property name, so this must change atomically with all
  config files.

- server/initialise.py:245: renamed "ordeable" → "orderable" in the
  hardcoded JSON string for LOADED_PLUGINS setting. This string is the
  source-of-truth for that setting's elementOptions and is not auto-
  generated from the plugin config files.

- front/plugins/*/config.json (33 files, 90 occurrences): renamed all
  "ordeable": "true" entries to "orderable": "true" via sed. All plugins
  used the typo consistently; they must be updated in the same commit to
  avoid a broken intermediate state.

The two formerly broken 'orderable' entries in ui_settings/config.json
are now matched by the corrected JS check and work as intended.

Fixes netalertx/NetAlertX#1584

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 18:28:48 +00:00
Jokob @NetAlertX
3f80d2e57f feat(plugins): Implement /plugins/stats endpoint for per-plugin row counts with optional foreignKey filtering 2026-03-27 21:35:41 +00:00
Jokob @NetAlertX
4daead1f8f feat(plugins): Enhance badge fetching with conditional JSON and GraphQL support 2026-03-27 08:08:44 +00:00
Jokob @NetAlertX
48454f6f2f feat(plugins): Optimize badge fetching by using lightweight JSON instead of GraphQL 2026-03-27 07:30:13 +00:00
Jokob @NetAlertX
7305fd78e3 fix(pagination): Ensure page number is always at least 1 in apply_common_pagination 2026-03-27 06:51:17 +00:00
Jokob @NetAlertX
ec3e4c8988 feat(api): Enhance session events API with pagination, sorting, and filtering
- Added support for pagination (page and limit) in the session events endpoint.
- Implemented sorting functionality based on specified columns and directions.
- Introduced free-text search capability for session events.
- Updated SQL queries to retrieve all events and added a new SQL constant for events.
- Refactored GraphQL types and helpers to support new plugin and event queries.
- Created new GraphQL resolvers for plugins and events with pagination and filtering.
- Added comprehensive tests for new GraphQL endpoints and session events functionality.
2026-03-26 20:57:10 +00:00
jokob-sk
37730301f4 BE: lazy SQL execution caused devIsSleeping to be missing and tiles not show #1569 #1250
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-03-23 09:55:45 +11:00
Jokob @NetAlertX
7278ee8cfa Refactor getTotals method to clarify API contract and ensure stable response structure #1569 #1561 2026-03-21 21:28:42 +00:00
Jokob @NetAlertX
fa22523a0b Refactor device tiles SQL logic to use get_sql_devices_tiles function for improved maintainability Feature Request - Flapping and Sleeping nuances
Fixes #1567
2026-03-21 21:10:37 +00:00
Jokob @NetAlertX
7569923481 Refactor column name replacements to include variations for ObjectPrimaryID and ObjectSecondaryID 2026-03-21 20:55:24 +00:00
Jokob @NetAlertX
d7c7bd2cd2 Enhance SQL templates to prevent duplicate notifications for 'Down Reconnected' devices in event section 2026-03-18 09:57:20 +00:00
Jokob @NetAlertX
b311113575 Fix Spanish translations and improve HTML attributes in config files and report 2026-03-17 11:58:53 +00:00
Jokob @NetAlertX
0a7ecb5b7c Update config.json files to add 'ordeable' option and refactor cacheStrings function for consistency 2026-03-17 09:22:25 +00:00
Jokob @NetAlertX
c7399215ec Refactor event and session column names to camelCase
- Updated test cases to reflect new column names (eve_MAC -> eveMac, eve_DateTime -> eveDateTime, etc.) across various test files.
- Modified SQL table definitions in the database cleanup and migration tests to use camelCase naming conventions.
- Implemented migration tests to ensure legacy column names are correctly renamed to camelCase equivalents.
- Ensured that existing data is preserved during the migration process and that views referencing old column names are dropped before renaming.
- Verified that the migration function is idempotent, allowing for safe re-execution without data loss.
2026-03-16 10:11:22 +00:00
Jokob @NetAlertX
0bb6db155b Merge branch 'next_release' of https://github.com/netalertx/NetAlertX into next_release 2026-03-15 01:42:23 +00:00
Jokob @NetAlertX
7221b4ba96 Keep all local changes while resolving conflicts 2026-03-15 01:19:34 +00:00
Jokob @NetAlertX
f75c53fc5d Implement notification text templates and update related settings for customizable notifications 2026-03-14 23:27:29 +00:00
Jokob @NetAlertX
c9cb1f3fba Add db_count to DeviceResult and update GraphQL response handling; localize Device_NoMatch_Title in multiple languages 2026-03-13 13:08:26 +00:00