Commit Graph

31 Commits

Author SHA1 Message Date
benjamin.baker
e0a7a51d46 Fix fleet alert server surface inherited from wj
The wj merge brought in a half-built fleet alert feature: server-side UI
behaviour still being stood up over a delivery proof of concept. It left
five red tests. This clears them and fixes a real hole underneath.

The cross-machine guard never ran. acknowledge_fleet_alert read .assetid
off _resolve_asset_for_hostname, which returns the id itself, so the
check raised AttributeError on every call and answered 500. That guard is
what stops one endpoint acknowledging another's alert, and the collector
key is shared across the fleet, so until now any bay could clear an alert
on another machine's behalf. Compare the id directly.

Gate both alert routes the way the rest of the agent channel is gated.
They are collector-key authenticated, not JWT+role, because a shop floor
bay has no user session - the same shape as claim_next_command and
upload_operator_report. Declared in the authz allowlists with the reason,
rather than inventing a permission no agent could hold.

Settle the delivery contract ahead of the durable agent work. The poll
response is authoritative for a host: every alert that should be live on
it right now. An alert absent from the feed is the agent's instruction to
retire the pending toast, which is how a server-side close or cancel
reaches a machine already displaying one. Acknowledgement is terminal per
product decision, so a close after an ack is a no-op and the agent can
retry a queued ack safely. A toast that merely timed out is not an
acknowledgement.

Stop reaching past the plugin contract surface for the mailer. One import
was a plain redirect; the other pulled a private helper to pre-check
recipients, duplicating what send_alert already does. It also returned
early when no email recipients existed, which silently suppressed the
independent webhook leg - misconfigured SMTP was dropping Teams alerts.

Register NotificationAcknowledgement in get_models() and give the
notifications plugin ownership of notificationacknowledgements, then move
the expected head to notifications0006fleetalerts.

Add the coverage whose absence let the .assetid bug ship. Thirteen tests
over gating, authoritative-feed withdrawal, terminal and idempotent
acknowledgement, per-asset scoping, and the cross-machine guard. Five of
them fail against the pre-fix handler.

Remaining suite failures are pre-existing and local: the symlink scan
needs elevation, and the docs check wants files absent from this checkout.
2026-09-09 13:20:54 -04:00
Proudlock
6340648ad9 Fix notifications fleet alert migration for MySQL and add UI fields
- Change alertscope from JSONB to TEXT for MySQL compatibility
- Add Alert Fleet checkbox, scope, and timeout fields to notification form
- Fields appear conditionally when Alert Fleet is checked
2026-09-08 16:57:00 -04:00
Proudlock
381cc6c845 Add fleet alert notifications for shop floor PCs
Fleet alerts push server notifications to endpoint PCs via the command pipe.
Operators acknowledge alerts via toast UI in the tray. Backend tracks
acknowledgements per asset to prevent re-showing dismissed alerts.

Backend: alertfleet/alertscope/alerttimeout columns, GET/POST /api/endpoints/alerts,
NotificationAcknowledgement model with unique constraint, hostname validation.

Frontend: Alert Fleet checkbox in notification form.

Agent: FleetAlertClient polls alerts, FleetAlertStore tracks acknowledged IDs,
FleetAlertForm displays toast (no auto-dismiss), FleetAlertWorker 60s polling.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-09-08 16:19:14 -04:00
ff9ae693a6 Remediate the 2026-09-03 feature-test findings 2026-09-03 17:14:53 -04:00
870e068c44 Rebuild the dashboard around what needs a person
The board was one card per source in a fixed grid: every source got the same
small box whatever it had to say (warranties showed 5 of 50), and a box per
source flattened priority, while the largest type on the page belonged to counts
that need nobody.

Now a severity rollup, one worst-first queue of everything needing a person, and
a row of context beneath. The queue is full width, capped per source so a noisy
check cannot bury a rare one, and names what did not fit with a link to it. Chips
filter the queue by check as well as by severity; both narrow what is already
loaded, so the counts and rows cannot disagree.

Dropped: an 'All assets' tile shown beside its own four addends, a printer strip
carrying the same count a third time, three cards whose job was to display 0, and
a Recent Devices table listing five machines all 'In Use'.

