mozz100 / tohora

A web UI for balenaDash
GNU General Public License v3.0
24 stars 7 forks source link

cogctl #9

Open bettse opened 4 years ago

bettse commented 4 years ago

While looking into cog[1] I found out there is a cogctl for controlling cog over dbus. I got it working on my fork tohora (https://gitlab.com/bettse/tohora/-/commit/77c9891a37f14a5fb9a26fa296be3983a78e78d3), with a little dbus work in my fork of balena-dash (https://gitlab.com/bettse/balena-dash/-/commit/7c39d4317176545131bbc1b4e757aec63d797614). It seems like its quite a bit faster to change URLs, I guessing because it doesn't need to kill and start the process again.

[1] I was trying to find out how to make the cog loading background green because I have my dashboard behind me with a green screen. You may see references to green in my above commits, which is part of the same work.

mozz100 commented 4 years ago

This sounds great - thank you for sharing! Part of my motivation for writing a little thing to change the URL was to speed it up. By the sounds of it, this is a big improvement.

I don't have the setup or time at the moment to tinker with tohora. I'd love to try this out. I bet the balena team would be keen on it too.

Happy to receive pull requests. I guess balena dash would need to be updated at the same time. But that shouldn't be hard: breaking changes to tohora are allowed because nothing else uses it - we could release a version that included "open" and then submit a merge request to balena-dash with a bump to TOHORA_VERSION here - https://github.com/balenalabs/balena-dash/blob/master/kiosk/Dockerfile#L12

Also saw that you added CORS headers to the tohora "API". Another really nice improvement

mozz100 commented 4 years ago

@bettse would you like to be a collaborator on this repo?

bettse commented 4 years ago

mmm...not for now, but if I end up opening some PRs, I'll consider it

bettse commented 4 years ago

I have discovered a weird bug. Whatever url I set to have cog open at its start, I can only get cogctl to open other urls on the same domain. I haven't tested extensively, but it seems to be OK with other subdomains, or other paths.