diff --git a/backend/resources/app/templates/graph-console.tmpl b/backend/resources/app/templates/graph-console.tmpl index 4baf9dae1f..dc859f4467 100644 --- a/backend/resources/app/templates/graph-console.tmpl +++ b/backend/resources/app/templates/graph-console.tmpl @@ -45,10 +45,19 @@ Graph Console

File: {{session.name}} ({{session.file-id}})
- Revision: {{session.revn}}
+ Revision: {{session.revn}}
Schema: {{session.schema-version}}
Loaded at: {{session.loaded-at}}

+

+ Sync: connecting… + +

+ {% if session.projection.stats %}

Projection: @@ -60,6 +69,27 @@ Graph Console +

+ File changes (live) + + Subscribes to the same WebSocket channel the workspace uses + (:subscribe-file:file-change via msgbus). + Edits from other tabs or users appear here; the in-memory graph stays at + the loaded revision until you reload it. + +
Waiting for changes…
+ + + + + + + + + +
+
Cypher query
@@ -105,4 +135,159 @@ Graph Console {% endif %} + +{% if session %} + +{% endif %} {% endblock %} diff --git a/backend/src/app/http/debug.clj b/backend/src/app/http/debug.clj index b0816f2b34..1a03f4cf92 100644 --- a/backend/src/app/http/debug.clj +++ b/backend/src/app/http/debug.clj @@ -381,6 +381,18 @@ {::yres/status 302 ::yres/headers {"location" "/dbg/graph"}}) +(defn graph-reload-handler + "Re-ingest the currently loaded file into the in-memory graph session." + [cfg {:keys [::session/profile-id]}] + (if-let [file-id (some-> (graph.debug/session-info profile-id) :file-id)] + (do + (graph.debug/load-session! cfg profile-id file-id) + {::yres/status 302 + ::yres/headers {"location" "/dbg/graph"}}) + (ex/raise :type :not-found + :code :graph-session-not-loaded + :hint "load a file graph before reloading"))) + (defn graph-query-handler [_cfg {:keys [params ::session/profile-id]}] (let [query (:query params)] @@ -649,6 +661,7 @@ ["/graph-load" {:handler (partial graph-load-handler cfg)}] ["/graph-query" {:handler (partial graph-query-handler cfg)}] ["/graph-unload" {:handler (partial graph-unload-handler cfg)}] + ["/graph-reload" {:handler (partial graph-reload-handler cfg)}] ["/file-import" {:handler (partial import-handler cfg)}] ["/file-raw-export-import" {:handler (partial raw-export-import-handler cfg)}]]]])