[Tutor] A webui - for real this time

On a lazy day not knowing if it is tutor plugin ls or tutor plugins list, I discovered tutor-webui in the hopes that I probably won’t have to remember it ever again. There will be buttons and all I need to do it click. But I was thoroughly disappointed to learn it was actually a web-cli.

Anyway, I set out to see if I could whip one up quickly and behold the tutor-contrib-webui-for-real.

  • It can run all the commands, including the ones added by other plugins
  • It can stream real-time logs to the browser. I have even tried running a full tutor dev launch.

It primarily functions as a quick documentation for me personally, and I learnt a few commands and flags in the CLI, I previously didn’t know about.

P.S: Almost all the work is done by the click-web library. I merely fixed a bug and wrapped it up as a Tutor plugin.

9 Likes

Neat! I’m actually working on something similar :slight_smile: Do you think it would be difficult to integrate stdout streaming with click-web, such that we could see the output of tutor local launch -I in real time? I managed to do this by hand with Flask and server-sent events (and some ugly hacks to capture stdout/stderr), but if it’s possible out of the box with click-web, then that’s even better.

I’m also wondering how easy it is to integrate and customise click-web in a bigger web app…

1 Like

Click-web streams both stdout and stderr to the webpage in realtime (maybe very close to realtime, I didn’t dig deep enough).

Here is it running dev launch -I

Ah! I missed this one. click-web is basically a Flask app. The readme has some notes on customization and even authentication. I suspect it won’t be easy to plugin into something like a larger Django App.