Skip to content

MeshCore infrastructure page: use mc_is_infrastructure flag (not all observed nodes) #307

@pskillen

Description

@pskillen

Problem

/meshcore/infrastructure currently lists all observed MeshCore nodes in the selected time window (GET /api/nodes/observed-nodes/infrastructure/?protocol=meshcore). That is too broad for an “infrastructure” view.

Filtering by something like type=Repeater would be a poor fit: MeshCore roles are looser and less aligned with Meshtastic’s router/repeater semantics than MT meshtastic_role + INFRASTRUCTURE_ROLES.

Proposed approach

Introduce an explicit mc_is_infrastructure boolean on ObservedNode:

  • Applies to MeshCore observed nodes only (conceptually separate from Meshtastic infrastructure, which stays role-based).
  • Default false; operators mark nodes that should appear on the MC infrastructure page.
  • Do not reuse or conflate with Meshtastic role / meshtastic_role infrastructure logic.

API dependency

Blocked by: meshflow-api#367

Item Notes
Model ObservedNode.mc_is_infrastructure (BooleanField, default False); only meaningful when protocol=MESHCORE
Migration Add field + index if needed for list filters
Infrastructure list GET …/infrastructure/?protocol=meshcore should filter protocol=MESHCORE and mc_is_infrastructure=True (not all MC nodes)
CRUD Endpoint(s) to set/clear the flag on an observed node (PATCH on observed node detail and/or dedicated action)
Permissions Only feeders and admins may set or clear mc_is_infrastructure (Django feeder group + is_staff; align with permissions)
OpenAPI Document field + write operations
Tests Permission matrix + list filter behaviour

UI work (this repo)

  • Consume updated infrastructure API once meshcore filter uses mc_is_infrastructure.
  • Operator UI to toggle the flag (node detail and/or MC infrastructure context), gated to feeder/admin.
  • Copy on MC infrastructure page explaining explicit marking vs automatic MT roles.
  • Update docs/PERMISSIONS.md if new write surface is exposed in UI.

Out of scope

  • Changing Meshtastic infrastructure selection (remains meshtastic_role / INFRASTRUCTURE_ROLES).
  • Inferring MC infrastructure from repeater/type heuristics alone.

Context

  • MC infrastructure page added in PR #306 (branch api-329/pskillen/mc-stats-ui).
  • API currently returns all MC observed nodes for protocol=meshcore infrastructure (PR #366).

Acceptance criteria

  1. MC infrastructure page shows only nodes with mc_is_infrastructure=true.
  2. Feeders and admins can set/clear the flag via API + UI; ordinary users cannot.
  3. MT infrastructure behaviour unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions