From b5f44f4d79ad632c72f8840acd177d8a6f8fafc1 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 11 Aug 2025 21:46:59 -0400 Subject: [PATCH 1/3] add help button --- src/App.jsx | 143 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 84 insertions(+), 59 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 03dfbe26..4f86ab2d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1021,78 +1021,103 @@ const DnDFlow = () => { backgroundColor: '#2c2c2c', display: 'flex', alignItems: 'center', + justifyContent: 'space-between', zIndex: 15, borderBottom: '1px solid #ccc' }}> +
+ + + + + +
+ + {/* Help Button */} - - - - From 262bd180a38a08d7b8786159fd914bdbe174f5a3 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 11 Aug 2025 21:48:23 -0400 Subject: [PATCH 2/3] better styling --- src/App.jsx | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 4f86ab2d..86fe6635 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1101,15 +1101,32 @@ const DnDFlow = () => { {/* Help Button */} From 7f94ab55c25adb20c35db5c76d6d5a4fd7d68abc Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Mon, 11 Aug 2025 21:55:51 -0400 Subject: [PATCH 3/3] added version --- src/App.jsx | 37 +++++++++++++++++++++++++++++++++---- src/backend.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 86fe6635..2b074522 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -58,7 +58,9 @@ const DnDFlow = () => { const [dockOpen, setDockOpen] = useState(false); const [logLines, setLogLines] = useState([]); const sseRef = useRef(null); - const append = (line) => setLogLines((prev) => [...prev, line]); + + // for version information + const [versionInfo, setVersionInfo] = useState(null); // const onConnect = useCallback((params) => setEdges((eds) => addEdge(params, eds)), []); @@ -127,6 +129,24 @@ const DnDFlow = () => { } }; + // Function to fetch version information + const fetchVersionInfo = async () => { + try { + const response = await fetch(getApiEndpoint('/version')); + if (response.ok) { + const versionData = await response.json(); + setVersionInfo(versionData); + return versionData; + } else { + console.error('Failed to fetch version information'); + return null; + } + } catch (error) { + console.error('Error fetching version information:', error); + return null; + } + }; + // Function to fetch documentation for a node type const fetchNodeDocumentation = async (nodeType) => { try { @@ -224,6 +244,7 @@ const DnDFlow = () => { useEffect(() => { preloadDefaultValues(); preloadAllDocumentation(); + fetchVersionInfo(); // Fetch version information on component mount }, []); const onDrop = useCallback( @@ -1129,10 +1150,18 @@ const DnDFlow = () => { e.target.style.boxShadow = '0 2px 6px rgba(74, 144, 226, 0.3)'; }} onClick={() => { - // TODO - open modal, navigate to help page, etc. - alert('Help documentation coming soon! Check the README.md file in the repository for current documentation.'); + // Display version information and help + const pathsimVersion = versionInfo?.pathsim_version || 'Loading...'; + const fcsVersion = versionInfo?.fuel_cycle_sim_version || 'Loading...'; + + const message = `Help documentation coming soon!\n\n` + + `Version Information:\n` + + `• PathSim: ${pathsimVersion}\n` + + `• Fuel Cycle Sim: ${fcsVersion}\n\n`; + + alert(message); }} - title="Get help and documentation" + title="Get help, documentation, and version information" > ? diff --git a/src/backend.py b/src/backend.py index 07dde98e..a5aee07d 100644 --- a/src/backend.py +++ b/src/backend.py @@ -142,6 +142,37 @@ def health_check(): ), 200 +# Version information endpoint +@app.route("/version", methods=["GET"]) +def get_version(): + try: + # Get pathsim version + import pathsim + + pathsim_version = getattr(pathsim, "__version__", "Unknown") + + import fuel_cycle_sim + + fcs_version = getattr(fuel_cycle_sim, "__version__", "Unknown") + + return jsonify( + { + "pathsim_version": pathsim_version, + "fuel_cycle_sim_version": fcs_version, + "status": "success", + } + ), 200 + except Exception as e: + return jsonify( + { + "pathsim_version": "Unknown", + "fuel_cycle_sim_version": "Unknown", + "status": "error", + "error": str(e), + } + ), 200 + + @app.route("/default-values-all", methods=["GET"]) def get_all_default_values(): try: