tadzik / matrix-spanner-widget

Grab a Spanner. Drop a Spanner. Ensure that your team respect the spanner with this fancy widget.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

matrix-spanner-widget

This project is a Matrix widget for holding Spanners.

Screenshot

Spanners?

Spanners are a concept similar to a Mutex, where you want to (verbally) take control of a resource like a deployment environment or host to avoid other people from trying to use it at the same time. With this widget, you can click a button from within your Matrix client to alert the rest of the room that you are about to take control. The widget also informs you if someone else has already taken control.

How does it work?

Under the hood, this widget is powered by normal Matrix state. The widget sends and reads uk.half-shot.spanner state events, using a state_key to avoid collisions with competing spanners.

The event is very simple, containing only an {"active": true|false} content to denote if the spanner is active.

How do I use it?

You will need a widget compatible Matrix client, such as Element in order to use this. Clients could also opt to implement the state event natively, but so far no clients have chosen to.

Once you have one of those, you simply need to host this project on a webserver and add the widget to a room as normal.

Building the project is a case of just running yarn and then yarn build.

half-shot.uk also hosts a instance of this widget, but uptime cannot be guaranteed.

E.g. to add a widget to an Element room you just need to say:

/addwidget https://half-shot.uk/spanner?spannerName=YourSpannerName&spannerId=SomeUniqueId&sendSpannerMsg=true|false

URL Parameters

All are optional.

  • spannerName The human readable name of your spanner. E.g. "staging%20environment". Defaults to the Spanner.
  • spannerId The state_key to use, this just needs to be unique. Defaults to default.
  • sendSpannerMsg Send a notice into the room when you take or drop the spanner. Defaults to false.

Contact

As always, you can contact me via my MXID: @Half-Shot:half-shot.uk

About

Grab a Spanner. Drop a Spanner. Ensure that your team respect the spanner with this fancy widget.

License:MIT License


Languages

Language:TypeScript 79.4%Language:HTML 8.9%Language:JavaScript 6.6%Language:CSS 5.1%