Skip to content

Commit

Permalink
Add new setup widget UI (#1656)
Browse files Browse the repository at this point in the history
* Add initial project for setup widget

* Add base provisioning client

* Add base provisioning widget app

* Add IRC provisioning client

* Add initial IRC provisioning UI

* Add tailwindcss

* Add reusable text components

* Add reusable buttons components

* Add reusable forms components

* Add reusable alerts components

* Improve linked channels list

* Improve link new channel form

* Add polling for new linked channels

* Add style tweaks

* Add operator nick query after channel is entered

* Add state reset after link channel form submitted

* Add API prefix prop to provisioning app

* Add style improvements to provisioning app

* Fix import style

* Add responsive width

* Update package-lock.json

* Use useCallback for inputs

* Fix vite config

* Replace preact with react

* Fix import error

* Add docs to IRC provisioning client

* Improve polling

* Remove unnecessary async

* Add missing useEffect dependency

* Add separate eslint config for widget

* Fix linter issues in provisioning

* Fix linter issues in IRC provisioning

* Fix empty channel input

* Add alternate display when only one server

* Add new components, improve style and layout

* Add docs

* Update docs

* Tweak poll interval

* Fix element used for body text

* Add support for embed type parameter

* Add changelog
  • Loading branch information
justinbot committed Feb 8, 2023
1 parent 3158cc5 commit f2cc06f
Show file tree
Hide file tree
Showing 61 changed files with 4,955 additions and 244 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"parserOptions": {
Expand Down Expand Up @@ -111,5 +112,6 @@
"no-var": "off",
}
}
]
],
"ignorePatterns": ["widget/**/*"]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ passkey.pem
*.map
lib/
/book/

/public
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ FROM node:16 as builder
WORKDIR /build

COPY src/ /build/src/
COPY .eslintrc *json /build/
COPY widget/ /build/widget/
COPY package.json package-lock.json tsconfig.json .eslintrc /build/

RUN npm ci
RUN npm run build
Expand All @@ -33,6 +34,7 @@ COPY --from=freebind /freebindfree/libfreebindfree.so /app/libfreebindfree.so
COPY --from=builder /build/node_modules /app/node_modules
COPY --from=builder /build/package.json /app/package.json
COPY --from=builder /build/lib /app/lib
COPY --from=builder /build/public /app/public

COPY app.js config.schema.yml /app/
COPY docker /app/docker
Expand Down
1 change: 1 addition & 0 deletions changelog.d/1656.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a UI in the form of a Matrix widget for linking and unlinking channels from a Matrix room.
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Room Commands](./room_commands.md)
- [Room Configuration](./room_configuration.md)
- [IRC Modes](./irc_modes.md)
- [Setup Widget](./setup_widget.md)
- [Bridged Networks](./bridged_networks.md)
- [Bridge Administrators](./administrators_guide.md)
- [Setting up the bridge](./bridge_setup.md)
Expand Down
25 changes: 25 additions & 0 deletions docs/setup_widget.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Setup Widget

The IRC Bridge provides a user interface in the form of a Matrix widget.
This can be used within a room to link and unlink channels.

### Configuration

In order to use the setup widget, it must be enabled along with the provisioning API:
```yaml
provisioning:
# True to enable the provisioning HTTP endpoint. Default: false.
enabled: true
# Whether to enable hosting the setup widget page. Default: false.
widget: true
```
It will be hosted on the same port as the appservice by default, at the path `/_matrix/provision/v1/static`.

### Usage

Invite the bridge user to the Matrix room, then add the widget like this (where `example.com` is a public route to your bridge's provisioning API):
```
/addwidget https://example.com/_matrix/provision/v1/static/?roomId=$matrix_room_id&widgetId=$matrix_widget_id
```


Loading

0 comments on commit f2cc06f

Please sign in to comment.