|
278 | 278 | this_env = this; |
279 | 279 | gateway_remote_flash(this.flash_url + "/flash", farg).then( function(data) { |
280 | 280 | this_env.flashing = false; |
281 | | - console.log(JSON.stringify(data, null, 2)); |
| 281 | + console.log("Message:"+ JSON.stringify(data, null, 2)); |
| 282 | + if (JSON.stringify(data, null, 2).includes('TypeError: NetworkError')) { |
| 283 | + show_notification('Gateway not available at the moment. Please, execute python3 gateway.py, heck if port 8080 works fine and connect your board first\n', 'danger'); |
| 284 | + } |
282 | 285 | if (JSON.stringify(data, null, 2).includes('Flash completed successfully')) { |
283 | 286 | show_notification('Flashing program success.', 'success'); |
284 | 287 | } |
|
308 | 311 | this_env.stoprunning = false; |
309 | 312 | //show_notification(data, 'danger') ; |
310 | 313 | console.log(JSON.stringify(data, null, 2)); |
| 314 | + if (JSON.stringify(data, null, 2).includes('TypeError: NetworkError')) { |
| 315 | + show_notification('Gateway not available at the moment. Please, execute python3 gateway.py, heck if port 8080 works fine and connect your board first\n', 'danger'); |
| 316 | + } |
311 | 317 | if (JSON.stringify(data, null, 2).includes('Process stopped')) { |
312 | 318 | show_notification('Process stopped.', 'success'); |
313 | 319 | } |
|
336 | 342 | gateway_remote_monitor(this.flash_url + "/monitor", farg).then( function(data) { |
337 | 343 | this_env.running = false; |
338 | 344 | console.log(JSON.stringify(data, null, 2)); |
| 345 | + if (JSON.stringify(data, null, 2).includes('TypeError: NetworkError')) { |
| 346 | + show_notification('Gateway not available at the moment. Please, execute python3 gateway.py, heck if port 8080 works fine and connect your board first\n', 'danger'); |
| 347 | + } |
339 | 348 | if (JSON.stringify(data, null, 2).includes('No UART port found')) { |
340 | 349 | show_notification('Error: Not found UART port', 'danger'); |
341 | 350 | } |
|
362 | 371 |
|
363 | 372 | this_env = this; |
364 | 373 | gateway_remote_monitor(this.flash_url + "/debug", farg).then( function(data) { |
365 | | - this_env.debugging = false; |
| 374 | + this_env.debugging = false; |
| 375 | + if (JSON.stringify(data, null, 2).includes('TypeError: NetworkError')) { |
| 376 | + show_notification('Gateway not available at the moment. Please, execute python3 gateway.py, heck if port 8080 works fine and connect your board first\n', 'danger'); |
| 377 | + } |
366 | 378 | if (JSON.stringify(data, null, 2).includes('No ELF file found in build directory')) { |
367 | 379 | show_notification('Error: Not found proyect to debug', 'danger'); |
368 | 380 | } |
|
378 | 390 | creator_ga('simulator', 'simulator.debug', 'simulator.debug'); |
379 | 391 | }, |
380 | 392 |
|
| 393 | + |
| 394 | + |
381 | 395 | showConfirmPopup(action) { |
382 | 396 | this.pendingAction = action; |
383 | 397 | this.showPopup = true; |
|
408 | 422 | this_env = this; |
409 | 423 | gateway_remote_monitor(this.flash_url + "/fullclean", farg).then( function(data) { |
410 | 424 | this_env.fullclean = false; |
| 425 | + if (JSON.stringify(data, null, 2).includes('TypeError: NetworkError')) { |
| 426 | + show_notification('Gateway not available at the moment. Please, execute python3 gateway.py, heck if port 8080 works fine and connect your board first\n', 'danger'); |
| 427 | + } |
411 | 428 | console.log(JSON.stringify(data, null, 2)); |
412 | 429 | if (JSON.stringify(data, null, 2).includes('Full clean done.')) { |
413 | 430 | show_notification('Full clean done.', 'success'); |
|
438 | 455 | this_env.eraseflash = false; |
439 | 456 | //show_notification(data, 'danger') ; |
440 | 457 | console.log(JSON.stringify(data, null, 2)); |
| 458 | + if (JSON.stringify(data, null, 2).includes('TypeError: NetworkError')) { |
| 459 | + show_notification('Gateway not available at the moment. Please, execute python3 gateway.py, heck if port 8080 works fine and connect your board first\n', 'danger'); |
| 460 | + } |
441 | 461 | if (JSON.stringify(data, null, 2).includes('Erase flash done')) { |
442 | 462 | show_notification('Erase flash done. Please, unplug and plug the cable(s) again', 'success'); |
443 | 463 | } |
|
0 commit comments