File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed
Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,26 @@ const render = createRender(() => {
286286 }
287287 }
288288
289+ const saveFunction = ( dateTime ) => {
290+ console . log ( 'save_workflow at ' , dateTime ) ;
291+ if ( model ) {
292+ model . set ( "commands" , `save_workflow at ${ dateTime } ` ) ;
293+ model . save_changes ( ) ;
294+ } else {
295+ console . error ( 'model is undefined' ) ;
296+ }
297+ }
298+
299+ const loadFunction = ( dateTime ) => {
300+ console . log ( 'load_workflow at ' , dateTime ) ;
301+ if ( model ) {
302+ model . set ( "commands" , `load_workflow at ${ dateTime } ` ) ;
303+ model . save_changes ( ) ;
304+ } else {
305+ console . error ( 'model is undefined' ) ;
306+ }
307+ }
308+
289309 return (
290310 < div style = { { position : "relative" , height : "800px" , width : "100%" } } >
291311 < UpdateDataContext . Provider value = { updateData } >
@@ -325,13 +345,13 @@ const render = createRender(() => {
325345 </ button >
326346 < button
327347 style = { { position : "absolute" , left : "120px" , top : "10px" , zIndex : "4" } }
328- /* onClick={() => macroFunction(macroName)}*/
348+ onClick = { ( ) => saveFunction ( currentDateTime ) }
329349 >
330350 Save Workflow
331351 </ button >
332352 < button
333353 style = { { position : "absolute" , left : "230px" , top : "10px" , zIndex : "4" } }
334- /* onClick={() => macroFunction(macroName)}*/
354+ onClick = { ( ) => loadFunction ( currentDateTime ) }
335355 >
336356 Load Workflow
337357 </ button >
Original file line number Diff line number Diff line change @@ -267,9 +267,23 @@ def on_value_change(self, change):
267267 elif global_command == 'run_workflow' :
268268 if self .accordion_widget is not None :
269269 self .accordion_widget .selected_index = 1
270+ self .out_widget .clear_output ()
270271 out = self .wf .run ()
271272 display (out )
272273
274+ elif global_command == 'save_workflow' :
275+ if self .accordion_widget is not None :
276+ self .accordion_widget .selected_index = 1
277+ # self.wf.save()
278+ print ("Functionality not yet implemented" )
279+
280+ elif global_command == 'load_workflow' :
281+ if self .accordion_widget is not None :
282+ self .accordion_widget .selected_index = 1
283+ # self.wf.load()
284+ print ("Functionality not yet implemented" )
285+
286+
273287 def update (self ):
274288 nodes = get_nodes (self .wf )
275289 edges = get_edges (self .wf )
You can’t perform that action at this time.
0 commit comments