reberhardt7 / cplayground

GNU General Public License v3.0
115 stars 14 forks source link

Add "stop" button for running programs #14

Open reberhardt7 opened 4 years ago

reberhardt7 commented 4 years ago

Right now, you can stop a running program by refreshing the page, or by clicking in the terminal and pressing ctrl+c. However, there should be a more obvious way to do it.

We'll need to think about UI -- should the "run" button become a "stop" button when the program is running, or should there be a separate "stop" button that appears once it starts running? I like the minimalism of having fewer buttons, but I think it's cool how the "run" button goes from outline to solid when the program starts running, and it may be clearer to users that it's possible to stop the program if there's an obvious "stop" button showing.

The implementation of this is quite easy. To stop a program, just close the websocket. No backend changes needed for this.