@@ -58,7 +58,9 @@ const DnDFlow = () => {
5858 const [ dockOpen , setDockOpen ] = useState ( false ) ;
5959 const [ logLines , setLogLines ] = useState ( [ ] ) ;
6060 const sseRef = useRef ( null ) ;
61- const append = ( line ) => setLogLines ( ( prev ) => [ ...prev , line ] ) ;
61+
62+ // for version information
63+ const [ versionInfo , setVersionInfo ] = useState ( null ) ;
6264
6365 // const onConnect = useCallback((params) => setEdges((eds) => addEdge(params, eds)), []);
6466
@@ -127,6 +129,24 @@ const DnDFlow = () => {
127129 }
128130 } ;
129131
132+ // Function to fetch version information
133+ const fetchVersionInfo = async ( ) => {
134+ try {
135+ const response = await fetch ( getApiEndpoint ( '/version' ) ) ;
136+ if ( response . ok ) {
137+ const versionData = await response . json ( ) ;
138+ setVersionInfo ( versionData ) ;
139+ return versionData ;
140+ } else {
141+ console . error ( 'Failed to fetch version information' ) ;
142+ return null ;
143+ }
144+ } catch ( error ) {
145+ console . error ( 'Error fetching version information:' , error ) ;
146+ return null ;
147+ }
148+ } ;
149+
130150 // Function to fetch documentation for a node type
131151 const fetchNodeDocumentation = async ( nodeType ) => {
132152 try {
@@ -224,6 +244,7 @@ const DnDFlow = () => {
224244 useEffect ( ( ) => {
225245 preloadDefaultValues ( ) ;
226246 preloadAllDocumentation ( ) ;
247+ fetchVersionInfo ( ) ; // Fetch version information on component mount
227248 } , [ ] ) ;
228249
229250 const onDrop = useCallback (
@@ -1021,78 +1042,128 @@ const DnDFlow = () => {
10211042 backgroundColor : '#2c2c2c' ,
10221043 display : 'flex' ,
10231044 alignItems : 'center' ,
1045+ justifyContent : 'space-between' ,
10241046 zIndex : 15 ,
10251047 borderBottom : '1px solid #ccc'
10261048 } } >
1049+ < div style = { { display : 'flex' , alignItems : 'center' } } >
1050+ < button
1051+ style = { {
1052+ padding : '10px 20px' ,
1053+ margin : '5px' ,
1054+ backgroundColor : activeTab === 'graph' ? '#78A083' : '#444' ,
1055+ color : 'white' ,
1056+ border : 'none' ,
1057+ borderRadius : 5 ,
1058+ cursor : 'pointer' ,
1059+ } }
1060+ onClick = { ( ) => setActiveTab ( 'graph' ) }
1061+ >
1062+ Graph Editor
1063+ </ button >
1064+ < button
1065+ style = { {
1066+ padding : '10px 20px' ,
1067+ margin : '5px' ,
1068+ backgroundColor : activeTab === 'events' ? '#78A083' : '#444' ,
1069+ color : 'white' ,
1070+ border : 'none' ,
1071+ borderRadius : 5 ,
1072+ cursor : 'pointer' ,
1073+ } }
1074+ onClick = { ( ) => setActiveTab ( 'events' ) }
1075+ >
1076+ Events
1077+ </ button >
1078+ < button
1079+ style = { {
1080+ padding : '10px 20px' ,
1081+ margin : '5px' ,
1082+ backgroundColor : activeTab === 'solver' ? '#78A083' : '#444' ,
1083+ color : 'white' ,
1084+ border : 'none' ,
1085+ borderRadius : 5 ,
1086+ cursor : 'pointer' ,
1087+ } }
1088+ onClick = { ( ) => setActiveTab ( 'solver' ) }
1089+ >
1090+ Solver Parameters
1091+ </ button >
1092+ < button
1093+ style = { {
1094+ padding : '10px 20px' ,
1095+ margin : '5px' ,
1096+ backgroundColor : activeTab === 'globals' ? '#78A083' : '#444' ,
1097+ color : 'white' ,
1098+ border : 'none' ,
1099+ borderRadius : 5 ,
1100+ cursor : 'pointer' ,
1101+ } }
1102+ onClick = { ( ) => setActiveTab ( 'globals' ) }
1103+ >
1104+ Global Variables
1105+ </ button >
1106+ < button
1107+ style = { {
1108+ padding : '10px 20px' ,
1109+ margin : '5px' ,
1110+ backgroundColor : activeTab === 'results' ? '#78A083' : '#444' ,
1111+ color : 'white' ,
1112+ border : 'none' ,
1113+ borderRadius : 5 ,
1114+ cursor : 'pointer' ,
1115+ } }
1116+ onClick = { ( ) => setActiveTab ( 'results' ) }
1117+ >
1118+ Results
1119+ </ button >
1120+ </ div >
1121+
1122+ { /* Help Button */ }
10271123 < button
10281124 style = { {
1029- padding : '10px 20px' ,
1030- margin : '5px' ,
1031- backgroundColor : activeTab === 'graph' ? '#78A083' : '#444' ,
1032- color : 'white' ,
1033- border : 'none' ,
1034- borderRadius : 5 ,
1035- cursor : 'pointer' ,
1036- } }
1037- onClick = { ( ) => setActiveTab ( 'graph' ) }
1038- >
1039- Graph Editor
1040- </ button >
1041- < button
1042- style = { {
1043- padding : '10px 20px' ,
1044- margin : '5px' ,
1045- backgroundColor : activeTab === 'events' ? '#78A083' : '#444' ,
1125+ padding : '8px 12px' ,
1126+ margin : '5px 15px 5px 5px' ,
1127+ backgroundColor : '#4A90E2' ,
10461128 color : 'white' ,
10471129 border : 'none' ,
1048- borderRadius : 5 ,
1130+ borderRadius : '50%' ,
10491131 cursor : 'pointer' ,
1132+ fontSize : '18px' ,
1133+ fontWeight : '600' ,
1134+ width : '40px' ,
1135+ height : '40px' ,
1136+ display : 'flex' ,
1137+ alignItems : 'center' ,
1138+ justifyContent : 'center' ,
1139+ transition : 'all 0.2s ease' ,
1140+ boxShadow : '0 2px 6px rgba(74, 144, 226, 0.3)' ,
10501141 } }
1051- onClick = { ( ) => setActiveTab ( 'events' ) }
1052- >
1053- Events
1054- </ button >
1055- < button
1056- style = { {
1057- padding : '10px 20px' ,
1058- margin : '5px' ,
1059- backgroundColor : activeTab === 'solver' ? '#78A083' : '#444' ,
1060- color : 'white' ,
1061- border : 'none' ,
1062- borderRadius : 5 ,
1063- cursor : 'pointer' ,
1142+ onMouseEnter = { ( e ) => {
1143+ e . target . style . backgroundColor = '#357ABD' ;
1144+ e . target . style . transform = 'translateY(-1px)' ;
1145+ e . target . style . boxShadow = '0 4px 12px rgba(74, 144, 226, 0.4)' ;
10641146 } }
1065- onClick = { ( ) => setActiveTab ( 'solver' ) }
1066- >
1067- Solver Parameters
1068- </ button >
1069- < button
1070- style = { {
1071- padding : '10px 20px' ,
1072- margin : '5px' ,
1073- backgroundColor : activeTab === 'globals' ? '#78A083' : '#444' ,
1074- color : 'white' ,
1075- border : 'none' ,
1076- borderRadius : 5 ,
1077- cursor : 'pointer' ,
1147+ onMouseLeave = { ( e ) => {
1148+ e . target . style . backgroundColor = '#4A90E2' ;
1149+ e . target . style . transform = 'translateY(0)' ;
1150+ e . target . style . boxShadow = '0 2px 6px rgba(74, 144, 226, 0.3)' ;
10781151 } }
1079- onClick = { ( ) => setActiveTab ( 'globals' ) }
1080- >
1081- Global Variables
1082- </ button >
1083- < button
1084- style = { {
1085- padding : '10px 20px' ,
1086- margin : '5px' ,
1087- backgroundColor : activeTab === 'results' ? '#78A083' : '#444' ,
1088- color : 'white' ,
1089- border : 'none' ,
1090- borderRadius : 5 ,
1091- cursor : 'pointer' ,
1152+ onClick = { ( ) => {
1153+ // Display version information and help
1154+ const pathsimVersion = versionInfo ?. pathsim_version || 'Loading...' ;
1155+ const fcsVersion = versionInfo ?. fuel_cycle_sim_version || 'Loading...' ;
1156+
1157+ const message = `Help documentation coming soon!\n\n` +
1158+ `Version Information:\n` +
1159+ `• PathSim: ${ pathsimVersion } \n` +
1160+ `• Fuel Cycle Sim: ${ fcsVersion } \n\n` ;
1161+
1162+ alert ( message ) ;
10921163 } }
1093- onClick = { ( ) => setActiveTab ( 'results' ) }
1164+ title = "Get help, documentation, and version information"
10941165 >
1095- Results
1166+ ?
10961167 </ button >
10971168 </ div >
10981169
0 commit comments