feat(topology): M2 - API-driven demo page with layout tables and dynamic rendering
- Add diagram_layouts and diagram_nodes tables - Seed layout coordinates extracted from SVG - Extend snapshot API to return layout data - Rewrite demo page to fetch from API dynamically - Support ?mission= and ?at= URL parameters - Modal details populated from database component data - Show/hide nodes based on component existence at snapshot time Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# topology_api/routes/snapshot.py
|
||||
from flask import Blueprint, request, jsonify
|
||||
from topology_api.queries.snapshot_queries import resolve_snapshot_time, fetch_snapshot
|
||||
from topology_api.queries.snapshot_queries import (
|
||||
resolve_snapshot_time, fetch_snapshot, fetch_layout,
|
||||
)
|
||||
|
||||
snapshot_bp = Blueprint("snapshot", __name__)
|
||||
|
||||
@@ -47,6 +49,7 @@ def get_snapshot(base_code):
|
||||
})
|
||||
|
||||
data = fetch_snapshot(snapshot_at)
|
||||
layout = fetch_layout()
|
||||
|
||||
return jsonify({
|
||||
"base": data["base"],
|
||||
@@ -58,4 +61,5 @@ def get_snapshot(base_code):
|
||||
},
|
||||
"components": data["components"],
|
||||
"connections": data["connections"],
|
||||
"layout": layout,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user