11import { toast } from 'react-toastify' ;
22import Axios from 'axios' ;
33import { actionType as T } from '../../reducer' ;
4+ import { EXECUTION_ENGINE_URL } from '../../serverCon/config' ;
45import GraphLoadSave from './5-load-save' ;
56// import {
67// postGraph, updateGraph, forceUpdateGraph, getGraph, getGraphWithHashCheck,
@@ -73,7 +74,7 @@ class GraphServer extends GraphLoadSave {
7374 autoClose : false ,
7475 } ) ;
7576 this . dispatcher ( { type : T . SET_LOGS , payload : false } ) ;
76- Axios . post ( `http://127.0.0.1:5000 /build/${ this . superState . uploadedDirName } ?fetch=${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] } &unlock=${ this . superState . unlockCheck } &docker=${ this . superState . dockerCheck } &maxtime=${ this . superState . maxTime } ¶ms=${ this . superState . params } &octave=${ this . superState . octave } ` )
77+ Axios . post ( `${ EXECUTION_ENGINE_URL } /build/${ this . superState . uploadedDirName } ?fetch=${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] } &unlock=${ this . superState . unlockCheck } &docker=${ this . superState . dockerCheck } &maxtime=${ this . superState . maxTime } ¶ms=${ this . superState . params } &octave=${ this . superState . octave } ` )
7778 . then ( ( res ) => { // eslint-disable-next-line
7879 toast . success ( res . data [ 'message' ] ) ;
7980 this . dispatcher ( {
@@ -98,7 +99,7 @@ class GraphServer extends GraphLoadSave {
9899 autoClose : false ,
99100 } ) ;
100101 this . dispatcher ( { type : T . SET_LOGS , payload : false } ) ;
101- Axios . post ( `http://127.0.0.1:5000 /debug/${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] } ` )
102+ Axios . post ( `${ EXECUTION_ENGINE_URL } /debug/${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] } ` )
102103 . then ( ( res ) => { // eslint-disable-next-line
103104 toast . success ( res . data [ 'message' ] )
104105 this . dispatcher ( {
@@ -122,7 +123,7 @@ class GraphServer extends GraphLoadSave {
122123 autoClose : false ,
123124 } ) ;
124125 this . dispatcher ( { type : T . SET_LOGS , payload : false } ) ;
125- Axios . post ( `http://127.0.0.1:5000 /run/${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] } ` )
126+ Axios . post ( `${ EXECUTION_ENGINE_URL } /run/${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] } ` )
126127 . then ( ( res ) => { // eslint-disable-next-line
127128 toast . success ( res . data [ 'message' ] )
128129 this . dispatcher ( {
@@ -146,7 +147,7 @@ class GraphServer extends GraphLoadSave {
146147 autoClose : false ,
147148 } ) ;
148149 this . dispatcher ( { type : T . SET_LOGS , payload : false } ) ;
149- Axios . post ( `http://127.0.0.1:5000 /clear/${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] }
150+ Axios . post ( `${ EXECUTION_ENGINE_URL } /clear/${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] }
150151 ?unlock=${ this . superState . unlockCheck } &maxtime=${ this . superState . maxTime } ¶ms=${ this . superState . params } ` )
151152 . then ( ( res ) => { // eslint-disable-next-line
152153 toast . success ( res . data [ 'message' ] ) ;
@@ -171,7 +172,7 @@ class GraphServer extends GraphLoadSave {
171172 autoClose : false ,
172173 } ) ;
173174 this . dispatcher ( { type : T . SET_LOGS , payload : false } ) ;
174- Axios . post ( `http://127.0.0.1:5000 /stop/${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] } ` )
175+ Axios . post ( `${ EXECUTION_ENGINE_URL } /stop/${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] } ` )
175176 . then ( ( res ) => { // eslint-disable-next-line
176177 toast . success ( res . data [ 'message' ] )
177178 this . dispatcher ( {
@@ -195,7 +196,7 @@ class GraphServer extends GraphLoadSave {
195196 autoClose : false ,
196197 } ) ;
197198 this . dispatcher ( { type : T . SET_LOGS , payload : false } ) ;
198- Axios . delete ( `http://127.0.0.1:5000 /destroy/${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] } ` )
199+ Axios . delete ( `${ EXECUTION_ENGINE_URL } /destroy/${ this . superState . graphs [ this . superState . curGraphIndex ] . fileName . split ( '.' ) [ 0 ] } ` )
199200 . then ( ( res ) => { // eslint-disable-next-line
200201 toast . success ( res . data [ 'message' ] )
201202 this . dispatcher ( {
@@ -219,7 +220,7 @@ class GraphServer extends GraphLoadSave {
219220 autoClose : false ,
220221 } ) ;
221222 // this.dispatcher({ type: T.SET_LOGS, payload: false });
222- Axios . post ( `http://127.0.0.1:5000 /library/${ this . superState . uploadedDirName } ?filename=${ fileName } &path=${ this . superState . library } ` )
223+ Axios . post ( `${ EXECUTION_ENGINE_URL } /library/${ this . superState . uploadedDirName } ?filename=${ fileName } &path=${ this . superState . library } ` )
223224 . then ( ( res ) => { // eslint-disable-next-line
224225 toast . info ( res . data [ 'message' ] )
225226 toast . dismiss ( toastId ) ;
0 commit comments