more information while sending the node

This commit is contained in:
Laura Klünder 2023-10-05 13:52:52 +02:00
parent 0c9b253d87
commit 1b8d409839
6 changed files with 155 additions and 2 deletions

5
loadproduction.old.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
export C3NAV_CONFIG=/home/laura/Projekte/c3nav/data/c3nav.cfg
ssh root@34c3.c3nav.de "c3nav-manage 34c3 dumpdata mapdata --format json | gzip" | gunzip > production.json
python src/manage.py loaddata --app mapdata production.json
# rm production.json

View file

@ -9,6 +9,9 @@
{% block subcontent %} {% block subcontent %}
<p><a class="button" href="{{ success_url }}">Go back</a></p> <p><a class="button" href="{{ success_url }}">Go back</a></p>
{% if msg_type == "MESH_ROUTE_REQUEST" %}
<p>Route to <a href="{% url "control.mesh_node.detail" pk=msg_data.address %}">{{ msg_data.address }} {% if node_name %} ({{ node_name }}){% endif %}</a></p>
{% endif %}
<div class="columns"> <div class="columns">
<div> <div>
<h4>Sending progress</h4> <h4>Sending progress</h4>

View file

@ -155,6 +155,7 @@ class MeshMessageSendingView(ControlPanelMixin, TemplateView):
"node_names": node_names, "node_names": node_names,
"send_uuid": uuid, "send_uuid": uuid,
**data, **data,
"node_name": node_names[data["msg_data"]["address"]],
"recipients": [(address, node_names[address]) for address in data["recipients"]], "recipients": [(address, node_names[address]) for address in data["recipients"]],
"msg_type": MeshMessageType(data["msg_data"]["msg_id"]).name, "msg_type": MeshMessageType(data["msg_data"]["msg_id"]).name,
} }

View file

@ -0,0 +1,2 @@
def editor_get_object_or_404(model, *q):
return get_object_or_404()

View file

