@@ -51,7 +51,6 @@ class GraphServer extends GraphLoadSave {
5151 // this.setGraphML(graphXML);
5252 // });
5353 // } else {
54- // // eslint-disable-next-line no-toast.success
5554 // toast.success('Not on server');
5655 // }
5756 // }
@@ -65,7 +64,6 @@ class GraphServer extends GraphLoadSave {
6564
6665 // });
6766 // } else {
68- // // eslint-disable-next-line no-toast.success
6967 // toast.success('Not on server');
7068 // }
7169 // }
@@ -119,7 +117,6 @@ class GraphServer extends GraphLoadSave {
119117 toast . error ( err . response ?. data ?. message || err . message ) ;
120118 } ) ;
121119 } else {
122- // eslint-disable-next-line no-toast.success
123120 toast . success ( 'Not on server' ) ;
124121 }
125122 }
@@ -133,7 +130,6 @@ class GraphServer extends GraphLoadSave {
133130
134131 } ) ;
135132 } else {
136- // eslint-disable-next-line no-toast.success
137133 toast . success ( 'Not on server' ) ;
138134 }
139135 }
@@ -170,12 +166,16 @@ class GraphServer extends GraphLoadSave {
170166 build ( ) {
171167 const graphName = this . getCurrentGraphName ( ) ;
172168 if ( ! graphName ) return ;
173- const url = `${ EXECUTION_ENGINE_URL } /build/${ this . superState . uploadedDirName } `
174- + `?fetch=${ graphName } &unlock=${ this . superState . unlockCheck } `
175- + `&docker=${ this . superState . dockerCheck } `
176- + `&maxtime=${ this . superState . maxTime } `
177- + `¶ms=${ this . superState . params } `
178- + `&octave=${ this . superState . octave } ` ;
169+ const query = new URLSearchParams ( {
170+ fetch : graphName ,
171+ unlock : this . superState . unlockCheck ,
172+ docker : this . superState . dockerCheck ,
173+ maxtime : this . superState . maxTime ,
174+ params : this . superState . params ,
175+ octave : this . superState . octave ,
176+ } ) ;
177+ const url = `${ EXECUTION_ENGINE_URL } /build/${ encodeURIComponent ( this . superState . uploadedDirName ) } `
178+ + `?${ query . toString ( ) } ` ;
179179 this . serverAction ( 'post' , url , {
180180 built : false , ran : true , debugged : true , cleared : false , stopped : false , destroyed : true ,
181181 } , ( res ) => {
@@ -186,7 +186,7 @@ class GraphServer extends GraphLoadSave {
186186 debug ( ) {
187187 const graphName = this . getCurrentGraphName ( ) ;
188188 if ( ! graphName ) return ;
189- const url = `${ EXECUTION_ENGINE_URL } /debug/${ graphName } ` ;
189+ const url = `${ EXECUTION_ENGINE_URL } /debug/${ encodeURIComponent ( graphName ) } ` ;
190190 this . serverAction ( 'post' , url , {
191191 built : false , ran : false , debugged : false , cleared : true , stopped : true , destroyed : true ,
192192 } ) ;
@@ -195,7 +195,7 @@ class GraphServer extends GraphLoadSave {
195195 run ( ) {
196196 const graphName = this . getCurrentGraphName ( ) ;
197197 if ( ! graphName ) return ;
198- const url = `${ EXECUTION_ENGINE_URL } /run/${ graphName } ` ;
198+ const url = `${ EXECUTION_ENGINE_URL } /run/${ encodeURIComponent ( graphName ) } ` ;
199199 this . serverAction ( 'post' , url , {
200200 built : false , ran : false , debugged : false , cleared : true , stopped : true , destroyed : true ,
201201 } ) ;
@@ -204,10 +204,13 @@ class GraphServer extends GraphLoadSave {
204204 clear ( ) {
205205 const graphName = this . getCurrentGraphName ( ) ;
206206 if ( ! graphName ) return ;
207- const url = `${ EXECUTION_ENGINE_URL } /clear/${ graphName } `
208- + `?unlock=${ this . superState . unlockCheck } `
209- + `&maxtime=${ this . superState . maxTime } `
210- + `¶ms=${ this . superState . params } ` ;
207+ const query = new URLSearchParams ( {
208+ unlock : this . superState . unlockCheck ,
209+ maxtime : this . superState . maxTime ,
210+ params : this . superState . params ,
211+ } ) ;
212+ const url = `${ EXECUTION_ENGINE_URL } /clear/${ encodeURIComponent ( graphName ) } `
213+ + `?${ query . toString ( ) } ` ;
211214 this . serverAction ( 'post' , url , {
212215 built : false , ran : true , debugged : true , cleared : false , stopped : true , destroyed : true ,
213216 } ) ;
@@ -216,7 +219,7 @@ class GraphServer extends GraphLoadSave {
216219 stop ( ) {
217220 const graphName = this . getCurrentGraphName ( ) ;
218221 if ( ! graphName ) return ;
219- const url = `${ EXECUTION_ENGINE_URL } /stop/${ graphName } ` ;
222+ const url = `${ EXECUTION_ENGINE_URL } /stop/${ encodeURIComponent ( graphName ) } ` ;
220223 this . serverAction ( 'post' , url , {
221224 built : false , ran : false , debugged : false , cleared : true , stopped : false , destroyed : true ,
222225 } ) ;
@@ -225,15 +228,19 @@ class GraphServer extends GraphLoadSave {
225228 destroy ( ) {
226229 const graphName = this . getCurrentGraphName ( ) ;
227230 if ( ! graphName ) return ;
228- const url = `${ EXECUTION_ENGINE_URL } /destroy/${ graphName } ` ;
231+ const url = `${ EXECUTION_ENGINE_URL } /destroy/${ encodeURIComponent ( graphName ) } ` ;
229232 this . serverAction ( 'delete' , url , {
230233 built : true , ran : false , debugged : false , cleared : false , stopped : false , destroyed : false ,
231234 } ) ;
232235 }
233236
234237 library ( fileName ) {
235- const url = `${ EXECUTION_ENGINE_URL } /library/${ this . superState . uploadedDirName } `
236- + `?filename=${ fileName } &path=${ this . superState . library } ` ;
238+ const query = new URLSearchParams ( {
239+ filename : fileName ,
240+ path : this . superState . library ,
241+ } ) ;
242+ const url = `${ EXECUTION_ENGINE_URL } /library/${ encodeURIComponent ( this . superState . uploadedDirName ) } `
243+ + `?${ query . toString ( ) } ` ;
237244 this . serverAction ( 'post' , url , null ) ;
238245 }
239246
0 commit comments