Contract 0.26.0 adds optional 'shortname' on dashboard cards - a title is written
as a heading and ran wider than the hostname it qualified as a row badge.

Also: the supplies card reported 'Low Supplies 0' when Zabbix was unreachable,
which reads as reassurance rather than the truth that nothing could see the
cartridges. It now distinguishes unreachable (says so) from unconfigured (stays
quiet - the site declined the feature) from a real zero.

Full suite 2182 passed, frontend 314 passed.
2026-08-29 21:35:03 -04:00
e8f1de811f nav items declare their permission 2026-08-27 14:51:04 -04:00
0c1fbfcc1e read permissions on every GET 2026-08-27 14:26:17 -04:00
4da6c6aa36 guest role; guide section ticking 2026-08-27 13:02:35 -04:00
ece0e15f03 Page past the 100-row cap in pickers and batch label sheets 2026-08-17 14:17:28 -04:00
d32513727b Tech Tools section with a code generator, toner report that names the part, toner forecasting, warranty proof of cover, application uploads 2026-08-12 11:51:38 -04:00
721828b5cb Card refinements 2026-08-11 15:58:15 -04:00
34cb9a5e3e Dashboard polish 2026-08-11 15:28:29 -04:00
3b37603691 Dashboard cards: rebuild deployable dists 2026-08-11 14:31:24 -04:00
d9d08f53ac remote-access protocol collection; dashboard site timezone + badge alignment 2026-08-10 08:36:39 -04:00
8a2a3ee216 Make '+N more' actually show the events behind it 2026-08-08 15:36:42 -04:00
30e51131a3 Take the last scrollbar off the calendar 2026-08-08 15:26:33 -04:00
ece9782461 Fit the calendar to the space it actually has 2026-08-08 15:12:18 -04:00
c9b97fdaaf Stop the calendar growing a scrollbar on a short window 2026-08-08 14:53:08 -04:00
4344adabf1 Board row ordering, type-derived row colours, and clearer upcoming events 2026-08-08 14:24:28 -04:00
7c5b1bc74e Per-type board rows with shared categories, a network device IP field, and two dark-mode dialogs 2026-08-07 10:43:32 -04:00
2f15610cfd Per-type expiry tail on the shopfloor board, and a 2x2 recertification block 2026-08-07 09:28:10 -04:00
c674000ccc Show the kiosk label prefix, and let a plugin declare the settings it owns 2026-08-06 18:17:56 -04:00
07d390789a Modal overlay-close removed from data-entry; console menu grouped 2026-08-05 13:49:34 -04:00
9c530a70db Filter pagination reset; catalog model retype tool 2026-08-05 11:26:40 -04:00
ce550aefc6 notifications: timezone fix + configurable site timezone 2026-07-30 15:09:06 -04:00
cf7b8bc49a dashboard employee names + GE monogram fallback + kiosk startup sweep 2026-07-28 18:24:19 -04:00
6a8a056b9b notifications: start/end for all notification types 2026-07-21 11:09:20 -04:00
23efd760d6 notifications recognition dates + geenforce B2 client 2026-07-21 10:56:00 -04:00
d1592b84c7 ADR-013 Phase 4: all 13 plugin frontends relocated + staging machinery 2026-07-18 23:56:32 -04:00
fce7937b9b Shopfloor feed resolves employee names live when none is stored
Photos already resolved at read time; names only came from the stored
column, so imports without the employee source showed bare SSOs. New
mode-aware display-name resolver backs a live fallback; stored names
still win.
2026-07-17 13:29:35 -04:00
a9d0dfff4a Initial import: shopdb-flask multi-site asset platform
Flask + Vue rewrite of the classic-ASP shopdb, built as a plugin
framework so sister GE Aerospace sites can adopt it. Product version
0.7.0-pre-0.8.0, plugin contract 0.11.0, 966 backend tests.

Key entry points:
- docs/INSTALL-WINDOWS-IIS.md - tested Windows + IIS install runbook
  (own-site and subpath deployment methods)
- docs/PILOT-DEPLOY.md - production pilot: stand up + import + verify
- docs/IMPORT-API.md - schema-agnostic legacy data import contract
- scripts/site_imports/wjf/ - West Jefferson reference import loader
- docs/adr/ - twelve accepted architecture decision records
2026-07-14 07:58:51 -04:00