@ -0,0 +1,144 @@
# by file
## access
- AccessRestriction (TitledMixin) → Collection
- AccessRestrictionGroup (TitledMixin) → Collection
- AccessPermissionToken → Offer[Collection[AccessPermission]]
- AccessPermission
- (abstract) AccessRestrictionMixin
## base
- (abstract) SerializableMixin
- (abstract) TitledMixin (SerializableMixin)
- (abstract) BoundsMixin (SerializableMixin)
## graph
- GraphNode(SpaceGeometryMixin) →
- WayType(SerializableMixin) →
- GraphEdge(AccessRestrictionMixin) →
## level
- Level(SpecificLocation) → Place
## locations
- LocationSlug(SerializableMixin)
- (abstract) Location(LocationSlug, AccessRestrictionMixin, TitledMixin)
- (abstract) SpecificLocation(Location)
- LocationGroupCategory(SerializableMixin)
- LocationGroup(Location) → Place
- LocationRedirect(LocationSlug)
- LabelSettings(SerializableMixin) → Place
- (abstract) CustomLocationProxyMixin
- DynamicLocation(CustomLocationProxyMixin, SpecificLocation)
- Position(CustomLocationProxyMixin)
## report
- Report
- ReportUpdate
## source
- Source(BoundsMixin, AccessRestrictionMixin)
## update
- MapUpdate
## geometry/base
- (abstract) GeometryMixin(SerializableMixin)
## geometry/level
- (abstract) LevelGeometryMixin(GeometryMixin)
- Building(LevelGeometryMixin)
- Space(LevelGeometryMixin, SpecificLocation)
- Door(LevelGeometryMixin, AccessRestrictionMixin)
- AltitudeArea(LevelGeometryMixin)
## geometry/space
- (abstract) SpaceGeometryMixin(GeometryMixin)
- Column(SpaceGeometryMixin, AccessRestrictionMixin)
- Area(SpaceGeometryMixin, SpecificLocation)
- Stair(SpaceGeometryMixin)
- Ramp(SpaceGeometryMixin)
- Obstacle(SpaceGeometryMixin)
- LineObstacle(SpaceGeometryMixin)
- POI(SpaceGeometryMixin, SpecificLocation)
- Hole(SpaceGeometryMixin)
- AltitudeMarker(SpaceGeometryMixin)
- LeaveDescription(SerializableMixin)
- CrossDescription(SerializableMixin)
- WifiMeasurement(SpaceGeometryMixin)
# by inheritance
- (abstract) base.SerializableMixin
- (abstract) base.TitledMixin (Serializable)
- (abstract) base.BoundsMixin (Serializable)
- (abstract) locations.CustomLocationProxyMixin
- (abstract) geometry.base.GeometryMixin (Serializable)
- (abstract) access.AccessRestrictionMixin
- (abstract) geometry.level.LevelGeometryMixin (Geometry)
- (abstract) geometry.space.SpaceGeometryMixin (Geometry)
- graph.GraphNode (SpaceGeometry)
- graph.WayType (Serializable)
- graph.GraphEdge (AccessRestriction)
- access.AccessRestriction (Titled)
- access.AccessRestrictionGroup (Titled)
- access.AccessPermissionToken
- access.AccessPermission
- locations.LocationSlug (Serializable)
- *(has a slug)*
- locations.LocationRedirect (Serializable)
- (abstract) locations.Location (Serializable, AccessRestriction, Titled)
- *(can_search/can_describe/icon)*
- locations.LocationGroup (Serializable, AccessRestriction, Titled)
- (abstract) locations.SpecificLocation (Serializable, AccessRestriction, Titled)
- *(groups, label_setting, label_override*
- locations.DynamicLocation (CustomLocationProxy)
- level.Level
- geometry.level.Space (LevelGeometry)
- geometry.space.Area (SpaceGeometry)
- geometry.space.POI (SpaceGeometry)
- locations.LocationGroupCategory (Serializable)
- locations.LabelSettings (Serializable)
- locations.Position (CustomLocationProxy)
- source.Source(Bounds, AccessRestriction)
- report.Report
- report.ReportUpdate
- update.MapUpdate
- geometry.level.Building (LevelGeometry)
- geometry.level.Door (LevelGeometry, AccessRestriction)
- geometry.level.AltitudeArea (LevelGeometry)
- geometry.space.Column(SpaceGeometry, AccessRestriction)
- geometry.space.Stair(SpaceGeometry)
- geometry.space.Ramp(SpaceGeometry)
- geometry.space.Obstacle(SpaceGeometry)
- geometry.space.LineObstacle(SpaceGeometry)
- geometry.space.Hole(SpaceGeometry)
- geometry.space.AltitudeMarker(SpaceGeometry)
- geometry.space.WifiMeasurement(SpaceGeometry)
- geometry.space.LeaveDescription(Serializable)
- geometry.space.CrossDescription(Serializable)

View file

@ -116,7 +116,6 @@ class MeshConsumer(WebsocketConsumer):
self.remove_dst_nodes((data["address"], )) self.remove_dst_nodes((data["address"], ))
def mesh_send(self, data): def mesh_send(self, data):
print("mesh_send", data)
self.send_msg(MeshMessage.fromjson(data["msg"]), data["sender"]) self.send_msg(MeshMessage.fromjson(data["msg"]), data["sender"])
def log_received_message(self, src_node: MeshNode, msg: messages.MeshMessage): def log_received_message(self, src_node: MeshNode, msg: messages.MeshMessage):
@ -262,7 +261,6 @@ class MeshUIConsumer(JsonWebsocketConsumer):
self.send_json(data) self.send_json(data)
def mesh_msg_received(self, data): def mesh_msg_received(self, data):
print('got received', data)
for key, filter_value in self.msg_received_filter.items(): for key, filter_value in self.msg_received_filter.items():
value = data.get(key, data["msg"].get(key, None)) value = data.get(key, data["msg"].get(key, None))
if isinstance(filter_value, list): if isinstance(filter_value, list):