Compare commits

..

165 Commits

Author SHA1 Message Date
Manuel Stahl 36f9ce6b07 Use vite.js instead of react-scripts
- react-scripts are not maintained anymore
- vite.js is well suited for single page applications

See https://darekkay.com/blog/create-react-app-to-vite/

Change-Id: Ib884748e373094a640b576894ff67b98c3584ec8
2024-02-07 17:03:28 +01:00
Manuel Stahl 83c9704633 Use store from react-admin instead of localStorage
By default this is the same, but it can be changed.

Change-Id: Id1b11872b5f7bc83c18f8d74b03ba6401c277da0
2024-02-07 17:03:28 +01:00
Manuel Stahl 8c1546cd5a WIP: Extract process.env
Change-Id: I9efb1079c0c88e6e0272c5fda734a367aa8f84a3
2024-02-07 17:03:28 +01:00
Manuel Stahl 8688ab7d0e Fix update in dataProvider
Fixes #461

Change-Id: Icc4b0264cfda04a8a28595d153c43cdf75524673
2024-02-07 16:48:28 +01:00
Manuel Stahl abc677dc16 Simplify DeviceRemoveButton
Change-Id: I23dcb327d2612db7fc132889d623b709dce34f06
2024-02-07 16:40:42 +01:00
Steffo 9d26a1ce3a Allow deletion of event reports (#462)
* feat: Allow event reports to get deleted
* chore: Change german translation of reports name to be more fitting
2024-02-07 16:34:50 +01:00
Timo Gurr 3116b4e07a Show topic in room basic view 2024-02-07 16:23:54 +01:00
dependabot[bot] 3a34c03509 Bump @mui/styles from 5.15.7 to 5.15.8 (#463)
Bumps [@mui/styles](https://github.com/mui/material-ui/tree/HEAD/packages/mui-styles) from 5.15.7 to 5.15.8.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.15.8/packages/mui-styles)

---
updated-dependencies:
- dependency-name: "@mui/styles"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:18:50 +01:00
dependabot[bot] 384bc6553c Bump JamesIves/github-pages-deploy-action from 4.4.3 to 4.5.0 (#457)
Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.4.3 to 4.5.0.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.4.3...v4.5.0)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:18:15 +01:00
dependabot[bot] df87432157 Bump follow-redirects from 1.14.8 to 1.15.5 (#450)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.8 to 1.15.5.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.8...v1.15.5)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 16:17:49 +01:00
Manuel Stahl 2afc7aeca4 Rename all JSX files to have proper file extension
Change-Id: I4ab382f7673a815164f74154e6b03b370fd76a33
2024-02-07 15:27:34 +01:00
Manuel Stahl ac843b3244 Upgrade packages to latest version
yarn upgrade --latest

Change-Id: I07c71927ffa6c811fe7cbf8bd2a47503e55499ce
2024-02-07 15:27:34 +01:00
Manuel Stahl 82155c23a1 Upgrade react to v18
https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis

Change-Id: Ibac40eb3d900f54955dfbc8f5e2833a0c47941a6
2024-02-07 15:27:33 +01:00
Manuel Stahl 64a89f6552 Extract helper functions from LoginPage
Change-Id: I507e223d0eff00bac3963d0b71f9bd648b9ab7b1
2024-02-07 15:15:40 +01:00
Manuel Stahl 5b8882bd80 Fix AvatarField
Change-Id: I9614163942fcb8667885b524caf944500605c55d
2024-02-07 15:15:36 +01:00
Manuel Stahl 3fe0e95069 Set "requireAuth" for all pages
Change-Id: I1b68d46f9f7d9a843a5b26f0906d1f71569487cf
2024-02-07 12:03:00 +01:00
Dirk Klimpel 3cd0aa4446 Update links to Synapse in README.md (#458) 2024-02-07 11:14:25 +01:00
dklimpel 3adc6b4663 Use new API of dataProvider
Change-Id: I2789f1f1384b48e876bee5af421ff5db66fa3416
2024-02-07 08:49:26 +01:00
Manuel Stahl 76ef017244 Refactor media
Change-Id: Ic24c53048c35b76532af24d9c5c9bf831688344b
2024-02-07 08:49:11 +01:00
dklimpel 00ecb29d6b Refactor RoomDirectory
Change-Id: Ie3bd606fc91b2673d2a3422f8fd465258d3211b0
2024-02-07 08:28:12 +01:00
Manuel Stahl 4204eb902f Refactor ServerNotices
https://marmelab.com/react-admin/Upgrade.html#usequery-usemutation-and-usequerywithstore-have-been-removed

Change-Id: Id12f727d8813f78c3ae300035aeb1333a1272e02
2024-02-07 08:28:12 +01:00
dklimpel 6430aca02b Rename save to onSubmit in SimpleForm
https: //marmelab.com/react-admin/Upgrade.html#the-form-components-save-prop-has-been-renamed-to-onsubmit

Change-Id: Iaf2c0b665c8058336d4df6326531780a2790e71d
2024-02-07 08:28:12 +01:00
dklimpel b8a0b4bef5 Move redirect from SimpleForm to Create
Change-Id: I7c5c0043a49bcb16c131e400b2ebe022e233c5ae
2024-02-06 15:11:20 +01:00
dklimpel 2c769c309e Move Toolbar's alwaysEnableSaveButton into SaveButton
https: //marmelab.com/react-admin/Upgrade.html#toolbars-alwaysenablesavebutton-prop-has-been-removed

Change-Id: I6c8693d4f55bfabdeaa677bd294d8663b7f14d69
2024-02-06 15:11:20 +01:00
dklimpel 82578c6570 Change unselectAll syntax
https: //marmelab.com/react-admin/Upgrade.html#useunselectall-syntax-changed

Change-Id: Ie8d261e863fe4726b3a5925ed0446eb824c6e517
2024-02-06 15:11:20 +01:00
dklimpel 005abfb4a2 Update pagination
https: //marmelab.com/react-admin/Upgrade.html#no-more-props-injection-in-custom-pagination-and-empty-components

Change-Id: I6f4d3941dee22cf00da30bada5442f3fdd345127
2024-02-06 15:11:20 +01:00
dklimpel 155e73b9c6 Rename currentSort to sort
https: //marmelab.com/react-admin/Upgrade.html#currentsort-renamed-to-sort

Change-Id: I676adefe0073a9a0343dcd598e9559ecf30c38af
2024-02-06 15:11:20 +01:00
dklimpel 1eb787fd9b Replace "onFailure" with "onError"
https://marmelab.com/react-admin/Upgrade.html#onsuccess-and-onfailure-props-have-moved

Change-Id: I30ae51e06df0293391988a7a84be9c6ef2b158b3
2024-02-06 15:11:12 +01:00
dklimpel 691969e1a1 Fix translation of device_id in EventReport
Change-Id: Ife6cfdae1fce9b477fc12b2e0cdd6bcea4b8b734
2024-02-06 15:11:07 +01:00
Manuel Stahl d520c6d618 Export resources as objects
Change-Id: I3c501369abf27fa21293c0434c56a00aaf8a64cd
2024-02-05 15:59:43 +01:00
Manuel Stahl af453eea71 Remove/mark unused parameters
All top level components should pass props to the generic react-admin
component to be more versatile.

Change-Id: I25dd099cde1aefacbc748dc4716a8b0a3db9ab93
2024-02-05 15:59:43 +01:00
Manuel Stahl 78d1d34a84 Simplify filters
Change-Id: I3e4cb7134a92c949bfb62d753c682a6c8fca6736
2024-02-05 15:59:43 +01:00
dklimpel a222af273f Update dataProvider hooks
Change-Id: Ic19f7a6ad97b1392c96c91a19e76b8983c9d0fd2
2024-02-05 15:59:43 +01:00
Manuel Stahl 51def5775d Replace Fragment with short form
https://legacy.reactjs.org/docs/fragments.html#short-syntax

Change-Id: Ib1af57fc5e87ded8c1fee38dcbd60fae8621cb07
2024-02-05 15:59:43 +01:00
Manuel Stahl 6363e3d32e Use icon as loading spinner in login page
Change-Id: Ie0e8d0a9e1242849fb8b18875d752dd15facaaf9
2024-02-05 15:59:43 +01:00
Manuel Stahl ba4345be1e Bump version to 0.9.0
Change-Id: I2acd7e62b4a3c7cd664e3e33200cfb4db96d638a
2024-02-05 15:59:40 +01:00
dklimpel b70ee7c55d Upgrade to React-Admin 4 (#332)
Change-Id: Ia03486edfd934438580e614af754a0966f6fd6e3
2024-02-05 13:44:22 +01:00
Manuel Stahl 9f03ec9b0f Remove unused Menu.js
Change-Id: Idac1d6bcfd703ee499a2522eace6411e48ac176b
2024-02-05 12:47:14 +01:00
Dirk Klimpel d8d393cdf6 Update deprecated resource definitions (#331) 2024-02-02 17:14:07 +01:00
Dirk Klimpel 58e02d6dff Migrate makeStyles to MUI v5 (#330) 2024-02-02 16:37:39 +01:00
dependabot[bot] 17379a7325 Bump docker/setup-buildx-action from 2 to 3 (#395)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 15:04:39 +01:00
dependabot[bot] 13fbc419c2 Bump docker/login-action from 2 to 3 (#394)
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 15:04:29 +01:00
dependabot[bot] e757876c35 Bump docker/setup-qemu-action from 2 to 3 (#396)
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 15:04:05 +01:00
dependabot[bot] 8b99695e60 Bump docker/build-push-action from 4 to 5 (#397)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 15:03:52 +01:00
dependabot[bot] 4ab5ae2585 Bump @babel/traverse from 7.16.5 to 7.23.2 (#418)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.16.5 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 15:03:27 +01:00
dependabot[bot] 7579873d87 Bump actions/setup-node from 3 to 4 (#421)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 15:03:17 +01:00
dependabot[bot] e2ce934f2a Bump @adobe/css-tools from 4.3.1 to 4.3.2 (#438)
Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.3.1 to 4.3.2.
- [Changelog](https://github.com/adobe/css-tools/blob/main/History.md)
- [Commits](https://github.com/adobe/css-tools/commits)

---
updated-dependencies:
- dependency-name: "@adobe/css-tools"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 15:03:02 +01:00
dependabot[bot] 56bc4a56b9 Bump ra-language-french from 4.13.3 to 4.16.2 (#439)
Bumps [ra-language-french](https://github.com/marmelab/react-admin) from 4.13.3 to 4.16.2.
- [Release notes](https://github.com/marmelab/react-admin/releases)
- [Changelog](https://github.com/marmelab/react-admin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/marmelab/react-admin/compare/v4.13.3...v4.16.2)

---
updated-dependencies:
- dependency-name: ra-language-french
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 15:02:53 +01:00
dependabot[bot] 4bae32b57c Bump @mui/icons-material from 5.14.8 to 5.14.19 (#440)
Bumps [@mui/icons-material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-icons-material) from 5.14.8 to 5.14.19.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.14.19/packages/mui-icons-material)

---
updated-dependencies:
- dependency-name: "@mui/icons-material"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 15:02:41 +01:00
dependabot[bot] 6e395e3b0f Bump eslint from 8.48.0 to 8.55.0 (#441)
Bumps [eslint](https://github.com/eslint/eslint) from 8.48.0 to 8.55.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.48.0...v8.55.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 15:02:28 +01:00
Dirk Klimpel 323ad9f9e2 Disallow crawling in robots.txt (#448) 2024-01-31 19:24:46 +01:00
Dirk Klimpel 50af6499b0 Bump NodeJS to v18 (#407) 2023-10-04 09:23:43 +02:00
dependabot[bot] 12c22a170b Bump papaparse from 5.3.1 to 5.4.1 (#388)
Bumps [papaparse](https://github.com/mholt/PapaParse) from 5.3.1 to 5.4.1.
- [Release notes](https://github.com/mholt/PapaParse/releases)
- [Commits](https://github.com/mholt/PapaParse/compare/5.3.1...5.4.1)

---
updated-dependencies:
- dependency-name: papaparse
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 15:00:40 +02:00
dependabot[bot] 5bbb2fc77b Bump prop-types from 15.7.2 to 15.8.1 (#390)
Bumps [prop-types](https://github.com/facebook/prop-types) from 15.7.2 to 15.8.1.
- [Changelog](https://github.com/facebook/prop-types/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/prop-types/compare/v15.7.2...v15.8.1)

---
updated-dependencies:
- dependency-name: prop-types
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 13:41:00 +02:00
dependabot[bot] 499d15e667 Bump @mui/material from 5.4.0 to 5.14.8 (#391)
Bumps [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) from 5.4.0 to 5.14.8.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.14.8/packages/mui-material)

---
updated-dependencies:
- dependency-name: "@mui/material"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 13:40:40 +02:00
dependabot[bot] bcf7dec10c Bump eslint-config-prettier from 8.10.0 to 9.0.0 (#389)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.10.0 to 9.0.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.10.0...v9.0.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 13:27:26 +02:00
dependabot[bot] e1c7f44fec Bump @mui/icons-material from 5.14.7 to 5.14.8 (#392)
Bumps [@mui/icons-material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-icons-material) from 5.14.7 to 5.14.8.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.14.8/packages/mui-icons-material)

---
updated-dependencies:
- dependency-name: "@mui/icons-material"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 13:26:27 +02:00
dependabot[bot] 0e25633398 Bump ra-language-french from 4.13.2 to 4.13.3 (#382)
Bumps [ra-language-french](https://github.com/marmelab/react-admin) from 4.13.2 to 4.13.3.
- [Release notes](https://github.com/marmelab/react-admin/releases)
- [Changelog](https://github.com/marmelab/react-admin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/marmelab/react-admin/compare/v4.13.2...v4.13.3)

---
updated-dependencies:
- dependency-name: ra-language-french
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 12:54:58 +02:00
Ezwen 8097fa4da4 Add raw sender uid in reports page (#334)
Fixes #333.
2023-09-05 10:50:38 +02:00
Stefan Möhrle ad9a1c502b Fix SSO-login for base urls with explicit port (#337) 2023-09-05 10:49:24 +02:00
dependabot[bot] ec2e7b2ccb Bump @emotion/react from 11.7.1 to 11.11.1 (#385)
Bumps [@emotion/react](https://github.com/emotion-js/emotion) from 11.7.1 to 11.11.1.
- [Release notes](https://github.com/emotion-js/emotion/releases)
- [Changelog](https://github.com/emotion-js/emotion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emotion-js/emotion/compare/@emotion/react@11.7.1...@emotion/react@11.11.1)

---
updated-dependencies:
- dependency-name: "@emotion/react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 10:47:45 +02:00
dependabot[bot] 8bdeddd8f6 Bump ra-test from 3.19.4 to 3.19.12 (#384)
Bumps [ra-test](https://github.com/marmelab/react-admin) from 3.19.4 to 3.19.12.
- [Release notes](https://github.com/marmelab/react-admin/releases)
- [Changelog](https://github.com/marmelab/react-admin/blob/v3.19.12/CHANGELOG.md)
- [Commits](https://github.com/marmelab/react-admin/compare/v3.19.4...v3.19.12)

---
updated-dependencies:
- dependency-name: ra-test
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 10:47:25 +02:00
dependabot[bot] e253fcb516 Bump @mui/icons-material from 5.3.1 to 5.14.7 (#386)
Bumps [@mui/icons-material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-icons-material) from 5.3.1 to 5.14.7.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.14.7/packages/mui-icons-material)

---
updated-dependencies:
- dependency-name: "@mui/icons-material"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 08:26:09 +02:00
dependabot[bot] 05a4f94d2f Bump eslint from 8.32.0 to 8.48.0 (#383)
Bumps [eslint](https://github.com/eslint/eslint) from 8.32.0 to 8.48.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.32.0...v8.48.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 08:25:48 +02:00
dependabot[bot] d747e24a96 Bump JamesIves/github-pages-deploy-action from 4.4.1 to 4.4.3 (#381)
Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.4.1 to 4.4.3.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.4.1...v4.4.3)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 08:23:21 +02:00
dependabot[bot] 35e3bbeb88 Bump actions/checkout from 3 to 4 (#380)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 08:23:03 +02:00
Francesco Carmelo Capria c750f6b8e9 Add italian language option to login page (#379) 2023-08-31 21:57:51 +02:00
Francesco Carmelo Capria 0c5c762224 Italian translations (#374)
* Added italian language

* Bump @testing-library/react from 11.2.7 to 12.1.5 (#327)

Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 11.2.7 to 12.1.5.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v11.2.7...v12.1.5)

---
updated-dependencies:
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump docker/build-push-action from 3 to 4 (#328)

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 4.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Added italian language

* Fix

* Updated yarn.lock

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-31 14:50:44 +02:00
dependabot[bot] 8fa78356a0 Bump docker/build-push-action from 3 to 4 (#328)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 4.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-31 09:24:22 +02:00
dependabot[bot] 3fec64021a Bump @testing-library/react from 11.2.7 to 12.1.5 (#327)
Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 11.2.7 to 12.1.5.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v11.2.7...v12.1.5)

---
updated-dependencies:
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-31 09:23:51 +02:00
dependabot[bot] 15528e3e9b Bump tough-cookie from 4.0.0 to 4.1.3 (#378)
Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.0.0 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.0.0...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 22:15:18 +02:00
dependabot[bot] 39643bd8ab Bump @adobe/css-tools from 4.0.2 to 4.3.1 (#377)
Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.0.2 to 4.3.1.
- [Changelog](https://github.com/adobe/css-tools/blob/main/History.md)
- [Commits](https://github.com/adobe/css-tools/commits)

---
updated-dependencies:
- dependency-name: "@adobe/css-tools"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 22:15:06 +02:00
dependabot[bot] d592234d4e Bump word-wrap from 1.2.3 to 1.2.5 (#376)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 22:14:56 +02:00
Dirk Klimpel 67500a6023 Migrate material-ui icons to v5 (#329) 2023-08-30 22:13:14 +02:00
dependabot[bot] ffce8bd64c Bump semver from 6.3.0 to 6.3.1 (#375)
Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 22:11:22 +02:00
dependabot[bot] 8b00f7d5ac Bump react-admin from 3.19.7 to 3.19.12 (#339)
Bumps [react-admin](https://github.com/marmelab/react-admin) from 3.19.7 to 3.19.12.
- [Release notes](https://github.com/marmelab/react-admin/releases)
- [Changelog](https://github.com/marmelab/react-admin/blob/v3.19.12/CHANGELOG.md)
- [Commits](https://github.com/marmelab/react-admin/compare/v3.19.7...v3.19.12)

---
updated-dependencies:
- dependency-name: react-admin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 22:09:57 +02:00
dependabot[bot] bbd63f4838 Bump @emotion/styled from 11.6.0 to 11.10.6 (#342)
Bumps [@emotion/styled](https://github.com/emotion-js/emotion) from 11.6.0 to 11.10.6.
- [Release notes](https://github.com/emotion-js/emotion/releases)
- [Changelog](https://github.com/emotion-js/emotion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emotion-js/emotion/compare/@emotion/styled@11.6.0...@emotion/styled@11.10.6)

---
updated-dependencies:
- dependency-name: "@emotion/styled"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 22:09:42 +02:00
dependabot[bot] bdf29afda0 Bump webpack from 5.74.0 to 5.76.1 (#349)
Bumps [webpack](https://github.com/webpack/webpack) from 5.74.0 to 5.76.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.74.0...v5.76.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 22:09:30 +02:00
dependabot[bot] 46fa936f20 Bump eslint-config-prettier from 8.3.0 to 8.8.0 (#353)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.3.0 to 8.8.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.3.0...v8.8.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 22:09:16 +02:00
dependabot[bot] d502696c1f Bump ra-language-french from 4.2.0 to 4.9.3 (#359)
Bumps [ra-language-french](https://github.com/marmelab/react-admin) from 4.2.0 to 4.9.3.
- [Release notes](https://github.com/marmelab/react-admin/releases)
- [Changelog](https://github.com/marmelab/react-admin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/marmelab/react-admin/compare/v4.2.0...v4.9.3)

---
updated-dependencies:
- dependency-name: ra-language-french
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 22:08:20 +02:00
Michael Albert 9b43d41040 Remove fixed PUBLIC_URL in Dockerfile
Change-Id: Ifb2e41f02f6568fd80fe9de4c76b633236ceffe4
2023-02-03 22:17:08 +01:00
Michael Albert 3276a9b6ed Raise yarn install timeout limit to avoid build errors
@mui/icons-material needs much time to install, raises the overall yarn install time and causes a timeout error

Change-Id: I0327c6e0523528fb08da7e4b993fb53e9e070305
2023-01-27 08:34:24 +01:00
Michael Albert b3a611e7ad Create test-docker-image.yml
Change-Id: I2a350b2a33233c9a271739643acc0887558cc52e
2023-01-24 22:16:58 +01:00
Michael Albert de03e23524 Fix coding style of french translation
Change-Id: Id5e2a5b2fefcbff4cefbd577cc9fae5315be9cb6
2023-01-24 21:50:59 +01:00
Charlie Calendre a200a8932b feat: add french translations (#271)
Co-authored-by: Michael Albert <37796947+awesome-michael@users.noreply.github.com>
2023-01-24 21:41:56 +01:00
Dirk Klimpel 41656748bb Add dependencies @mui/icons-material to package (#242)
* Add dependencies `@mui/icons-material` to package

* Replace MUI icons v4 with v5

* Replace more `@material-ui/core` with `@mui/material`

* consolidate `Dialog`, `DialogContent`, `DialogContentText` and
`DialogTitle`

* update `alpha` `Container` and `useMediaQuery`
2023-01-24 21:27:02 +01:00
Dirk Klimpel 42a4decc2a Remove not needed translate (#240) 2023-01-24 21:25:20 +01:00
Dirk Klimpel 74f77e6988 Replace ({ record }) with useRecordContext() (#236)
* replace `({ record })` with `useRecordContext()`

* code style

Co-authored-by: Michael Albert <37796947+awesome-michael@users.noreply.github.com>
2023-01-24 16:36:08 +01:00
Dirk Klimpel 8501f19a03 Add admin API for destinations (#213)
* Add admin API for destinations

* Add rooms and connections to federation/destinations
2023-01-24 16:35:42 +01:00
Dirk Klimpel 6d30af9976 Update usage of useNotify hook (#234)
Co-authored-by: Michael Albert <37796947+awesome-michael@users.noreply.github.com>
2023-01-24 15:28:01 +01:00
Dirk Klimpel 2e59190bd0 Migrate useMutation to useDelete in devices.js (#225)
* Migrate `useMutation` to `useDelete` in `devices.js`

* Update deprecated `notify` call
2023-01-24 15:24:14 +01:00
Charlie Calendre a647c91f4f fix: prevent requests from failing (#272)
Encode userid to handle the case of a localpart with a slash
2023-01-24 15:18:09 +01:00
dependabot[bot] 21ba5c9862 Bump actions/setup-node from 2 to 3 (#316)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2 to 3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 10:07:29 +01:00
dependabot[bot] 0a701df5d2 Bump json5 from 1.0.1 to 1.0.2 (#302)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 10:04:49 +01:00
dependabot[bot] 347d1c3114 Bump loader-utils from 2.0.2 to 2.0.4 (#297)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.4.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v2.0.2...v2.0.4)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 10:02:12 +01:00
dependabot[bot] 8982487eee Bump decode-uri-component from 0.2.0 to 0.2.2 (#299)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 09:58:44 +01:00
dependabot[bot] 7fa835f973 Bump @testing-library/jest-dom from 5.16.1 to 5.16.5 (#314)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.16.1 to 5.16.5.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.16.1...v5.16.5)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 09:53:32 +01:00
Dirk Klimpel 5767817733 Set dist for Travis CI (#300) 2023-01-24 09:51:19 +01:00
dependabot[bot] e43f732bde Bump docker/setup-buildx-action from 1 to 2 (#318)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 09:50:09 +01:00
dependabot[bot] c0f4a92f1a Bump softprops/action-gh-release from 0.1.5 to 0.1.15 (#317)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 0.1.5 to 0.1.15.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/b7e450da2a4b4cb4bfbae528f788167786cfcedf...de2c0eb89ae2a093876385947365aca7b0e5f844)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 09:47:19 +01:00
dependabot[bot] e70c680e8a Bump eslint from 7.32.0 to 8.32.0 (#315)
Bumps [eslint](https://github.com/eslint/eslint) from 7.32.0 to 8.32.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.32.0...v8.32.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 09:35:54 +01:00
Dirk Klimpel 3b4da1d3c2 Update travis-ci URLs (#311) 2023-01-24 09:29:59 +01:00
Dirk Klimpel 3b2aa776eb Fix broken CI / lint (#320) 2023-01-24 09:29:14 +01:00
Michael Albert ee8050f697 Add args to docker-compose as suggested in #285
Change-Id: I67083d86ea45c15b02f8db54a1649dbb013c3d50
2023-01-16 20:27:22 +01:00
Sebastian Wagner ca5fde9190 doc README: fix PUBLIC_URL in docker-compose example (#289)
PUBLIC_URL must not be enclosed in quotation marks, see Awesome-Technologies/synapse-admin#286
- add a note on this in the example
- fix the example itself

fixes Awesome-Technologies/synapse-admin#286
2023-01-16 20:20:02 +01:00
Przemysław Romanik 561daf7737 Add session logout warning below password input (#212)
Co-authored-by: Michael Albert <37796947+awesome-michael@users.noreply.github.com>
2023-01-16 20:18:21 +01:00
dependabot[bot] f2526dc00e Bump @testing-library/user-event from 13.5.0 to 14.4.3 (#309)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.5.0 to 14.4.3.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.5.0...v14.4.3)

---
updated-dependencies:
- dependency-name: "@testing-library/user-event"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 20:13:59 +01:00
dependabot[bot] 3cce1a61d3 Bump eslint-plugin-prettier from 3.4.1 to 4.2.1 (#310)
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 3.4.1 to 4.2.1.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/commits/v4.2.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 20:13:41 +01:00
dependabot[bot] af3b5439a5 Bump actions/checkout from 2 to 3 (#308)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 20:13:25 +01:00
dependabot[bot] 59afa49be0 Bump docker/login-action from 1 to 2 (#307)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1 to 2.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 20:13:12 +01:00
dependabot[bot] bfd38f50ea Bump JamesIves/github-pages-deploy-action from 4.1.5 to 4.4.1 (#304)
Bumps [JamesIves/github-pages-deploy-action](https://github.com/JamesIves/github-pages-deploy-action) from 4.1.5 to 4.4.1.
- [Release notes](https://github.com/JamesIves/github-pages-deploy-action/releases)
- [Commits](https://github.com/JamesIves/github-pages-deploy-action/compare/4.1.5...v4.4.1)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 20:12:59 +01:00
dependabot[bot] 37ed5c4156 Bump docker/setup-qemu-action from 1 to 2 (#306)
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 20:06:09 +01:00
dependabot[bot] 2eb16eb747 Bump docker/build-push-action from 2 to 3 (#305)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2 to 3.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 19:58:38 +01:00
Dirk Klimpel bd6b6eef85 Use delete room API v2 (delete room in background) (#211)
Co-authored-by: Michael Albert <37796947+awesome-michael@users.noreply.github.com>
2023-01-16 19:53:17 +01:00
Dirk Klimpel 43f1b82d33 Add dependabot.yml config (#292) 2023-01-16 19:52:25 +01:00
Michael Albert 24afbd2953 Fix build environment
Change-Id: I1e32a0eeaaa0e6b8c8d4845183e7d37320a4eeae
2023-01-16 13:42:16 +01:00
Dirk Klimpel a74a6166a3 Add some status badges to README.md (#291) 2023-01-16 12:53:38 +01:00
Dirk Klimpel e23e9ccd82 Create UserEditActions on user page (#222)
* Create `UserEditActions` on user page

* Fix crash with crashes `undefined`
2023-01-16 12:52:00 +01:00
Dirk Klimpel e787b0a940 Add edit user_type to user (#209) 2023-01-16 12:37:30 +01:00
Dirk Klimpel 67066a1ba7 Bump react-scripts to ^5.0.1 (#280) 2022-09-07 09:20:25 +02:00
dklimpel 08a7d5c0f6 Bump GHA to NodeJS v16 2022-09-07 08:49:02 +02:00
dependabot[bot] 472b13ec26 Bump terser from 4.8.0 to 4.8.1
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-07 08:48:17 +02:00
dependabot[bot] b901c9e0ff Bump eventsource from 1.1.0 to 1.1.1
Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/EventSource/eventsource/releases)
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.1)

---
updated-dependencies:
- dependency-name: eventsource
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-07 08:48:04 +02:00
Dirk Klimpel 0b153ddcbb Update README.md
Co-authored-by: Dominik Fuchß <develop@fuchss.org>
2022-05-23 14:07:49 +02:00
Dirk Klimpel 784c284723 Add note to GH pages 2022-05-23 14:07:49 +02:00
dependabot[bot] e5f73ea8b4 Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-23 14:07:01 +02:00
dependabot[bot] 96551259c5 Bump cross-fetch from 3.1.4 to 3.1.5
Bumps [cross-fetch](https://github.com/lquixada/cross-fetch) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/lquixada/cross-fetch/releases)
- [Commits](https://github.com/lquixada/cross-fetch/compare/v3.1.4...v3.1.5)

---
updated-dependencies:
- dependency-name: cross-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-23 14:06:50 +02:00
dependabot[bot] b2fa533ef0 Bump async from 2.6.3 to 2.6.4
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-23 14:06:40 +02:00
Leon Schmidt 7aa0f9f50d Make PUBLIC_URL and REACT_APP_SERVER configurable (#266)
* Adjust Dockerfile to include args in build process
* Adjust README.md
2022-05-23 14:06:04 +02:00
Dirk Klimpel 5aa90c25f7 Add path to rooms tab "members" (#232) 2022-03-22 19:11:12 +01:00
dependabot[bot] 38d58db08d Bump url-parse from 1.5.7 to 1.5.10 (#253)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.7 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.7...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-22 18:17:18 +01:00
Dirk Klimpel e637df232a Upgrade react-admin to ^3.19.7 (#241) 2022-03-22 18:13:01 +01:00
Dirk Klimpel d97c633cd0 Remove not needed {" "} from EventReports (#235) 2022-03-22 17:59:48 +01:00
Dirk Klimpel b02396c61f disableReordering in users' SimpleFormIterator (#219) 2022-03-22 17:58:28 +01:00
Michael Albert 95de50b925 Bump version to 0.8.5
Change-Id: I8c8f0af01d693bb76dbf706a92fdd4dfa6ba9a8b
2022-02-17 20:56:27 +01:00
dependabot[bot] 1a150a10fd Bump url-parse from 1.5.3 to 1.5.7 (#244)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.7.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.3...1.5.7)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 20:53:56 +01:00
Dirk Klimpel 158e7dbe98 Move date format to a constant in EventReports.js (#237) 2022-02-17 20:52:13 +01:00
Dirk Klimpel a642f11503 Fix typo notification in german language file (#233) 2022-02-17 20:51:42 +01:00
Dirk Klimpel 888a3f001b Move date format to a constant in rooms.js (#238) 2022-02-17 20:51:11 +01:00
Dirk Klimpel 4b0845bee8 Move date format to a constant in users.js (#223)
* Move date format to a constant in `users.js`

* yarn prettier
2022-02-17 20:50:38 +01:00
Dirk Klimpel f449e3277a Replace deprecated fade in devices.js (#220) 2022-02-17 20:49:34 +01:00
Dirk Klimpel 3303f253b4 Replace deprecated fade in media.js (#221) 2022-02-17 20:49:19 +01:00
dependabot[bot] 0250954ee7 Bump follow-redirects from 1.14.7 to 1.14.8 (#243)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 20:45:37 +01:00
Dirk Klimpel efed8b2774 Add token based registration creation and management (#200)
* Add token based registration creation and management

* yarn fix

* Apply suggestions from code review

Remove empty line

* move date to `const date_format`
2022-02-17 20:45:21 +01:00
Nya Candy c891afa611 feat: support SSO login (#196)
* feat: support SSO login

* fix: lint

* fix: add back homeserver force protection

* fix: add back login notice

* fix: simplify login options
2022-02-17 20:24:46 +01:00
Michael Albert 38541b8f02 Fix english translation for room deletion
Change-Id: I5bb02e64832902a79379d66c77d3128169d3fca8
2022-02-17 20:15:49 +01:00
Dirk Klimpel 0f4c382c18 Remove not needed translation backtolist (#208) 2022-01-31 17:50:14 +01:00
Dirk Klimpel b90d4ef00f Add more headlines for installation to README (#216) 2022-01-31 17:39:18 +01:00
Dominik Fuchß 3fb33facc5 GitHub Pages Deploy (#189)
* Create edge_ghpage.yml

Added Build and Deploy Edge version to GH Pages

* Update edge_ghpage.yml

Added missing node setup

* Update edge_ghpage.yml

Restrict building of GH Pages to main / master branch & workflow dispatch

* Update .github/workflows/edge_ghpage.yml

Co-authored-by: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com>

* Update .github/workflows/edge_ghpage.yml

Co-authored-by: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com>

* Update .github/workflows/edge_ghpage.yml

Co-authored-by: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com>

* Update .github/workflows/edge_ghpage.yml

Co-authored-by: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com>

Co-authored-by: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com>
2022-01-31 17:38:34 +01:00
Dirk Klimpel c4a68ff1d5 Fix typo in .prettierrc (#224) 2022-01-31 17:24:37 +01:00
dependabot[bot] c4f0fa48ec Bump nanoid from 3.1.30 to 3.2.0 (#229)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.30...3.2.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-31 17:20:39 +01:00
dependabot[bot] 26ed63d65e Bump follow-redirects from 1.14.6 to 1.14.7 (#227)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.6 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.6...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-31 17:20:29 +01:00
Michael Albert b9e81b2278 Bump version and update dependencies
Change-Id: I0c0349b4429ce06bea51453c092f0a11156aaa05
2021-12-17 20:38:18 +01:00
sakkiii f6f437b17a version tag on docker hub (#187)
* version tag on docker hub

* resolve name collision

* master branch added for latest tag

* prettier-ignore fix
2021-12-08 22:02:43 +01:00
Dirk Klimpel 91af8f1c04 Add sorting users by creation timestamp (#174)
* Add `creation_ts` to list users

* remove filter

* Bring back origin columns sort order
2021-12-08 21:59:09 +01:00
Aaron R abc9d5154e Switch Dockerfile to use current LTS version of Node (#205)
Node 17 current fails due to https://github.com/webpack/webpack/issues/14532. It probably makes sense to use the current LTS version of Node instead of the absolute latest version of Node so these kinds of bleeding edge issues are less likely to happen.
2021-11-15 21:35:23 +01:00
dependabot[bot] 8228d7d2c2 Bump tar from 6.1.8 to 6.1.11 (#207)
Bumps [tar](https://github.com/npm/node-tar) from 6.1.8 to 6.1.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v6.1.8...v6.1.11)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-15 21:18:58 +01:00
Dirk Klimpel 4adc20f80d replace undoable prop with mutationMode prop (#202) 2021-11-15 21:18:29 +01:00
Dirk Klimpel a5c7d7dd22 Make items in "Room directory" are clickable (#199) 2021-11-15 21:15:11 +01:00
dependabot[bot] dc5c2c1d68 Bump tmpl from 1.0.4 to 1.0.5 (#193)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-15 21:11:49 +01:00
Dirk Klimpel 42b3252353 Add pristine to UserEdit and ServerNotice (#185) 2021-11-15 21:02:47 +01:00
Dirk Klimpel 1a17d3e69b Automatically set the homeserver for a new user (#184)
and enhance form validation
2021-11-15 20:57:38 +01:00
Dirk Klimpel 79ef38ee6b Enable modify user external_ids (#179)
* Enable modify user `external_ids`

* add input validation
2021-11-15 20:40:05 +01:00
Manuel Stahl 0ff4b30d71 Remove update repo stop from docker release action
See https://github.com/peter-evans/dockerhub-description/issues/10

Change-Id: I42d2d4e1a28117be1419591f7d43653591182f0c
2021-08-26 10:43:11 +02:00
Manuel Stahl 6c4ff6c791 Add write permissions to github release action
Change-Id: Ie7db1e7410bbc1c0fccbc2d00119363629e10f22
2021-08-26 10:40:11 +02:00
53 changed files with 6226 additions and 12072 deletions
+1
View File
@@ -1,6 +1,7 @@
# Exclude a bunch of stuff which can make the build context a larger than it needs to be # Exclude a bunch of stuff which can make the build context a larger than it needs to be
tests/ tests/
build/ build/
dist/
lib/ lib/
node_modules/ node_modules/
electron_app/ electron_app/
+20
View File
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
ignore:
# Major updates for react-admin have breaking changes
- dependency-name: "react-admin"
update-types: ["version-update:semver-major"]
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
+3 -3
View File
@@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Setup node - name: Setup node
uses: actions/setup-node@v2 uses: actions/setup-node@v4
with: with:
node-version: 14 node-version: "18"
- name: Install dependencies - name: Install dependencies
run: yarn --frozen-lockfile run: yarn --frozen-lockfile
- name: Run tests - name: Run tests
+30 -15
View File
@@ -2,8 +2,14 @@ name: Create docker image(s) and push to docker hub
on: on:
push: push:
# Sequence of patterns matched against refs/heads
# prettier-ignore
branches:
# Push events on master branch
- master
# Sequence of patterns matched against refs/tags
tags: tags:
- '[0-9]+\.[0-9]+\.[0-9]+' - '[0-9]+\.[0-9]+\.[0-9]+' # Push events to 0.X.X tag
jobs: jobs:
docker: docker:
@@ -11,26 +17,35 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v3
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Calculate docker image tag
uses: docker/build-push-action@v2 id: set-tag
run: |
case "${GITHUB_REF}" in
refs/heads/master|refs/heads/main)
tag=latest
;;
refs/tags/*)
tag=${GITHUB_REF#refs/tags/}
;;
*)
tag=${GITHUB_SHA}
;;
esac
echo "::set-output name=tag::$tag"
- name: Build and Push Tag
uses: docker/build-push-action@v5
with: with:
context: . context: .
platforms: linux/amd64,linux/arm64
push: true push: true
tags: awesometechnologies/synapse-admin:latest tags: "awesometechnologies/synapse-admin:${{ steps.set-tag.outputs.tag }}"
- name: Update repo description platforms: linux/amd64,linux/arm64
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: awesometechnologies/synapse-admin
+26
View File
@@ -0,0 +1,26 @@
name: Build and Deploy Edge version to GH Pages
on:
workflow_dispatch:
push:
branches:
- main
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
- name: Install and Build 🔧
run: |
yarn install
yarn build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages
folder: build
+7 -4
View File
@@ -8,12 +8,15 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- uses: actions/setup-node@v2 - uses: actions/setup-node@v4
with: with:
node-version: "14" node-version: "18"
- run: yarn install - run: yarn install
- run: yarn build - run: yarn build
- run: | - run: |
@@ -21,7 +24,7 @@ jobs:
mkdir -p dist mkdir -p dist
cp -r build synapse-admin-$version cp -r build synapse-admin-$version
tar chvzf dist/synapse-admin-$version.tar.gz synapse-admin-$version tar chvzf dist/synapse-admin-$version.tar.gz synapse-admin-$version
- uses: softprops/action-gh-release@b7e450da2a4b4cb4bfbae528f788167786cfcedf - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with: with:
files: dist/*.tar.gz files: dist/*.tar.gz
env: env:
+51
View File
@@ -0,0 +1,51 @@
name: Test docker image creation
on:
push:
# Sequence of patterns matched against refs/heads
# prettier-ignore
branches:
# Push events on branch fix_docker_cd
- fix_docker_cd
# Sequence of patterns matched against refs/tags
tags:
- '[0-9]+\.[0-9]+\.[0-9]+' # Push events to 0.X.X tag
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Calculate docker image tag
id: set-tag
run: |
case "${GITHUB_REF}" in
refs/heads/master|refs/heads/main)
tag=latest
;;
refs/tags/*)
tag=${GITHUB_REF#refs/tags/}
;;
*)
tag=${GITHUB_SHA}
;;
esac
echo "::set-output name=tag::$tag"
- name: Build and Push Tag
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: "awesometechnologies/synapse-admin:${{ steps.set-tag.outputs.tag }}"
platforms: linux/amd64,linux/arm64
+1
View File
@@ -10,6 +10,7 @@
# production # production
/build /build
/dist
# misc # misc
.DS_Store .DS_Store
+2 -2
View File
@@ -6,6 +6,6 @@
"singleQuote": false, "singleQuote": false,
"trailingComma": "es5", "trailingComma": "es5",
"bracketSpacing": true, "bracketSpacing": true,
"jsxBracketSameLine": false, "bracketSameLine": false,
"arrowParens": "avoid", "arrowParens": "avoid"
} }
+2 -1
View File
@@ -1,5 +1,6 @@
dist: focal
language: node_js language: node_js
node_js: node_js:
- lts/* - 18
cache: yarn cache: yarn
+5 -3
View File
@@ -1,11 +1,13 @@
# Builder # Builder
FROM node:current as builder FROM node:lts as builder
ARG REACT_APP_SERVER
WORKDIR /src WORKDIR /src
COPY . /src COPY . /src
RUN yarn --network-timeout=100000 install RUN yarn --network-timeout=300000 install
RUN yarn build RUN REACT_APP_SERVER=$REACT_APP_SERVER yarn build
# App # App
+34 -11
View File
@@ -1,33 +1,53 @@
[![Build Status](https://travis-ci.org/Awesome-Technologies/synapse-admin.svg?branch=master)](https://travis-ci.org/Awesome-Technologies/synapse-admin) [![GitHub license](https://img.shields.io/github/license/Awesome-Technologies/synapse-admin)](https://github.com/Awesome-Technologies/synapse-admin/blob/master/LICENSE)
[![Build Status](https://api.travis-ci.com/Awesome-Technologies/synapse-admin.svg?branch=master)](https://app.travis-ci.com/github/Awesome-Technologies/synapse-admin)
[![build-test](https://github.com/Awesome-Technologies/synapse-admin/actions/workflows/build-test.yml/badge.svg)](https://github.com/Awesome-Technologies/synapse-admin/actions/workflows/build-test.yml) [![build-test](https://github.com/Awesome-Technologies/synapse-admin/actions/workflows/build-test.yml/badge.svg)](https://github.com/Awesome-Technologies/synapse-admin/actions/workflows/build-test.yml)
[![gh-pages](https://github.com/Awesome-Technologies/synapse-admin/actions/workflows/edge_ghpage.yml/badge.svg)](https://awesome-technologies.github.io/synapse-admin/)
[![docker-release](https://github.com/Awesome-Technologies/synapse-admin/actions/workflows/docker-release.yml/badge.svg)](https://hub.docker.com/r/awesometechnologies/synapse-admin)
[![github-release](https://github.com/Awesome-Technologies/synapse-admin/actions/workflows/github-release.yml/badge.svg)](https://github.com/Awesome-Technologies/synapse-admin/releases)
# Synapse admin ui # Synapse admin ui
This project is built using [react-admin](https://marmelab.com/react-admin/). This project is built using [react-admin](https://marmelab.com/react-admin/).
It needs at least Synapse v1.38.0 for all functions to work as expected! ## Usage
### Supported Synapse
It needs at least [Synapse](https://github.com/element-hq/synapse) v1.52.0 for all functions to work as expected!
You get your server version with the request `/_synapse/admin/v1/server_version`. You get your server version with the request `/_synapse/admin/v1/server_version`.
See also [Synapse version API](https://matrix-org.github.io/synapse/develop/admin_api/version_api.html). See also [Synapse version API](https://element-hq.github.io/synapse/latest/admin_api/version_api.html).
After entering the URL on the login page of synapse-admin the server version appears below the input field. After entering the URL on the login page of synapse-admin the server version appears below the input field.
### Prerequisites
You need access to the following endpoints: You need access to the following endpoints:
- `/_matrix` - `/_matrix`
- `/_synapse/admin` - `/_synapse/admin`
See also [Synapse administration endpoints](https://matrix-org.github.io/synapse/develop/reverse_proxy.html#synapse-administration-endpoints) See also [Synapse administration endpoints](https://element-hq.github.io/synapse/latest/reverse_proxy.html#synapse-administration-endpoints)
## Step-By-Step install: ### Use without install
You can use the current version of Synapse Admin without own installation direct
via [GitHub Pages](https://awesome-technologies.github.io/synapse-admin/).
**Note:**
If you want to use the deployment, you have to make sure that the admin endpoints (`/_synapse/admin`) are accessible for your browser.
**Remember: You have no need to expose these endpoints to the internet but to your network.**
If you want your own deployment, follow the [Step-By-Step Install Guide](#step-by-step-install) below.
### Step-By-Step install
You have three options: You have three options:
1. Download the tarball and serve with any webserver 1. [Download the tarball and serve with any webserver](#steps-for-1)
2. Download the source code from github and run using nodejs 2. [Download the source code from github and run using nodejs](#steps-for-2)
3. Run the Docker container 3. [Run the Docker container](#steps-for-3)
Steps for 1): #### Steps for 1)
- make sure you have a webserver installed that can serve static files (any webserver like nginx or apache will do) - make sure you have a webserver installed that can serve static files (any webserver like nginx or apache will do)
- configure a vhost for synapse admin on your webserver - configure a vhost for synapse admin on your webserver
@@ -36,7 +56,7 @@ Steps for 1):
- move or symlink the `synapse-admin-x.x.x` into your vhosts root dir - move or symlink the `synapse-admin-x.x.x` into your vhosts root dir
- open the url of the vhost in your browser - open the url of the vhost in your browser
Steps for 2): #### Steps for 2)
- make sure you have installed the following: git, yarn, nodejs - make sure you have installed the following: git, yarn, nodejs
- download the source code: `git clone https://github.com/Awesome-Technologies/synapse-admin.git` - download the source code: `git clone https://github.com/Awesome-Technologies/synapse-admin.git`
@@ -49,7 +69,7 @@ Either you define it at startup (e.g. `REACT_APP_SERVER=https://yourmatrixserver
or by editing it in the [.env](.env) file. See also the or by editing it in the [.env](.env) file. See also the
[documentation](https://create-react-app.dev/docs/adding-custom-environment-variables/). [documentation](https://create-react-app.dev/docs/adding-custom-environment-variables/).
Steps for 3): #### Steps for 3)
- run the Docker container from the public docker registry: `docker run -p 8080:80 awesometechnologies/synapse-admin` or use the [docker-compose.yml](docker-compose.yml): `docker-compose up -d` - run the Docker container from the public docker registry: `docker run -p 8080:80 awesometechnologies/synapse-admin` or use the [docker-compose.yml](docker-compose.yml): `docker-compose up -d`
@@ -66,6 +86,9 @@ Steps for 3):
context: https://github.com/Awesome-Technologies/synapse-admin.git context: https://github.com/Awesome-Technologies/synapse-admin.git
# args: # args:
# - NODE_OPTIONS="--max_old_space_size=1024" # - NODE_OPTIONS="--max_old_space_size=1024"
# # see #266, PUBLIC_URL must be without surrounding quotation marks
# - PUBLIC_URL=/synapse-admin
# - REACT_APP_SERVER="https://matrix.example.com"
ports: ports:
- "8080:80" - "8080:80"
restart: unless-stopped restart: unless-stopped
+6 -1
View File
@@ -12,10 +12,15 @@ services:
# replace the context definition with this: # replace the context definition with this:
# context: https://github.com/Awesome-Technologies/synapse-admin.git # context: https://github.com/Awesome-Technologies/synapse-admin.git
# args:
# if you're building on an architecture other than amd64, make sure # if you're building on an architecture other than amd64, make sure
# to define a maximum ram for node. otherwise the build will fail. # to define a maximum ram for node. otherwise the build will fail.
# args:
# - NODE_OPTIONS="--max_old_space_size=1024" # - NODE_OPTIONS="--max_old_space_size=1024"
# default is .
# - PUBLIC_URL=/synapse-admin
# You can use a fixed homeserver, so that the user can no longer
# define it himself
# - REACT_APP_SERVER="https://matrix.example.com"
ports: ports:
- "8080:80" - "8080:80"
restart: unless-stopped restart: unless-stopped
+149
View File
@@ -0,0 +1,149 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="./favicon.ico" />
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Synapse-Admin"
/>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="./manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Synapse-Admin</title>
<style>
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
.loader-container {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: #fafafa;
}
/* CSS Spinner from https://projects.lukehaas.me/css-loaders/ */
.loader,
.loader:before,
.loader:after {
border-radius: 50%;
}
.loader {
color: #283593;
font-size: 11px;
text-indent: -99999em;
margin: 55px auto;
position: relative;
width: 10em;
height: 10em;
box-shadow: inset 0 0 0 1em;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
}
.loader:before,
.loader:after {
position: absolute;
content: '';
}
.loader:before {
width: 5.2em;
height: 10.2em;
background: #fafafa;
border-radius: 10.2em 0 0 10.2em;
top: -0.1em;
left: -0.1em;
-webkit-transform-origin: 5.2em 5.1em;
transform-origin: 5.2em 5.1em;
-webkit-animation: load2 2s infinite ease 1.5s;
animation: load2 2s infinite ease 1.5s;
}
.loader:after {
width: 5.2em;
height: 10.2em;
background: #fafafa;
border-radius: 0 10.2em 10.2em 0;
top: -0.1em;
left: 5.1em;
-webkit-transform-origin: 0px 5.1em;
transform-origin: 0px 5.1em;
-webkit-animation: load2 2s infinite ease;
animation: load2 2s infinite ease;
}
@-webkit-keyframes load2 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes load2 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
</style>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap"
rel="stylesheet"
/>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root">
<div class="loader-container">
<div class="loader">Loading...</div>
</div>
</div>
<footer
style="position: relative; z-index: 2; height: 2em; margin-top: -2em; line-height: 2em; background-color: #eee; border: 0.5px solid #ddd">
<a id="copyright" href="https://github.com/Awesome-Technologies/synapse-admin"
style="margin-left: 1em; color: #888; font-family: Roboto, Helvetica, Arial, sans-serif; font-weight: 100; font-size: 0.8em; text-decoration: none;">
Synapse-Admin <b>(%REACT_APP_VERSION%)</b> by Awesome Technologies Innovationslabor GmbH
</a>
</footer>
</body>
<script type="module" src="/src/index.jsx"></script>
</html>
+23 -19
View File
@@ -1,6 +1,6 @@
{ {
"name": "synapse-admin", "name": "synapse-admin",
"version": "0.8.3", "version": "0.9.0",
"description": "Admin GUI for the Matrix.org server Synapse", "description": "Admin GUI for the Matrix.org server Synapse",
"author": "Awesome Technologies Innovationslabor GmbH", "author": "Awesome Technologies Innovationslabor GmbH",
"license": "Apache-2.0", "license": "Apache-2.0",
@@ -10,29 +10,34 @@
"url": "https://github.com/Awesome-Technologies/synapse-admin" "url": "https://github.com/Awesome-Technologies/synapse-admin"
}, },
"devDependencies": { "devDependencies": {
"@testing-library/jest-dom": "^5.1.1", "@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^11.2.6", "@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^13.1.8", "@testing-library/user-event": "^14.5.2",
"eslint": "^7.25.0", "@vitejs/plugin-react": "^4.0.0",
"eslint-config-prettier": "^8.3.0", "eslint": "^8.56.0",
"eslint-plugin-prettier": "^3.1.2", "eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-prettier": "^5.1.3",
"jest-fetch-mock": "^3.0.3", "jest-fetch-mock": "^3.0.3",
"prettier": "^2.2.0", "prettier": "^3.2.5",
"ra-test": "^3.15.0" "vite": "^4.0.0"
}, },
"dependencies": { "dependencies": {
"papaparse": "^5.2.0", "@mui/icons-material": "^5.15.7",
"prop-types": "^15.7.2", "@mui/material": "^5.15.7",
"@mui/styles": "^5.15.8",
"papaparse": "^5.4.1",
"ra-language-chinese": "^2.0.10", "ra-language-chinese": "^2.0.10",
"ra-language-french": "^4.16.9",
"ra-language-german": "^3.13.4", "ra-language-german": "^3.13.4",
"react": "^17.0.0", "ra-language-italian": "^3.13.1",
"react-admin": "^3.15.0", "react": "^18.0.0",
"react-dom": "^17.0.2", "react-admin": "^4.16.9",
"react-scripts": "^4.0.0" "react-dom": "^18.0.0"
}, },
"scripts": { "scripts": {
"start": "REACT_APP_VERSION=$(git describe --tags) react-scripts start", "start": "REACT_APP_VERSION=$(git describe --tags) vite serve",
"build": "REACT_APP_VERSION=$(git describe --tags) react-scripts build", "build": "REACT_APP_VERSION=$(git describe --tags) vite build",
"fix:other": "yarn prettier --write", "fix:other": "yarn prettier --write",
"fix:code": "yarn test:lint --fix", "fix:code": "yarn test:lint --fix",
"fix": "yarn fix:code && yarn fix:other", "fix": "yarn fix:code && yarn fix:other",
@@ -40,8 +45,7 @@
"test:code": "react-scripts test", "test:code": "react-scripts test",
"test:lint": "eslint --ignore-path .gitignore --ext .js,.jsx .", "test:lint": "eslint --ignore-path .gitignore --ext .js,.jsx .",
"test:style": "yarn prettier --list-different", "test:style": "yarn prettier --list-different",
"test": "yarn test:style && yarn test:lint && yarn test:code", "test": "yarn test:style && yarn test:lint && yarn test:code"
"eject": "react-scripts eject"
}, },
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"
+1
View File
@@ -1,2 +1,3 @@
# https://www.robotstxt.org/robotstxt.html # https://www.robotstxt.org/robotstxt.html
User-agent: * User-agent: *
Disallow: /
-81
View File
@@ -1,81 +0,0 @@
import React from "react";
import { Admin, Resource, resolveBrowserLocale } from "react-admin";
import polyglotI18nProvider from "ra-i18n-polyglot";
import authProvider from "./synapse/authProvider";
import dataProvider from "./synapse/dataProvider";
import { UserList, UserCreate, UserEdit } from "./components/users";
import { RoomList, RoomShow } from "./components/rooms";
import { ReportList, ReportShow } from "./components/EventReports";
import LoginPage from "./components/LoginPage";
import UserIcon from "@material-ui/icons/Group";
import EqualizerIcon from "@material-ui/icons/Equalizer";
import { UserMediaStatsList } from "./components/statistics";
import RoomIcon from "@material-ui/icons/ViewList";
import ReportIcon from "@material-ui/icons/Warning";
import FolderSharedIcon from "@material-ui/icons/FolderShared";
import { ImportFeature } from "./components/ImportFeature";
import { RoomDirectoryList } from "./components/RoomDirectory";
import { Route } from "react-router-dom";
import germanMessages from "./i18n/de";
import englishMessages from "./i18n/en";
import chineseMessages from "./i18n/zh";
// TODO: Can we use lazy loading together with browser locale?
const messages = {
de: germanMessages,
en: englishMessages,
zh: chineseMessages,
};
const i18nProvider = polyglotI18nProvider(
locale => (messages[locale] ? messages[locale] : messages.en),
resolveBrowserLocale()
);
const App = () => (
<Admin
disableTelemetry
loginPage={LoginPage}
authProvider={authProvider}
dataProvider={dataProvider}
i18nProvider={i18nProvider}
customRoutes={[
<Route key="userImport" path="/import_users" component={ImportFeature} />,
]}
>
<Resource
name="users"
list={UserList}
create={UserCreate}
edit={UserEdit}
icon={UserIcon}
/>
<Resource name="rooms" list={RoomList} show={RoomShow} icon={RoomIcon} />
<Resource
name="user_media_statistics"
list={UserMediaStatsList}
icon={EqualizerIcon}
/>
<Resource
name="reports"
list={ReportList}
show={ReportShow}
icon={ReportIcon}
/>
<Resource
name="room_directory"
list={RoomDirectoryList}
icon={FolderSharedIcon}
/>
<Resource name="connections" />
<Resource name="devices" />
<Resource name="room_members" />
<Resource name="users_media" />
<Resource name="joined_rooms" />
<Resource name="pushers" />
<Resource name="servernotices" />
<Resource name="forward_extremities" />
<Resource name="room_state" />
</Admin>
);
export default App;
+74
View File
@@ -0,0 +1,74 @@
import React from "react";
import {
Admin,
CustomRoutes,
Resource,
resolveBrowserLocale,
} from "react-admin";
import polyglotI18nProvider from "ra-i18n-polyglot";
import authProvider from "./synapse/authProvider";
import dataProvider from "./synapse/dataProvider";
import users from "./components/users";
import rooms from "./components/rooms";
import userMediaStats from "./components/statistics";
import reports from "./components/EventReports";
import roomDirectory from "./components/RoomDirectory";
import destinations from "./components/destinations";
import registrationToken from "./components/RegistrationTokens";
import LoginPage from "./components/LoginPage";
import { ImportFeature } from "./components/ImportFeature";
import { Route } from "react-router-dom";
import germanMessages from "./i18n/de";
import englishMessages from "./i18n/en";
import frenchMessages from "./i18n/fr";
import chineseMessages from "./i18n/zh";
import italianMessages from "./i18n/it";
const fixed_base_url = undefined; // FIXME: process.env.REACT_APP_SERVER;
// TODO: Can we use lazy loading together with browser locale?
const messages = {
de: germanMessages,
en: englishMessages,
fr: frenchMessages,
it: italianMessages,
zh: chineseMessages,
};
const i18nProvider = polyglotI18nProvider(
locale => (messages[locale] ? messages[locale] : messages.en),
resolveBrowserLocale()
);
const App = () => (
<Admin
disableTelemetry
requireAuth
loginPage={LoginPage}
authProvider={authProvider(fixed_base_url)}
dataProvider={dataProvider}
i18nProvider={i18nProvider}
>
<CustomRoutes>
<Route path="/import_users" element={<ImportFeature />} />
</CustomRoutes>
<Resource {...users} />
<Resource {...rooms} />
<Resource {...userMediaStats} />
<Resource {...reports} />
<Resource {...roomDirectory} />
<Resource {...destinations} />
<Resource {...registrationToken} />
<Resource name="connections" />
<Resource name="devices" />
<Resource name="room_members" />
<Resource name="users_media" />
<Resource name="joined_rooms" />
<Resource name="pushers" />
<Resource name="servernotices" />
<Resource name="forward_extremities" />
<Resource name="room_state" />
<Resource name="destination_rooms" />
</Admin>
);
export default App;
+22
View File
@@ -0,0 +1,22 @@
import React from "react";
import get from "lodash/get";
import { Avatar } from "@mui/material";
import { useRecordContext } from "react-admin";
const AvatarField = ({ source, ...rest }) => {
const record = useRecordContext(rest);
const src = get(record, source)?.toString();
const { alt, classes, sizes, sx, variant } = rest;
return (
<Avatar
alt={alt}
classes={classes}
sizes={sizes}
src={src}
sx={sx}
variant={variant}
/>
);
};
export default AvatarField;
+18
View File
@@ -0,0 +1,18 @@
import React from "react";
import { RecordContextProvider } from "react-admin";
import { render, screen } from "@testing-library/react";
import AvatarField from "./AvatarField";
describe("AvatarField", () => {
it("shows image", () => {
const value = {
avatar: "foo",
};
render(
<RecordContextProvider value={value}>
<AvatarField source="avatar" />
</RecordContextProvider>
);
expect(screen.getByRole("img").getAttribute("src")).toBe("foo");
});
});
@@ -2,6 +2,7 @@ import React from "react";
import { import {
Datagrid, Datagrid,
DateField, DateField,
DeleteButton,
List, List,
NumberField, NumberField,
Pagination, Pagination,
@@ -10,19 +11,31 @@ import {
Tab, Tab,
TabbedShowLayout, TabbedShowLayout,
TextField, TextField,
TopToolbar,
useRecordContext,
useTranslate, useTranslate,
} from "react-admin"; } from "react-admin";
import PageviewIcon from "@material-ui/icons/Pageview"; import PageviewIcon from "@mui/icons-material/Pageview";
import ViewListIcon from "@material-ui/icons/ViewList"; import ReportIcon from "@mui/icons-material/Warning";
import ViewListIcon from "@mui/icons-material/ViewList";
const ReportPagination = props => ( const date_format = {
<Pagination {...props} rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} /> year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
};
const ReportPagination = () => (
<Pagination rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />
); );
export const ReportShow = props => { export const ReportShow = props => {
const translate = useTranslate(); const translate = useTranslate();
return ( return (
<Show {...props}> <Show {...props} actions={<ReportShowActions />}>
<TabbedShowLayout> <TabbedShowLayout>
<Tab <Tab
label={translate("synapseadmin.reports.tabs.basic", { label={translate("synapseadmin.reports.tabs.basic", {
@@ -33,14 +46,7 @@ export const ReportShow = props => {
<DateField <DateField
source="received_ts" source="received_ts"
showTime showTime
options={{ options={date_format}
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
sortable={true} sortable={true}
/> />
<ReferenceField source="user_id" reference="users"> <ReferenceField source="user_id" reference="users">
@@ -68,23 +74,16 @@ export const ReportShow = props => {
icon={<PageviewIcon />} icon={<PageviewIcon />}
path="detail" path="detail"
> >
{" "}
<DateField <DateField
source="event_json.origin_server_ts" source="event_json.origin_server_ts"
showTime showTime
options={{ options={date_format}
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
sortable={true} sortable={true}
/> />
<ReferenceField source="sender" reference="users"> <ReferenceField source="sender" reference="users">
<TextField source="id" /> <TextField source="id" />
</ReferenceField> </ReferenceField>
<TextField source="sender" label="Sender (raw user ID)" />
<TextField source="event_id" /> <TextField source="event_id" />
<TextField source="event_json.origin" /> <TextField source="event_json.origin" />
<TextField source="event_json.type" /> <TextField source="event_json.type" />
@@ -95,7 +94,7 @@ export const ReportShow = props => {
<TextField source="event_json.content.algorithm" /> <TextField source="event_json.content.algorithm" />
<TextField <TextField
source="event_json.content.device_id" source="event_json.content.device_id"
label="resources.users.fields.device_id" label="resources.devices.fields.device_id"
/> />
</Tab> </Tab>
</TabbedShowLayout> </TabbedShowLayout>
@@ -103,27 +102,33 @@ export const ReportShow = props => {
); );
}; };
export const ReportList = ({ ...props }) => { const ReportShowActions = () => {
const record = useRecordContext();
return ( return (
<TopToolbar>
<DeleteButton
record={record}
mutationMode="pessimistic"
confirmTitle="resources.reports.action.erase.title"
confirmContent="resources.reports.action.erase.content"
/>
</TopToolbar>
);
};
export const ReportList = props => (
<List <List
{...props} {...props}
pagination={<ReportPagination />} pagination={<ReportPagination />}
sort={{ field: "received_ts", order: "DESC" }} sort={{ field: "received_ts", order: "DESC" }}
bulkActionButtons={false}
> >
<Datagrid rowClick="show"> <Datagrid rowClick="show" bulkActionButtons={false}>
<TextField source="id" sortable={false} /> <TextField source="id" sortable={false} />
<DateField <DateField
source="received_ts" source="received_ts"
showTime showTime
options={{ options={date_format}
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
sortable={true} sortable={true}
/> />
<TextField sortable={false} source="user_id" /> <TextField sortable={false} source="user_id" />
@@ -131,5 +136,13 @@ export const ReportList = ({ ...props }) => {
<TextField sortable={false} source="score" /> <TextField sortable={false} source="score" />
</Datagrid> </Datagrid>
</List> </List>
); );
const resource = {
name: "reports",
icon: ReportIcon,
list: ReportList,
show: ReportShow,
}; };
export default resource;
@@ -1,41 +1,22 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { import { useDataProvider, useNotify, Title } from "react-admin";
Button as ReactAdminButton,
useDataProvider,
useNotify,
Title,
} from "react-admin";
import { parse as parseCsv, unparse as unparseCsv } from "papaparse"; import { parse as parseCsv, unparse as unparseCsv } from "papaparse";
import GetAppIcon from "@material-ui/icons/GetApp";
import { import {
Button, Button,
Card, Card,
CardActions, CardActions,
CardContent, CardContent,
CardHeader, CardHeader,
FormControlLabel,
Checkbox, Checkbox,
Container,
FormControlLabel,
NativeSelect, NativeSelect,
} from "@material-ui/core"; } from "@mui/material";
import { useTranslate } from "ra-core"; import { useTranslate } from "ra-core";
import Container from "@material-ui/core/Container/Container";
import { generateRandomUser } from "./users"; import { generateRandomUser } from "./users";
const LOGGING = true; const LOGGING = true;
export const ImportButton = ({ label, variant = "text" }) => {
return (
<ReactAdminButton
color="primary"
component="span"
variant={variant}
label={label}
>
<GetAppIcon style={{ transform: "rotate(180deg)", fontSize: "20" }} />
</ReactAdminButton>
);
};
const expectedFields = ["id", "displayname"].sort(); const expectedFields = ["id", "displayname"].sort();
const optionalFields = [ const optionalFields = [
"user_type", "user_type",
@@ -51,7 +32,7 @@ function TranslatableOption({ value, text }) {
return <option value={value}>{translate(text)}</option>; return <option value={value}>{translate(text)}</option>;
} }
const FilePicker = props => { const FilePicker = () => {
const [values, setValues] = useState(null); const [values, setValues] = useState(null);
const [error, setError] = useState(null); const [error, setError] = useState(null);
const [stats, setStats] = useState(null); const [stats, setStats] = useState(null);
@@ -210,7 +191,7 @@ const FilePicker = props => {
return true; return true;
}; };
const runImport = async e => { const runImport = async _e => {
if (progress !== null) { if (progress !== null) {
notify("import_users.errors.already_in_progress"); notify("import_users.errors.already_in_progress");
return; return;
@@ -326,7 +307,7 @@ const FilePicker = props => {
let retries = 0; let retries = 0;
const submitRecord = recordData => { const submitRecord = recordData => {
return dataProvider.getOne("users", { id: recordData.id }).then( return dataProvider.getOne("users", { id: recordData.id }).then(
async alreadyExists => { async _alreadyExists => {
if (LOGGING) console.log("already existed"); if (LOGGING) console.log("already existed");
if (useridMode === "update" || conflictMode === "skip") { if (useridMode === "update" || conflictMode === "skip") {
@@ -351,7 +332,7 @@ const FilePicker = props => {
} }
} }
}, },
async okToSubmit => { async _okToSubmit => {
if (LOGGING) if (LOGGING)
console.log( console.log(
"OK to create record " + "OK to create record " +
-293
View File
@@ -1,293 +0,0 @@
import React, { useState, useEffect } from "react";
import {
fetchUtils,
FormDataConsumer,
Notification,
useLogin,
useNotify,
useLocale,
useSetLocale,
useTranslate,
PasswordInput,
TextInput,
} from "react-admin";
import { Form, useForm } from "react-final-form";
import {
Avatar,
Button,
Card,
CardActions,
CircularProgress,
MenuItem,
Select,
TextField,
} from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
import LockIcon from "@material-ui/icons/Lock";
const useStyles = makeStyles(theme => ({
main: {
display: "flex",
flexDirection: "column",
minHeight: "calc(100vh - 1em)",
alignItems: "center",
justifyContent: "flex-start",
background: "url(./images/floating-cogs.svg)",
backgroundColor: "#f9f9f9",
backgroundRepeat: "no-repeat",
backgroundSize: "cover",
},
card: {
minWidth: "30em",
marginTop: "6em",
marginBottom: "6em",
},
avatar: {
margin: "1em",
display: "flex",
justifyContent: "center",
},
icon: {
backgroundColor: theme.palette.secondary.main,
},
hint: {
marginTop: "1em",
display: "flex",
justifyContent: "center",
color: theme.palette.grey[500],
},
form: {
padding: "0 1em 1em 1em",
},
input: {
marginTop: "1em",
},
actions: {
padding: "0 1em 1em 1em",
},
serverVersion: {
color: "#9e9e9e",
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
marginBottom: "1em",
marginLeft: "0.5em",
},
}));
const LoginPage = ({ theme }) => {
const classes = useStyles({ theme });
const login = useLogin();
const notify = useNotify();
const [loading, setLoading] = useState(false);
var locale = useLocale();
const setLocale = useSetLocale();
const translate = useTranslate();
const base_url = localStorage.getItem("base_url");
const cfg_base_url = process.env.REACT_APP_SERVER;
const renderInput = ({
meta: { touched, error } = {},
input: { ...inputProps },
...props
}) => (
<TextField
error={!!(touched && error)}
helperText={touched && error}
{...inputProps}
{...props}
fullWidth
/>
);
const validate = values => {
const errors = {};
if (!values.username) {
errors.username = translate("ra.validation.required");
}
if (!values.password) {
errors.password = translate("ra.validation.required");
}
if (!values.base_url) {
errors.base_url = translate("ra.validation.required");
} else {
if (!values.base_url.match(/^(http|https):\/\//)) {
errors.base_url = translate("synapseadmin.auth.protocol_error");
} else if (
!values.base_url.match(
/^(http|https):\/\/[a-zA-Z0-9\-.]+(:\d{1,5})?[^?&\s]*$/
)
) {
errors.base_url = translate("synapseadmin.auth.url_error");
}
}
return errors;
};
const handleSubmit = auth => {
setLoading(true);
login(auth).catch(error => {
setLoading(false);
notify(
typeof error === "string"
? error
: typeof error === "undefined" || !error.message
? "ra.auth.sign_in_error"
: error.message,
"warning"
);
});
};
const extractHomeServer = username => {
const usernameRegex = /@[a-zA-Z0-9._=\-/]+:([a-zA-Z0-9\-.]+\.[a-zA-Z]+)/;
if (!username) return null;
const res = username.match(usernameRegex);
if (res) return res[1];
return null;
};
const UserData = ({ formData }) => {
const form = useForm();
const [serverVersion, setServerVersion] = useState("");
const handleUsernameChange = _ => {
if (formData.base_url || cfg_base_url) return;
// check if username is a full qualified userId then set base_url accordially
const home_server = extractHomeServer(formData.username);
const wellKnownUrl = `https://${home_server}/.well-known/matrix/client`;
if (home_server) {
// fetch .well-known entry to get base_url
fetchUtils
.fetchJson(wellKnownUrl, { method: "GET" })
.then(({ json }) => {
form.change("base_url", json["m.homeserver"].base_url);
})
.catch(_ => {
// if there is no .well-known entry, try the home server name
form.change("base_url", `https://${home_server}`);
});
}
};
useEffect(
_ => {
if (
!formData.base_url ||
!formData.base_url.match(/^(http|https):\/\/[a-zA-Z0-9\-.]+$/)
)
return;
const versionUrl = `${formData.base_url}/_synapse/admin/v1/server_version`;
fetchUtils
.fetchJson(versionUrl, { method: "GET" })
.then(({ json }) => {
setServerVersion(
`${translate("synapseadmin.auth.server_version")} ${
json["server_version"]
}`
);
})
.catch(_ => {
setServerVersion("");
});
},
[formData.base_url]
);
return (
<div>
<div className={classes.input}>
<TextInput
autoFocus
name="username"
component={renderInput}
label={translate("ra.auth.username")}
disabled={loading}
onBlur={handleUsernameChange}
resettable
fullWidth
/>
</div>
<div className={classes.input}>
<PasswordInput
name="password"
component={renderInput}
label={translate("ra.auth.password")}
type="password"
disabled={loading}
resettable
fullWidth
/>
</div>
<div className={classes.input}>
<TextInput
name="base_url"
component={renderInput}
label={translate("synapseadmin.auth.base_url")}
disabled={cfg_base_url || loading}
resettable
fullWidth
/>
</div>
<div className={classes.serverVersion}>{serverVersion}</div>
</div>
);
};
return (
<Form
initialValues={{ base_url: cfg_base_url || base_url }}
onSubmit={handleSubmit}
validate={validate}
render={({ handleSubmit }) => (
<form onSubmit={handleSubmit} noValidate>
<div className={classes.main}>
<Card className={classes.card}>
<div className={classes.avatar}>
<Avatar className={classes.icon}>
<LockIcon />
</Avatar>
</div>
<div className={classes.hint}>
{translate("synapseadmin.auth.welcome")}
</div>
<div className={classes.form}>
<div className={classes.input}>
<Select
value={locale}
onChange={e => {
setLocale(e.target.value);
}}
fullWidth
disabled={loading}
>
<MenuItem value="de">Deutsch</MenuItem>
<MenuItem value="en">English</MenuItem>
<MenuItem value="zh">简体中文</MenuItem>
</Select>
</div>
<FormDataConsumer>
{formDataProps => <UserData {...formDataProps} />}
</FormDataConsumer>
</div>
<CardActions className={classes.actions}>
<Button
variant="contained"
type="submit"
color="primary"
disabled={loading}
className={classes.button}
fullWidth
>
{loading && <CircularProgress size={25} thickness={2} />}
{translate("ra.auth.sign_in")}
</Button>
</CardActions>
</Card>
<Notification />
</div>
</form>
)}
/>
);
};
export default LoginPage;
+328
View File
@@ -0,0 +1,328 @@
import React, { useState, useEffect } from "react";
import {
Form,
FormDataConsumer,
Notification,
required,
useLogin,
useNotify,
useLocaleState,
useStoreContext,
useTranslate,
PasswordInput,
TextInput,
} from "react-admin";
import { useFormContext } from "react-hook-form";
import {
Avatar,
Box,
Button,
Card,
CardActions,
CircularProgress,
MenuItem,
Select,
TextField,
Typography,
} from "@mui/material";
import { styled } from "@mui/material/styles";
import LockIcon from "@mui/icons-material/Lock";
import {
getServerVersion,
getSupportedLoginFlows,
getWellKnownUrl,
isValidBaseUrl,
splitMxid,
} from "../synapse/synapse";
const FormBox = styled(Box)(({ theme }) => ({
display: "flex",
flexDirection: "column",
minHeight: "calc(100vh - 1em)",
alignItems: "center",
justifyContent: "flex-start",
background: "url(./images/floating-cogs.svg)",
backgroundColor: "#f9f9f9",
backgroundRepeat: "no-repeat",
backgroundSize: "cover",
[`& .card`]: {
minWidth: "30em",
marginTop: "6em",
marginBottom: "6em",
},
[`& .avatar`]: {
margin: "1em",
display: "flex",
justifyContent: "center",
},
[`& .icon`]: {
backgroundColor: theme.palette.grey[500],
},
[`& .hint`]: {
marginTop: "1em",
display: "flex",
justifyContent: "center",
color: theme.palette.grey[600],
},
[`& .form`]: {
padding: "0 1em 1em 1em",
},
[`& .input`]: {
marginTop: "1em",
},
[`& .actions`]: {
padding: "0 1em 1em 1em",
},
[`& .serverVersion`]: {
color: theme.palette.grey[500],
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
marginBottom: "1em",
marginLeft: "0.5em",
},
}));
const LoginPage = ({ cfg_base_url }) => {
const login = useLogin();
const notify = useNotify();
const store = useStoreContext();
const [loading, setLoading] = useState(false);
const [supportPassAuth, setSupportPassAuth] = useState(true);
const [locale, setLocale] = useLocaleState();
const translate = useTranslate();
const base_url = store.getItem("base_url");
const [ssoBaseUrl, setSSOBaseUrl] = useState("");
const loginToken = /\?loginToken=([a-zA-Z0-9_-]+)/.exec(window.location.href);
if (loginToken) {
const ssoToken = loginToken[1];
console.log("SSO token is", ssoToken);
// Prevent further requests
window.history.replaceState(
{},
"",
window.location.href.replace(loginToken[0], "#").split("#")[0]
);
const baseUrl = store.getItem("sso_base_url");
store.removeItem("sso_base_url");
if (baseUrl) {
const auth = {
base_url: baseUrl,
username: null,
password: null,
loginToken: ssoToken,
};
console.log("Base URL is:", baseUrl);
console.log("SSO Token is:", ssoToken);
console.log("Let's try token login...");
login(auth).catch(error => {
alert(
typeof error === "string"
? error
: typeof error === "undefined" || !error.message
? "ra.auth.sign_in_error"
: error.message
);
console.error(error);
});
}
}
const renderInput = ({
meta: { touched, error } = {},
input: { ...inputProps },
...props
}) => (
<TextField
error={!!(touched && error)}
helperText={touched && error}
{...inputProps}
{...props}
fullWidth
/>
);
const validateBaseUrl = value => {
if (!value.match(/^(http|https):\/\//)) {
return translate("synapseadmin.auth.protocol_error");
} else if (
!value.match(/^(http|https):\/\/[a-zA-Z0-9\-.]+(:\d{1,5})?[^?&\s]*$/)
) {
return translate("synapseadmin.auth.url_error");
} else {
return undefined;
}
};
const handleSubmit = auth => {
setLoading(true);
login(auth).catch(error => {
setLoading(false);
notify(
typeof error === "string"
? error
: typeof error === "undefined" || !error.message
? "ra.auth.sign_in_error"
: error.message,
{ type: "warning" }
);
});
};
const handleSSO = () => {
store.setItem("sso_base_url", ssoBaseUrl);
const ssoFullUrl = `${ssoBaseUrl}/_matrix/client/r0/login/sso/redirect?redirectUrl=${encodeURIComponent(
window.location.href
)}`;
window.location.href = ssoFullUrl;
};
const UserData = ({ formData }) => {
const form = useFormContext();
const [serverVersion, setServerVersion] = useState("");
const handleUsernameChange = _ => {
if (formData.base_url || cfg_base_url) return;
// check if username is a full qualified userId then set base_url accordingly
const domain = splitMxid(formData.username)?.domain;
if (domain) {
getWellKnownUrl(domain).then(url => form.setValue("base_url", url));
}
};
useEffect(() => {
if (!isValidBaseUrl(formData.base_url)) return;
getServerVersion(formData.base_url)
.then(serverVersion =>
setServerVersion(
`${translate("synapseadmin.auth.server_version")} ${serverVersion}`
)
)
.catch(() => setServerVersion(""));
// Set SSO Url
getSupportedLoginFlows(formData.base_url)
.then(loginFlows => {
const supportPass =
loginFlows.find(f => f.type === "m.login.password") !== undefined;
const supportSSO =
loginFlows.find(f => f.type === "m.login.sso") !== undefined;
setSupportPassAuth(supportPass);
setSSOBaseUrl(supportSSO ? formData.base_url : "");
})
.catch(() => setSSOBaseUrl(""));
}, [formData.base_url]);
return (
<>
<Box>
<TextInput
autoFocus
name="username"
component={renderInput}
label="ra.auth.username"
disabled={loading || !supportPassAuth}
onBlur={handleUsernameChange}
resettable
fullWidth
className="input"
validate={required()}
/>
</Box>
<Box>
<PasswordInput
name="password"
component={renderInput}
label="ra.auth.password"
type="password"
disabled={loading || !supportPassAuth}
resettable
fullWidth
className="input"
validate={required()}
/>
</Box>
<Box>
<TextInput
name="base_url"
component={renderInput}
label="synapseadmin.auth.base_url"
disabled={cfg_base_url != null || loading}
resettable
fullWidth
className="input"
validate={[required(), validateBaseUrl]}
/>
</Box>
<Typography className="serverVersion">{serverVersion}</Typography>
</>
);
};
return (
<Form
defaultValues={{ base_url: cfg_base_url || base_url }}
onSubmit={handleSubmit}
mode="onTouched"
>
<FormBox>
<Card className="card">
<Box className="avatar">
{loading ? (
<CircularProgress size={25} thickness={2} />
) : (
<Avatar className="icon">
<LockIcon />
</Avatar>
)}
</Box>
<Box className="hint">{translate("synapseadmin.auth.welcome")}</Box>
<Box className="form">
<Select
value={locale}
onChange={e => {
setLocale(e.target.value);
}}
fullWidth
disabled={loading}
className="input"
>
<MenuItem value="de">Deutsch</MenuItem>
<MenuItem value="en">English</MenuItem>
<MenuItem value="fr">Français</MenuItem>
<MenuItem value="it">Italiano</MenuItem>
<MenuItem value="zh">简体中文</MenuItem>
</Select>
<FormDataConsumer>
{formDataProps => <UserData {...formDataProps} />}
</FormDataConsumer>
<CardActions className="actions">
<Button
variant="contained"
type="submit"
color="primary"
disabled={loading || !supportPassAuth}
fullWidth
>
{translate("ra.auth.sign_in")}
</Button>
<Button
variant="contained"
color="secondary"
onClick={handleSSO}
disabled={loading || ssoBaseUrl === ""}
fullWidth
>
{translate("synapseadmin.auth.sso_sign_in")}
</Button>
</CardActions>
</Box>
</Card>
</FormBox>
<Notification />
</Form>
);
};
export default LoginPage;
@@ -1,14 +1,14 @@
import React from "react"; import React from "react";
import { render } from "@testing-library/react"; import { render } from "@testing-library/react";
import { TestContext } from "ra-test"; import { AdminContext } from "react-admin";
import LoginPage from "./LoginPage"; import LoginPage from "./LoginPage";
describe("LoginForm", () => { describe("LoginForm", () => {
it("renders", () => { it("renders", () => {
render( render(
<TestContext> <AdminContext>
<LoginPage /> <LoginPage />
</TestContext> </AdminContext>
); );
}); });
}); });
-39
View File
@@ -1,39 +0,0 @@
// in src/Menu.js
import * as React from "react";
import { useSelector } from "react-redux";
import { useMediaQuery } from "@material-ui/core";
import { MenuItemLink, getResources } from "react-admin";
import DefaultIcon from "@material-ui/icons/ViewList";
import LabelIcon from "@material-ui/icons/Label";
const Menu = ({ onMenuClick, logout }) => {
const isXSmall = useMediaQuery(theme => theme.breakpoints.down("xs"));
const open = useSelector(state => state.admin.ui.sidebarOpen);
const resources = useSelector(getResources);
return (
<div>
{resources.map(resource => (
<MenuItemLink
key={resource.name}
to={`/${resource.name}`}
primaryText={
(resource.options && resource.options.label) || resource.name
}
leftIcon={resource.icon ? <resource.icon /> : <DefaultIcon />}
onClick={onMenuClick}
sidebarIsOpen={open}
/>
))}
<MenuItemLink
to="/custom-route"
primaryText="Miscellaneous"
leftIcon={<LabelIcon />}
onClick={onMenuClick}
sidebarIsOpen={open}
/>
{isXSmall && logout}
</div>
);
};
export default Menu;
+142
View File
@@ -0,0 +1,142 @@
import React from "react";
import {
BooleanInput,
Create,
Datagrid,
DateField,
DateTimeInput,
Edit,
List,
maxValue,
number,
NumberField,
NumberInput,
regex,
SaveButton,
SimpleForm,
TextInput,
TextField,
Toolbar,
} from "react-admin";
import RegistrationTokenIcon from "@mui/icons-material/ConfirmationNumber";
const date_format = {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
};
const validateToken = [regex(/^[A-Za-z0-9._~-]{0,64}$/)];
const validateUsesAllowed = [number()];
const validateLength = [number(), maxValue(64)];
const dateParser = v => {
const d = new Date(v);
if (isNaN(d)) return 0;
return d.getTime();
};
const dateFormatter = v => {
if (v === undefined || v === null) return;
const d = new Date(v);
const pad = "00";
const year = d.getFullYear().toString();
const month = (pad + (d.getMonth() + 1).toString()).slice(-2);
const day = (pad + d.getDate().toString()).slice(-2);
const hour = (pad + d.getHours().toString()).slice(-2);
const minute = (pad + d.getMinutes().toString()).slice(-2);
// target format yyyy-MM-ddThh:mm
return `${year}-${month}-${day}T${hour}:${minute}`;
};
const registrationTokenFilters = [<BooleanInput source="valid" alwaysOn />];
export const RegistrationTokenList = props => (
<List
{...props}
filters={registrationTokenFilters}
filterDefaultValues={{ valid: true }}
pagination={false}
perPage={500}
>
<Datagrid rowClick="edit">
<TextField source="token" sortable={false} />
<NumberField source="uses_allowed" sortable={false} />
<NumberField source="pending" sortable={false} />
<NumberField source="completed" sortable={false} />
<DateField
source="expiry_time"
showTime
options={date_format}
sortable={false}
/>
</Datagrid>
</List>
);
export const RegistrationTokenCreate = props => (
<Create {...props} redirect="list">
<SimpleForm
toolbar={
<Toolbar>
{/* It is possible to create tokens per default without input. */}
<SaveButton alwaysEnable />
</Toolbar>
}
>
<TextInput
source="token"
autoComplete="off"
validate={validateToken}
resettable
/>
<NumberInput
source="length"
validate={validateLength}
helperText="resources.registration_tokens.helper.length"
step={1}
/>
<NumberInput
source="uses_allowed"
validate={validateUsesAllowed}
step={1}
/>
<DateTimeInput source="expiry_time" parse={dateParser} />
</SimpleForm>
</Create>
);
export const RegistrationTokenEdit = props => (
<Edit {...props}>
<SimpleForm>
<TextInput source="token" disabled />
<NumberInput source="pending" disabled />
<NumberInput source="completed" disabled />
<NumberInput
source="uses_allowed"
validate={validateUsesAllowed}
step={1}
/>
<DateTimeInput
source="expiry_time"
parse={dateParser}
format={dateFormatter}
/>
</SimpleForm>
</Edit>
);
const resource = {
name: "users",
icon: RegistrationTokenIcon,
list: RegistrationTokenList,
edit: RegistrationTokenEdit,
create: RegistrationTokenCreate,
};
export default resource;
-256
View File
@@ -1,256 +0,0 @@
import React, { Fragment } from "react";
import Avatar from "@material-ui/core/Avatar";
import { Chip } from "@material-ui/core";
import { connect } from "react-redux";
import FolderSharedIcon from "@material-ui/icons/FolderShared";
import { makeStyles } from "@material-ui/core/styles";
import {
BooleanField,
BulkDeleteButton,
Button,
Datagrid,
DeleteButton,
Filter,
List,
NumberField,
Pagination,
TextField,
useCreate,
useMutation,
useNotify,
useTranslate,
useRefresh,
useUnselectAll,
} from "react-admin";
const useStyles = makeStyles({
small: {
height: "40px",
width: "40px",
},
});
const RoomDirectoryPagination = props => (
<Pagination {...props} rowsPerPageOptions={[100, 500, 1000, 2000]} />
);
export const RoomDirectoryDeleteButton = props => {
const translate = useTranslate();
return (
<DeleteButton
{...props}
label="resources.room_directory.action.erase"
redirect={false}
mutationMode="pessimistic"
confirmTitle={translate("resources.room_directory.action.title", {
smart_count: 1,
})}
confirmContent={translate("resources.room_directory.action.content", {
smart_count: 1,
})}
resource="room_directory"
icon={<FolderSharedIcon />}
/>
);
};
export const RoomDirectoryBulkDeleteButton = props => (
<BulkDeleteButton
{...props}
label="resources.room_directory.action.erase"
undoable={false}
confirmTitle="resources.room_directory.action.title"
confirmContent="resources.room_directory.action.content"
resource="room_directory"
icon={<FolderSharedIcon />}
/>
);
export const RoomDirectoryBulkSaveButton = ({ selectedIds }) => {
const notify = useNotify();
const refresh = useRefresh();
const unselectAll = useUnselectAll();
const [createMany, { loading }] = useMutation();
const handleSend = values => {
createMany(
{
type: "createMany",
resource: "room_directory",
payload: { ids: selectedIds, data: {} },
},
{
onSuccess: ({ data }) => {
notify("resources.room_directory.action.send_success");
unselectAll("rooms");
refresh();
},
onFailure: error =>
notify("resources.room_directory.action.send_failure", "error"),
}
);
};
return (
<Button
label="resources.room_directory.action.create"
onClick={handleSend}
disabled={loading}
>
<FolderSharedIcon />
</Button>
);
};
export const RoomDirectorySaveButton = ({ record }) => {
const notify = useNotify();
const refresh = useRefresh();
const [create, { loading }] = useCreate("room_directory");
const handleSend = values => {
create(
{
payload: { data: { id: record.id } },
},
{
onSuccess: ({ data }) => {
notify("resources.room_directory.action.send_success");
refresh();
},
onFailure: error =>
notify("resources.room_directory.action.send_failure", "error"),
}
);
};
return (
<Button
label="resources.room_directory.action.create"
onClick={handleSend}
disabled={loading}
>
<FolderSharedIcon />
</Button>
);
};
const RoomDirectoryBulkActionButtons = props => (
<Fragment>
<RoomDirectoryBulkDeleteButton {...props} />
</Fragment>
);
const AvatarField = ({ source, className, record = {} }) => (
<Avatar src={record[source]} className={className} />
);
const RoomDirectoryFilter = ({ ...props }) => {
const translate = useTranslate();
return (
<Filter {...props}>
<Chip
label={translate("resources.rooms.fields.room_id")}
source="room_id"
defaultValue={false}
style={{ marginBottom: 8 }}
/>
<Chip
label={translate("resources.rooms.fields.topic")}
source="topic"
defaultValue={false}
style={{ marginBottom: 8 }}
/>
<Chip
label={translate("resources.rooms.fields.canonical_alias")}
source="canonical_alias"
defaultValue={false}
style={{ marginBottom: 8 }}
/>
</Filter>
);
};
export const FilterableRoomDirectoryList = ({
roomDirectoryFilters,
dispatch,
...props
}) => {
const classes = useStyles();
const translate = useTranslate();
const filter = roomDirectoryFilters;
const roomIdFilter = filter && filter.room_id ? true : false;
const topicFilter = filter && filter.topic ? true : false;
const canonicalAliasFilter = filter && filter.canonical_alias ? true : false;
return (
<List
{...props}
pagination={<RoomDirectoryPagination />}
bulkActionButtons={<RoomDirectoryBulkActionButtons />}
filters={<RoomDirectoryFilter />}
perPage={100}
>
<Datagrid>
<AvatarField
source="avatar_src"
sortable={false}
className={classes.small}
label={translate("resources.rooms.fields.avatar")}
/>
<TextField
source="name"
sortable={false}
label={translate("resources.rooms.fields.name")}
/>
{roomIdFilter && (
<TextField
source="room_id"
sortable={false}
label={translate("resources.rooms.fields.room_id")}
/>
)}
{canonicalAliasFilter && (
<TextField
source="canonical_alias"
sortable={false}
label={translate("resources.rooms.fields.canonical_alias")}
/>
)}
{topicFilter && (
<TextField
source="topic"
sortable={false}
label={translate("resources.rooms.fields.topic")}
/>
)}
<NumberField
source="num_joined_members"
sortable={false}
label={translate("resources.rooms.fields.joined_members")}
/>
<BooleanField
source="world_readable"
sortable={false}
label={translate("resources.room_directory.fields.world_readable")}
/>
<BooleanField
source="guest_can_join"
sortable={false}
label={translate("resources.room_directory.fields.guest_can_join")}
/>
</Datagrid>
</List>
);
};
function mapStateToProps(state) {
return {
roomDirectoryFilters:
state.admin.resources.room_directory.list.params.displayedFilters,
};
}
export const RoomDirectoryList = connect(mapStateToProps)(
FilterableRoomDirectoryList
);
+206
View File
@@ -0,0 +1,206 @@
import React from "react";
import {
BooleanField,
BulkDeleteButton,
Button,
DatagridConfigurable,
ExportButton,
DeleteButton,
List,
NumberField,
Pagination,
SelectColumnsButton,
TextField,
TopToolbar,
useCreate,
useDataProvider,
useListContext,
useNotify,
useTranslate,
useRecordContext,
useRefresh,
useUnselectAll,
} from "react-admin";
import { useMutation } from "react-query";
import RoomDirectoryIcon from "@mui/icons-material/FolderShared";
import AvatarField from "./AvatarField";
const RoomDirectoryPagination = () => (
<Pagination rowsPerPageOptions={[100, 500, 1000, 2000]} />
);
export const RoomDirectoryUnpublishButton = props => {
const translate = useTranslate();
return (
<DeleteButton
{...props}
label="resources.room_directory.action.erase"
redirect={false}
mutationMode="pessimistic"
confirmTitle={translate("resources.room_directory.action.title", {
smart_count: 1,
})}
confirmContent={translate("resources.room_directory.action.content", {
smart_count: 1,
})}
resource="room_directory"
icon={<RoomDirectoryIcon />}
/>
);
};
export const RoomDirectoryBulkUnpublishButton = props => (
<BulkDeleteButton
{...props}
label="resources.room_directory.action.erase"
mutationMode="pessimistic"
confirmTitle="resources.room_directory.action.title"
confirmContent="resources.room_directory.action.content"
resource="room_directory"
icon={<RoomDirectoryIcon />}
/>
);
export const RoomDirectoryBulkPublishButton = props => {
const { selectedIds } = useListContext();
const notify = useNotify();
const refresh = useRefresh();
const unselectAllRooms = useUnselectAll("rooms");
const dataProvider = useDataProvider();
const { mutate, isLoading } = useMutation(
() =>
dataProvider.createMany("room_directory", {
ids: selectedIds,
data: {},
}),
{
onSuccess: () => {
notify("resources.room_directory.action.send_success");
unselectAllRooms();
refresh();
},
onError: () =>
notify("resources.room_directory.action.send_failure", {
type: "error",
}),
}
);
return (
<Button
{...props}
label="resources.room_directory.action.create"
onClick={mutate}
disabled={isLoading}
>
<RoomDirectoryIcon />
</Button>
);
};
export const RoomDirectoryPublishButton = props => {
const record = useRecordContext();
const notify = useNotify();
const refresh = useRefresh();
const [create, { isLoading }] = useCreate();
const handleSend = () => {
create(
"room_directory",
{ data: { id: record.id } },
{
onSuccess: () => {
notify("resources.room_directory.action.send_success");
refresh();
},
onError: () =>
notify("resources.room_directory.action.send_failure", {
type: "error",
}),
}
);
};
return (
<Button
{...props}
label="resources.room_directory.action.create"
onClick={handleSend}
disabled={isLoading}
>
<RoomDirectoryIcon />
</Button>
);
};
const RoomDirectoryListActions = () => (
<TopToolbar>
<SelectColumnsButton />
<ExportButton />
</TopToolbar>
);
export const RoomDirectoryList = () => (
<List
pagination={<RoomDirectoryPagination />}
perPage={100}
actions={<RoomDirectoryListActions />}
>
<DatagridConfigurable
rowClick={(id, _resource, _record) => "/rooms/" + id + "/show"}
bulkActionButtons={<RoomDirectoryBulkUnpublishButton />}
omit={["room_id", "canonical_alias", "topic"]}
>
<AvatarField
source="avatar_src"
sortable={false}
sx={{ height: "40px", width: "40px" }}
label="resources.rooms.fields.avatar"
/>
<TextField
source="name"
sortable={false}
label="resources.rooms.fields.name"
/>
<TextField
source="room_id"
sortable={false}
label="resources.rooms.fields.room_id"
/>
<TextField
source="canonical_alias"
sortable={false}
label="resources.rooms.fields.canonical_alias"
/>
<TextField
source="topic"
sortable={false}
label="resources.rooms.fields.topic"
/>
<NumberField
source="num_joined_members"
sortable={false}
label="resources.rooms.fields.joined_members"
/>
<BooleanField
source="world_readable"
sortable={false}
label="resources.room_directory.fields.world_readable"
/>
<BooleanField
source="guest_can_join"
sortable={false}
label="resources.room_directory.fields.guest_can_join"
/>
</DatagridConfigurable>
</List>
);
const resource = {
name: "room_directory",
icon: RoomDirectoryIcon,
list: RoomDirectoryList,
};
export default resource;
@@ -1,4 +1,4 @@
import React, { Fragment, useState } from "react"; import React, { useState } from "react";
import { import {
Button, Button,
SaveButton, SaveButton,
@@ -7,24 +7,32 @@ import {
Toolbar, Toolbar,
required, required,
useCreate, useCreate,
useMutation, useDataProvider,
useListContext,
useNotify, useNotify,
useRecordContext,
useTranslate, useTranslate,
useUnselectAll, useUnselectAll,
} from "react-admin"; } from "react-admin";
import MessageIcon from "@material-ui/icons/Message"; import { useMutation } from "react-query";
import IconCancel from "@material-ui/icons/Cancel"; import MessageIcon from "@mui/icons-material/Message";
import Dialog from "@material-ui/core/Dialog"; import IconCancel from "@mui/icons-material/Cancel";
import DialogContent from "@material-ui/core/DialogContent"; import {
import DialogContentText from "@material-ui/core/DialogContentText"; Dialog,
import DialogTitle from "@material-ui/core/DialogTitle"; DialogContent,
DialogContentText,
DialogTitle,
} from "@mui/material";
const ServerNoticeDialog = ({ open, loading, onClose, onSend }) => { const ServerNoticeDialog = ({ open, loading, onClose, onSubmit }) => {
const translate = useTranslate(); const translate = useTranslate();
const ServerNoticeToolbar = props => ( const ServerNoticeToolbar = props => (
<Toolbar {...props}> <Toolbar {...props}>
<SaveButton label="resources.servernotices.action.send" /> <SaveButton
label="resources.servernotices.action.send"
disabled={props.pristine}
/>
<Button label="ra.action.cancel" onClick={onClose}> <Button label="ra.action.cancel" onClick={onClose}>
<IconCancel /> <IconCancel />
</Button> </Button>
@@ -40,12 +48,7 @@ const ServerNoticeDialog = ({ open, loading, onClose, onSend }) => {
<DialogContentText> <DialogContentText>
{translate("resources.servernotices.helper.send")} {translate("resources.servernotices.helper.send")}
</DialogContentText> </DialogContentText>
<SimpleForm <SimpleForm toolbar={<ServerNoticeToolbar />} onSubmit={onSubmit}>
toolbar={<ServerNoticeToolbar />}
submitOnEnter={false}
redirect={false}
save={onSend}
>
<TextInput <TextInput
source="body" source="body"
label="resources.servernotices.fields.body" label="resources.servernotices.fields.body"
@@ -61,88 +64,92 @@ const ServerNoticeDialog = ({ open, loading, onClose, onSend }) => {
); );
}; };
export const ServerNoticeButton = ({ record }) => { export const ServerNoticeButton = () => {
const record = useRecordContext();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const notify = useNotify(); const notify = useNotify();
const [create, { loading }] = useCreate("servernotices"); const [create, { isloading }] = useCreate();
const handleDialogOpen = () => setOpen(true); const handleDialogOpen = () => setOpen(true);
const handleDialogClose = () => setOpen(false); const handleDialogClose = () => setOpen(false);
const handleSend = values => { const handleSend = values => {
create( create(
{ payload: { data: { id: record.id, ...values } } }, "servernotices",
{ data: { id: record.id, ...values } },
{ {
onSuccess: () => { onSuccess: () => {
notify("resources.servernotices.action.send_success"); notify("resources.servernotices.action.send_success");
handleDialogClose(); handleDialogClose();
}, },
onFailure: () => onError: () =>
notify("resources.servernotices.action.send_failure", "error"), notify("resources.servernotices.action.send_failure", {
type: "error",
}),
} }
); );
}; };
return ( return (
<Fragment> <>
<Button <Button
label="resources.servernotices.send" label="resources.servernotices.send"
onClick={handleDialogOpen} onClick={handleDialogOpen}
disabled={loading} disabled={isloading}
> >
<MessageIcon /> <MessageIcon />
</Button> </Button>
<ServerNoticeDialog <ServerNoticeDialog
open={open} open={open}
onClose={handleDialogClose} onClose={handleDialogClose}
onSend={handleSend} onSubmit={handleSend}
/> />
</Fragment> </>
); );
}; };
export const ServerNoticeBulkButton = ({ selectedIds }) => { export const ServerNoticeBulkButton = () => {
const { selectedIds } = useListContext();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const openDialog = () => setOpen(true);
const closeDialog = () => setOpen(false);
const notify = useNotify(); const notify = useNotify();
const unselectAll = useUnselectAll(); const unselectAllUsers = useUnselectAll("users");
const [createMany, { loading }] = useMutation(); const dataProvider = useDataProvider();
const handleDialogOpen = () => setOpen(true); const { mutate: sendNotices, isLoading } = useMutation(
const handleDialogClose = () => setOpen(false); data =>
dataProvider.createMany("servernotices", {
const handleSend = values => { ids: selectedIds,
createMany( data: data,
}),
{ {
type: "createMany", onSuccess: () => {
resource: "servernotices",
payload: { ids: selectedIds, data: values },
},
{
onSuccess: ({ data }) => {
notify("resources.servernotices.action.send_success"); notify("resources.servernotices.action.send_success");
unselectAll("users"); unselectAllUsers();
handleDialogClose(); closeDialog();
}, },
onFailure: error => onError: () =>
notify("resources.servernotices.action.send_failure", "error"), notify("resources.servernotices.action.send_failure", {
type: "error",
}),
} }
); );
};
return ( return (
<Fragment> <>
<Button <Button
label="resources.servernotices.send" label="resources.servernotices.send"
onClick={handleDialogOpen} onClick={openDialog}
disabled={loading} disabled={isLoading}
> >
<MessageIcon /> <MessageIcon />
</Button> </Button>
<ServerNoticeDialog <ServerNoticeDialog
open={open} open={open}
onClose={handleDialogClose} onClose={closeDialog}
onSend={handleSend} onSubmit={sendNotices}
/> />
</Fragment> </>
); );
}; };
+189
View File
@@ -0,0 +1,189 @@
import React from "react";
import {
Button,
Datagrid,
DateField,
List,
Pagination,
ReferenceField,
ReferenceManyField,
SearchInput,
Show,
Tab,
TabbedShowLayout,
TextField,
TopToolbar,
useRecordContext,
useDelete,
useNotify,
useRefresh,
useTranslate,
} from "react-admin";
import AutorenewIcon from "@mui/icons-material/Autorenew";
import DestinationsIcon from "@mui/icons-material/CloudQueue";
import FolderSharedIcon from "@mui/icons-material/FolderShared";
import ViewListIcon from "@mui/icons-material/ViewList";
const DestinationPagination = () => (
<Pagination rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />
);
const date_format = {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
};
const destinationRowSx = (record, _index) => ({
backgroundColor: record.retry_last_ts > 0 ? "#ffcccc" : "white",
});
const destinationFilters = [<SearchInput source="destination" alwaysOn />];
export const DestinationReconnectButton = () => {
const record = useRecordContext();
const refresh = useRefresh();
const notify = useNotify();
const [handleReconnect, { isLoading }] = useDelete();
// Reconnect is not required if no error has occurred. (`failure_ts`)
if (!record || !record.failure_ts) return null;
const handleClick = e => {
// Prevents redirection to the detail page when clicking in the list
e.stopPropagation();
handleReconnect(
"destinations",
{ id: record.id },
{
onSuccess: () => {
notify("ra.notification.updated", {
messageArgs: { smart_count: 1 },
});
refresh();
},
onError: () => {
notify("ra.message.error", { type: "error" });
},
}
);
};
return (
<Button
label="resources.destinations.action.reconnect"
onClick={handleClick}
disabled={isLoading}
>
<AutorenewIcon />
</Button>
);
};
const DestinationShowActions = () => (
<TopToolbar>
<DestinationReconnectButton />
</TopToolbar>
);
const DestinationTitle = () => {
const record = useRecordContext();
const translate = useTranslate();
return (
<span>
{translate("resources.destinations.name", 1)} {record.destination}
</span>
);
};
export const DestinationList = props => {
return (
<List
{...props}
filters={destinationFilters}
pagination={<DestinationPagination />}
sort={{ field: "destination", order: "ASC" }}
>
<Datagrid
rowSx={destinationRowSx}
rowClick={(id, _resource, _record) => `${id}/show/rooms`}
bulkActionButtons={false}
>
<TextField source="destination" />
<DateField source="failure_ts" showTime options={date_format} />
<DateField source="retry_last_ts" showTime options={date_format} />
<TextField source="retry_interval" />
<TextField source="last_successful_stream_ordering" />
<DestinationReconnectButton />
</Datagrid>
</List>
);
};
export const DestinationShow = props => {
const translate = useTranslate();
return (
<Show
actions={<DestinationShowActions />}
title={<DestinationTitle />}
{...props}
>
<TabbedShowLayout>
<Tab label="status" icon={<ViewListIcon />}>
<TextField source="destination" />
<DateField source="failure_ts" showTime options={date_format} />
<DateField source="retry_last_ts" showTime options={date_format} />
<TextField source="retry_interval" />
<TextField source="last_successful_stream_ordering" />
</Tab>
<Tab
label={translate("resources.rooms.name", { smart_count: 2 })}
icon={<FolderSharedIcon />}
path="rooms"
>
<ReferenceManyField
reference="destination_rooms"
target="destination"
addLabel={false}
pagination={<DestinationPagination />}
perPage={50}
>
<Datagrid
style={{ width: "100%" }}
rowClick={(id, resource, record) => `/rooms/${id}/show`}
>
<TextField
source="room_id"
label="resources.rooms.fields.room_id"
/>
<TextField source="stream_ordering" sortable={false} />
<ReferenceField
label="resources.rooms.fields.name"
source="id"
reference="rooms"
sortable={false}
link=""
>
<TextField source="name" sortable={false} />
</ReferenceField>
</Datagrid>
</ReferenceManyField>
</Tab>
</TabbedShowLayout>
</Show>
);
};
const resource = {
name: "destinations",
icon: DestinationsIcon,
list: DestinationList,
show: DestinationShow,
};
export default resource;
-89
View File
@@ -1,89 +0,0 @@
import React, { Fragment, useState } from "react";
import {
Button,
useMutation,
useNotify,
Confirm,
useRefresh,
} from "react-admin";
import ActionDelete from "@material-ui/icons/Delete";
import { makeStyles } from "@material-ui/core/styles";
import { fade } from "@material-ui/core/styles/colorManipulator";
import classnames from "classnames";
const useStyles = makeStyles(
theme => ({
deleteButton: {
color: theme.palette.error.main,
"&:hover": {
backgroundColor: fade(theme.palette.error.main, 0.12),
// Reset on mouse devices
"@media (hover: none)": {
backgroundColor: "transparent",
},
},
},
}),
{ name: "RaDeleteDeviceButton" }
);
export const DeviceRemoveButton = props => {
const { record } = props;
const classes = useStyles(props);
const [open, setOpen] = useState(false);
const refresh = useRefresh();
const notify = useNotify();
const [removeDevice, { loading }] = useMutation();
if (!record) return null;
const handleClick = () => setOpen(true);
const handleDialogClose = () => setOpen(false);
const handleConfirm = () => {
removeDevice(
{
type: "delete",
resource: "devices",
payload: {
id: record.id,
user_id: record.user_id,
},
},
{
onSuccess: () => {
notify("resources.devices.action.erase.success");
refresh();
},
onFailure: () =>
notify("resources.devices.action.erase.failure", "error"),
}
);
setOpen(false);
};
return (
<Fragment>
<Button
label="ra.action.remove"
onClick={handleClick}
className={classnames("ra-delete-button", classes.deleteButton)}
>
<ActionDelete />
</Button>
<Confirm
isOpen={open}
loading={loading}
onConfirm={handleConfirm}
onClose={handleDialogClose}
title="resources.devices.action.erase.title"
content="resources.devices.action.erase.content"
translateOptions={{
id: record.id,
name: record.display_name ? record.display_name : record.id,
}}
/>
</Fragment>
);
};
+51
View File
@@ -0,0 +1,51 @@
import React from "react";
import {
DeleteButton,
useDelete,
useNotify,
useRecordContext,
useRefresh,
} from "react-admin";
export const DeviceRemoveButton = props => {
const record = useRecordContext();
const refresh = useRefresh();
const notify = useNotify();
const [removeDevice] = useDelete();
if (!record) return null;
const handleConfirm = () => {
removeDevice(
"devices",
// needs previousData for user_id
{ id: record.id, previousData: record },
{
onSuccess: () => {
notify("resources.devices.action.erase.success");
refresh();
},
onError: () => {
notify("resources.devices.action.erase.failure", { type: "error" });
},
}
);
};
return (
<DeleteButton
{...props}
label="ra.action.remove"
confirmTitle="resources.devices.action.erase.title"
confirmContent="resources.devices.action.erase.content"
onConfirm={handleConfirm}
mutationMode="pessimistic"
redirect={false}
translateOptions={{
id: record.id,
name: record.display_name ? record.display_name : record.id,
}}
/>
);
};
@@ -1,8 +1,4 @@
import React, { Fragment, useState } from "react"; import React, { useState } from "react";
import classnames from "classnames";
import { fade } from "@material-ui/core/styles/colorManipulator";
import { makeStyles } from "@material-ui/core/styles";
import { Tooltip } from "@material-ui/core";
import { import {
BooleanInput, BooleanInput,
Button, Button,
@@ -14,37 +10,26 @@ import {
useCreate, useCreate,
useDelete, useDelete,
useNotify, useNotify,
useRecordContext,
useRefresh, useRefresh,
useTranslate, useTranslate,
} from "react-admin"; } from "react-admin";
import BlockIcon from "@material-ui/icons/Block"; import BlockIcon from "@mui/icons-material/Block";
import ClearIcon from "@material-ui/icons/Clear"; import ClearIcon from "@mui/icons-material/Clear";
import DeleteSweepIcon from "@material-ui/icons/DeleteSweep"; import DeleteSweepIcon from "@mui/icons-material/DeleteSweep";
import Dialog from "@material-ui/core/Dialog"; import {
import DialogContent from "@material-ui/core/DialogContent"; Dialog,
import DialogContentText from "@material-ui/core/DialogContentText"; DialogContent,
import DialogTitle from "@material-ui/core/DialogTitle"; DialogContentText,
import IconCancel from "@material-ui/icons/Cancel"; DialogTitle,
import LockIcon from "@material-ui/icons/Lock"; Tooltip,
import LockOpenIcon from "@material-ui/icons/LockOpen"; } from "@mui/material";
import IconCancel from "@mui/icons-material/Cancel";
import LockIcon from "@mui/icons-material/Lock";
import LockOpenIcon from "@mui/icons-material/LockOpen";
import { alpha, useTheme } from "@mui/material/styles";
const useStyles = makeStyles( const DeleteMediaDialog = ({ open, loading, onClose, onSubmit }) => {
theme => ({
deleteButton: {
color: theme.palette.error.main,
"&:hover": {
backgroundColor: fade(theme.palette.error.main, 0.12),
// Reset on mouse devices
"@media (hover: none)": {
backgroundColor: "transparent",
},
},
},
}),
{ name: "RaDeleteDeviceButton" }
);
const DeleteMediaDialog = ({ open, loading, onClose, onSend }) => {
const translate = useTranslate(); const translate = useTranslate();
const dateParser = v => { const dateParser = v => {
@@ -53,8 +38,7 @@ const DeleteMediaDialog = ({ open, loading, onClose, onSend }) => {
return d.getTime(); return d.getTime();
}; };
const DeleteMediaToolbar = props => { const DeleteMediaToolbar = props => (
return (
<Toolbar {...props}> <Toolbar {...props}>
<SaveButton <SaveButton
label="resources.delete_media.action.send" label="resources.delete_media.action.send"
@@ -65,7 +49,6 @@ const DeleteMediaDialog = ({ open, loading, onClose, onSend }) => {
</Button> </Button>
</Toolbar> </Toolbar>
); );
};
return ( return (
<Dialog open={open} onClose={onClose} loading={loading}> <Dialog open={open} onClose={onClose} loading={loading}>
@@ -76,12 +59,7 @@ const DeleteMediaDialog = ({ open, loading, onClose, onSend }) => {
<DialogContentText> <DialogContentText>
{translate("resources.delete_media.helper.send")} {translate("resources.delete_media.helper.send")}
</DialogContentText> </DialogContentText>
<SimpleForm <SimpleForm toolbar={<DeleteMediaToolbar />} onSubmit={onSubmit}>
toolbar={<DeleteMediaToolbar />}
submitOnEnter={false}
redirect={false}
save={onSend}
>
<DateTimeInput <DateTimeInput
fullWidth fullWidth
source="before_ts" source="before_ts"
@@ -110,81 +88,101 @@ const DeleteMediaDialog = ({ open, loading, onClose, onSend }) => {
}; };
export const DeleteMediaButton = props => { export const DeleteMediaButton = props => {
const classes = useStyles(props); const theme = useTheme();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const notify = useNotify(); const notify = useNotify();
const [deleteOne, { loading }] = useDelete("delete_media"); const [deleteOne, { isLoading }] = useDelete();
const handleDialogOpen = () => setOpen(true); const openDialog = () => setOpen(true);
const handleDialogClose = () => setOpen(false); const closeDialog = () => setOpen(false);
const handleSend = values => { const deleteMedia = values => {
deleteOne( deleteOne(
{ payload: { ...values } }, "delete_media",
// needs meta.before_ts, meta.size_gt and meta.keep_profiles
{ meta: values },
{ {
onSuccess: () => { onSuccess: () => {
notify("resources.delete_media.action.send_success"); notify("resources.delete_media.action.send_success");
handleDialogClose(); closeDialog();
}, },
onFailure: () => onError: () =>
notify("resources.delete_media.action.send_failure", "error"), notify("resources.delete_media.action.send_failure", {
type: "error",
}),
} }
); );
}; };
return ( return (
<Fragment> <>
<Button <Button
{...props}
label="resources.delete_media.action.send" label="resources.delete_media.action.send"
onClick={handleDialogOpen} onClick={openDialog}
disabled={loading} disabled={isLoading}
className={classnames("ra-delete-button", classes.deleteButton)} sx={{
color: theme.palette.error.main,
"&:hover": {
backgroundColor: alpha(theme.palette.error.main, 0.12),
// Reset on mouse devices
"@media (hover: none)": {
backgroundColor: "transparent",
},
},
}}
> >
<DeleteSweepIcon /> <DeleteSweepIcon />
</Button> </Button>
<DeleteMediaDialog <DeleteMediaDialog
open={open} open={open}
onClose={handleDialogClose} onClose={closeDialog}
onSend={handleSend} onSubmit={deleteMedia}
/> />
</Fragment> </>
); );
}; };
export const ProtectMediaButton = props => { export const ProtectMediaButton = () => {
const { record } = props; const record = useRecordContext();
const translate = useTranslate(); const translate = useTranslate();
const refresh = useRefresh(); const refresh = useRefresh();
const notify = useNotify(); const notify = useNotify();
const [create, { loading }] = useCreate("protect_media"); const [create, { isLoading }] = useCreate();
const [deleteOne] = useDelete("protect_media"); const [deleteOne] = useDelete();
if (!record) return null; if (!record) return null;
const handleProtect = () => { const handleProtect = () => {
create( create(
{ payload: { data: record } }, "protect_media",
{ data: record },
{ {
onSuccess: () => { onSuccess: () => {
notify("resources.protect_media.action.send_success"); notify("resources.protect_media.action.send_success");
refresh(); refresh();
}, },
onFailure: () => onError: () =>
notify("resources.protect_media.action.send_failure", "error"), notify("resources.protect_media.action.send_failure", {
type: "error",
}),
} }
); );
}; };
const handleUnprotect = () => { const handleUnprotect = () => {
deleteOne( deleteOne(
{ payload: { ...record } }, "protect_media",
{ id: record.id },
{ {
onSuccess: () => { onSuccess: () => {
notify("resources.protect_media.action.send_success"); notify("resources.protect_media.action.send_success");
refresh(); refresh();
}, },
onFailure: () => onError: () =>
notify("resources.protect_media.action.send_failure", "error"), notify("resources.protect_media.action.send_failure", {
type: "error",
}),
} }
); );
}; };
@@ -194,7 +192,7 @@ export const ProtectMediaButton = props => {
Wrapping Tooltip with <div> Wrapping Tooltip with <div>
https://github.com/marmelab/react-admin/issues/4349#issuecomment-578594735 https://github.com/marmelab/react-admin/issues/4349#issuecomment-578594735
*/ */
<Fragment> <>
{record.quarantined_by && ( {record.quarantined_by && (
<Tooltip <Tooltip
title={translate("resources.protect_media.action.none", { title={translate("resources.protect_media.action.none", {
@@ -220,7 +218,7 @@ export const ProtectMediaButton = props => {
arrow arrow
> >
<div> <div>
<Button onClick={handleUnprotect} disabled={loading}> <Button onClick={handleUnprotect} disabled={isLoading}>
<LockIcon /> <LockIcon />
</Button> </Button>
</div> </div>
@@ -233,56 +231,62 @@ export const ProtectMediaButton = props => {
})} })}
> >
<div> <div>
<Button onClick={handleProtect} disabled={loading}> <Button onClick={handleProtect} disabled={isLoading}>
<LockOpenIcon /> <LockOpenIcon />
</Button> </Button>
</div> </div>
</Tooltip> </Tooltip>
)} )}
</Fragment> </>
); );
}; };
export const QuarantineMediaButton = props => { export const QuarantineMediaButton = props => {
const { record } = props; const record = useRecordContext();
const translate = useTranslate(); const translate = useTranslate();
const refresh = useRefresh(); const refresh = useRefresh();
const notify = useNotify(); const notify = useNotify();
const [create, { loading }] = useCreate("quarantine_media"); const [create, { isLoading }] = useCreate();
const [deleteOne] = useDelete("quarantine_media"); const [deleteOne] = useDelete();
if (!record) return null; if (!record) return null;
const handleQuarantaine = () => { const handleQuarantaine = () => {
create( create(
{ payload: { data: record } }, "quarantine_media",
{ data: record },
{ {
onSuccess: () => { onSuccess: () => {
notify("resources.quarantine_media.action.send_success"); notify("resources.quarantine_media.action.send_success");
refresh(); refresh();
}, },
onFailure: () => onError: () =>
notify("resources.quarantine_media.action.send_failure", "error"), notify("resources.quarantine_media.action.send_failure", {
type: "error",
}),
} }
); );
}; };
const handleRemoveQuarantaine = () => { const handleRemoveQuarantaine = () => {
deleteOne( deleteOne(
{ payload: { ...record } }, "quarantine_media",
{ id: record.id, previousData: record },
{ {
onSuccess: () => { onSuccess: () => {
notify("resources.quarantine_media.action.send_success"); notify("resources.quarantine_media.action.send_success");
refresh(); refresh();
}, },
onFailure: () => onError: () =>
notify("resources.quarantine_media.action.send_failure", "error"), notify("resources.quarantine_media.action.send_failure", {
type: "error",
}),
} }
); );
}; };
return ( return (
<Fragment> <>
{record.safe_from_quarantine && ( {record.safe_from_quarantine && (
<Tooltip <Tooltip
title={translate("resources.quarantine_media.action.none", { title={translate("resources.quarantine_media.action.none", {
@@ -290,7 +294,7 @@ export const QuarantineMediaButton = props => {
})} })}
> >
<div> <div>
<Button disabled={true}> <Button {...props} disabled={true}>
<ClearIcon /> <ClearIcon />
</Button> </Button>
</div> </div>
@@ -303,7 +307,11 @@ export const QuarantineMediaButton = props => {
})} })}
> >
<div> <div>
<Button onClick={handleRemoveQuarantaine} disabled={loading}> <Button
{...props}
onClick={handleRemoveQuarantaine}
disabled={isLoading}
>
<BlockIcon color="error" /> <BlockIcon color="error" />
</Button> </Button>
</div> </div>
@@ -316,12 +324,12 @@ export const QuarantineMediaButton = props => {
})} })}
> >
<div> <div>
<Button onClick={handleQuarantaine} disabled={loading}> <Button onClick={handleQuarantaine} disabled={isLoading}>
<BlockIcon /> <BlockIcon />
</Button> </Button>
</div> </div>
</Tooltip> </Tooltip>
)} )}
</Fragment> </>
); );
}; };
@@ -1,18 +1,20 @@
import React, { Fragment } from "react"; import React from "react";
import { connect } from "react-redux";
import { import {
BooleanField, BooleanField,
BulkDeleteButton, BulkDeleteButton,
DateField, DateField,
Datagrid, Datagrid,
DatagridConfigurable,
DeleteButton, DeleteButton,
Filter, ExportButton,
FunctionField,
List, List,
NumberField, NumberField,
Pagination, Pagination,
ReferenceField, ReferenceField,
ReferenceManyField, ReferenceManyField,
SearchInput, SearchInput,
SelectColumnsButton,
SelectField, SelectField,
Show, Show,
Tab, Tab,
@@ -22,63 +24,39 @@ import {
useRecordContext, useRecordContext,
useTranslate, useTranslate,
} from "react-admin"; } from "react-admin";
import get from "lodash/get"; import { useTheme } from "@mui/material/styles";
import PropTypes from "prop-types"; import Box from "@mui/material/Box";
import { makeStyles } from "@material-ui/core/styles"; import FastForwardIcon from "@mui/icons-material/FastForward";
import { Tooltip, Typography, Chip } from "@material-ui/core"; import HttpsIcon from "@mui/icons-material/Https";
import FastForwardIcon from "@material-ui/icons/FastForward"; import NoEncryptionIcon from "@mui/icons-material/NoEncryption";
import HttpsIcon from "@material-ui/icons/Https"; import PageviewIcon from "@mui/icons-material/Pageview";
import NoEncryptionIcon from "@material-ui/icons/NoEncryption"; import UserIcon from "@mui/icons-material/Group";
import PageviewIcon from "@material-ui/icons/Pageview"; import ViewListIcon from "@mui/icons-material/ViewList";
import UserIcon from "@material-ui/icons/Group"; import VisibilityIcon from "@mui/icons-material/Visibility";
import ViewListIcon from "@material-ui/icons/ViewList"; import EventIcon from "@mui/icons-material/Event";
import VisibilityIcon from "@material-ui/icons/Visibility"; import RoomIcon from "@mui/icons-material/ViewList";
import EventIcon from "@material-ui/icons/Event";
import { import {
RoomDirectoryBulkDeleteButton, RoomDirectoryBulkUnpublishButton,
RoomDirectoryBulkSaveButton, RoomDirectoryBulkPublishButton,
RoomDirectoryDeleteButton, RoomDirectoryUnpublishButton,
RoomDirectorySaveButton, RoomDirectoryPublishButton,
} from "./RoomDirectory"; } from "./RoomDirectory";
const useStyles = makeStyles(theme => ({ const date_format = {
helper_forward_extremities: { year: "numeric",
fontFamily: "Roboto, Helvetica, Arial, sans-serif", month: "2-digit",
margin: "0.5em", day: "2-digit",
}, hour: "2-digit",
})); minute: "2-digit",
second: "2-digit",
const RoomPagination = props => (
<Pagination {...props} rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />
);
const EncryptionField = ({ source, record = {}, emptyText }) => {
const translate = useTranslate();
const value = get(record, source);
let ariaLabel = value === false ? "ra.boolean.false" : "ra.boolean.true";
if (value === false || value === true) {
return (
<Typography component="span" variant="body2">
<Tooltip title={translate(ariaLabel, { _: ariaLabel })}>
{value === true ? (
<HttpsIcon data-testid="true" htmlColor="limegreen" />
) : (
<NoEncryptionIcon data-testid="false" color="error" />
)}
</Tooltip>
</Typography>
);
}
return (
<Typography component="span" variant="body2">
{emptyText}
</Typography>
);
}; };
const RoomTitle = ({ record }) => { const RoomPagination = () => (
<Pagination rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />
);
const RoomTitle = () => {
const record = useRecordContext();
const translate = useTranslate(); const translate = useTranslate();
var name = ""; var name = "";
if (record) { if (record) {
@@ -92,24 +70,18 @@ const RoomTitle = ({ record }) => {
); );
}; };
const RoomShowActions = ({ basePath, data, resource }) => { const RoomShowActions = () => {
const record = useRecordContext();
var roomDirectoryStatus = ""; var roomDirectoryStatus = "";
if (data) { if (record) {
roomDirectoryStatus = data.public; roomDirectoryStatus = record.public;
} }
return ( return (
<TopToolbar> <TopToolbar>
{roomDirectoryStatus === false && ( {roomDirectoryStatus === false && <RoomDirectoryPublishButton />}
<RoomDirectorySaveButton record={data} /> {roomDirectoryStatus === true && <RoomDirectoryUnpublishButton />}
)}
{roomDirectoryStatus === true && (
<RoomDirectoryDeleteButton record={data} />
)}
<DeleteButton <DeleteButton
basePath={basePath}
record={data}
resource={resource}
mutationMode="pessimistic" mutationMode="pessimistic"
confirmTitle="resources.rooms.action.erase.title" confirmTitle="resources.rooms.action.erase.title"
confirmContent="resources.rooms.action.erase.content" confirmContent="resources.rooms.action.erase.content"
@@ -119,7 +91,6 @@ const RoomShowActions = ({ basePath, data, resource }) => {
}; };
export const RoomShow = props => { export const RoomShow = props => {
const classes = useStyles({ props });
const translate = useTranslate(); const translate = useTranslate();
return ( return (
<Show {...props} actions={<RoomShowActions />} title={<RoomTitle />}> <Show {...props} actions={<RoomShowActions />} title={<RoomTitle />}>
@@ -127,6 +98,7 @@ export const RoomShow = props => {
<Tab label="synapseadmin.rooms.tabs.basic" icon={<ViewListIcon />}> <Tab label="synapseadmin.rooms.tabs.basic" icon={<ViewListIcon />}>
<TextField source="room_id" /> <TextField source="room_id" />
<TextField source="name" /> <TextField source="name" />
<TextField source="topic" />
<TextField source="canonical_alias" /> <TextField source="canonical_alias" />
<ReferenceField source="creator" reference="users"> <ReferenceField source="creator" reference="users">
<TextField source="id" /> <TextField source="id" />
@@ -149,7 +121,11 @@ export const RoomShow = props => {
/> />
</Tab> </Tab>
<Tab label="synapseadmin.rooms.tabs.members" icon={<UserIcon />}> <Tab
label="synapseadmin.rooms.tabs.members"
icon={<UserIcon />}
path="members"
>
<ReferenceManyField <ReferenceManyField
reference="room_members" reference="room_members"
target="room_id" target="room_id"
@@ -157,7 +133,7 @@ export const RoomShow = props => {
> >
<Datagrid <Datagrid
style={{ width: "100%" }} style={{ width: "100%" }}
rowClick={(id, basePath, record) => "/users/" + id} rowClick={(id, resource, record) => "/users/" + id}
> >
<TextField <TextField
source="id" source="id"
@@ -247,14 +223,7 @@ export const RoomShow = props => {
<DateField <DateField
source="origin_server_ts" source="origin_server_ts"
showTime showTime
options={{ options={date_format}
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
sortable={false} sortable={false}
/> />
<TextField source="content" sortable={false} /> <TextField source="content" sortable={false} />
@@ -274,9 +243,14 @@ export const RoomShow = props => {
icon={<FastForwardIcon />} icon={<FastForwardIcon />}
path="forward_extremities" path="forward_extremities"
> >
<div className={classes.helper_forward_extremities}> <Box
sx={{
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
margin: "0.5em",
}}
>
{translate("resources.rooms.helper.forward_extremities")} {translate("resources.rooms.helper.forward_extremities")}
</div> </Box>
<ReferenceManyField <ReferenceManyField
reference="forward_extremities" reference="forward_extremities"
target="room_id" target="room_id"
@@ -287,14 +261,7 @@ export const RoomShow = props => {
<DateField <DateField
source="received_ts" source="received_ts"
showTime showTime
options={{ options={date_format}
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
sortable={false} sortable={false}
/> />
<NumberField source="depth" sortable={false} /> <NumberField source="depth" sortable={false} />
@@ -307,104 +274,81 @@ export const RoomShow = props => {
); );
}; };
const RoomBulkActionButtons = props => ( const RoomBulkActionButtons = () => (
<Fragment> <>
<RoomDirectoryBulkSaveButton {...props} /> <RoomDirectoryBulkPublishButton />
<RoomDirectoryBulkDeleteButton {...props} /> <RoomDirectoryBulkUnpublishButton />
<BulkDeleteButton <BulkDeleteButton
{...props}
confirmTitle="resources.rooms.action.erase.title" confirmTitle="resources.rooms.action.erase.title"
confirmContent="resources.rooms.action.erase.content" confirmContent="resources.rooms.action.erase.content"
undoable={false} mutationMode="pessimistic"
/> />
</Fragment> </>
); );
const RoomFilter = ({ ...props }) => { const roomFilters = [<SearchInput source="search_term" alwaysOn />];
const translate = useTranslate();
return (
<Filter {...props}>
<SearchInput source="search_term" alwaysOn />
<Chip
label={translate("resources.rooms.fields.joined_local_members")}
source="joined_local_members"
defaultValue={false}
style={{ marginBottom: 8 }}
/>
<Chip
label={translate("resources.rooms.fields.state_events")}
source="state_events"
defaultValue={false}
style={{ marginBottom: 8 }}
/>
<Chip
label={translate("resources.rooms.fields.version")}
source="version"
defaultValue={false}
style={{ marginBottom: 8 }}
/>
<Chip
label={translate("resources.rooms.fields.federatable")}
source="federatable"
defaultValue={false}
style={{ marginBottom: 8 }}
/>
</Filter>
);
};
const RoomNameField = props => { const RoomListActions = () => (
const { source } = props; <TopToolbar>
const record = useRecordContext(props); <SelectColumnsButton />
return ( <ExportButton />
<span>{record[source] || record["canonical_alias"] || record["id"]}</span> </TopToolbar>
); );
};
RoomNameField.propTypes = { export const RoomList = props => {
label: PropTypes.string, const theme = useTheme();
record: PropTypes.object,
source: PropTypes.string.isRequired,
};
const FilterableRoomList = ({ roomFilters, dispatch, ...props }) => {
const filter = roomFilters;
const localMembersFilter =
filter && filter.joined_local_members ? true : false;
const stateEventsFilter = filter && filter.state_events ? true : false;
const versionFilter = filter && filter.version ? true : false;
const federateableFilter = filter && filter.federatable ? true : false;
return ( return (
<List <List
{...props} {...props}
pagination={<RoomPagination />} pagination={<RoomPagination />}
sort={{ field: "name", order: "ASC" }} sort={{ field: "name", order: "ASC" }}
filters={<RoomFilter />} filters={roomFilters}
bulkActionButtons={<RoomBulkActionButtons />} actions={<RoomListActions />}
> >
<Datagrid rowClick="show"> <DatagridConfigurable
<EncryptionField rowClick="show"
bulkActionButtons={<RoomBulkActionButtons />}
omit={[
"joined_local_members",
"state_events",
"version",
"federatable",
]}
>
<BooleanField
source="is_encrypted" source="is_encrypted"
sortBy="encryption" sortBy="encryption"
TrueIcon={HttpsIcon}
FalseIcon={NoEncryptionIcon}
label={<HttpsIcon />} label={<HttpsIcon />}
sx={{
[`& [data-testid="true"]`]: { color: theme.palette.success.main },
[`& [data-testid="false"]`]: { color: theme.palette.error.main },
}}
/>
<FunctionField
source="name"
render={record =>
record["name"] || record["canonical_alias"] || record["id"]
}
/> />
<RoomNameField source="name" />
<TextField source="joined_members" /> <TextField source="joined_members" />
{localMembersFilter && <TextField source="joined_local_members" />} <TextField source="joined_local_members" />
{stateEventsFilter && <TextField source="state_events" />} <TextField source="state_events" />
{versionFilter && <TextField source="version" />} <TextField source="version" />
{federateableFilter && <BooleanField source="federatable" />} <BooleanField source="federatable" />
<BooleanField source="public" /> <BooleanField source="public" />
</Datagrid> </DatagridConfigurable>
</List> </List>
); );
}; };
function mapStateToProps(state) { const resource = {
return { name: "rooms",
roomFilters: state.admin.resources.rooms.list.params.displayedFilters, icon: RoomIcon,
}; list: RoomList,
} show: RoomShow,
};
export const RoomList = connect(mapStateToProps)(FilterableRoomList); export default resource;
-81
View File
@@ -1,81 +0,0 @@
import React from "react";
import { cloneElement } from "react";
import {
Datagrid,
ExportButton,
Filter,
List,
NumberField,
Pagination,
sanitizeListRestProps,
SearchInput,
TextField,
TopToolbar,
useListContext,
} from "react-admin";
import { DeleteMediaButton } from "./media";
const ListActions = props => {
const { className, exporter, filters, maxResults, ...rest } = props;
const {
currentSort,
resource,
displayedFilters,
filterValues,
showFilter,
total,
} = useListContext();
return (
<TopToolbar className={className} {...sanitizeListRestProps(rest)}>
{filters &&
cloneElement(filters, {
resource,
showFilter,
displayedFilters,
filterValues,
context: "button",
})}
<DeleteMediaButton />
<ExportButton
disabled={total === 0}
resource={resource}
sort={currentSort}
filterValues={filterValues}
maxResults={maxResults}
/>
</TopToolbar>
);
};
const UserMediaStatsPagination = props => (
<Pagination {...props} rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />
);
const UserMediaStatsFilter = props => (
<Filter {...props}>
<SearchInput source="search_term" alwaysOn />
</Filter>
);
export const UserMediaStatsList = props => {
return (
<List
{...props}
actions={<ListActions />}
filters={<UserMediaStatsFilter />}
pagination={<UserMediaStatsPagination />}
sort={{ field: "media_length", order: "DESC" }}
bulkActionButtons={false}
>
<Datagrid rowClick={(id, basePath, record) => "/users/" + id + "/media"}>
<TextField source="user_id" label="resources.users.fields.id" />
<TextField
source="displayname"
label="resources.users.fields.displayname"
/>
<NumberField source="media_count" />
<NumberField source="media_length" />
</Datagrid>
</List>
);
};
+79
View File
@@ -0,0 +1,79 @@
import React from "react";
import { cloneElement } from "react";
import {
Datagrid,
ExportButton,
List,
NumberField,
Pagination,
sanitizeListRestProps,
SearchInput,
TextField,
TopToolbar,
useListContext,
} from "react-admin";
import EqualizerIcon from "@mui/icons-material/Equalizer";
import { DeleteMediaButton } from "./media";
const ListActions = props => {
const { className, exporter, filters, maxResults, ...rest } = props;
const { sort, resource, displayedFilters, filterValues, showFilter, total } =
useListContext();
return (
<TopToolbar className={className} {...sanitizeListRestProps(rest)}>
{filters &&
cloneElement(filters, {
resource,
showFilter,
displayedFilters,
filterValues,
context: "button",
})}
<DeleteMediaButton />
<ExportButton
disabled={total === 0}
resource={resource}
sort={sort}
filterValues={filterValues}
maxResults={maxResults}
/>
</TopToolbar>
);
};
const UserMediaStatsPagination = () => (
<Pagination rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />
);
const userMediaStatsFilters = [<SearchInput source="search_term" alwaysOn />];
export const UserMediaStatsList = props => (
<List
{...props}
actions={<ListActions />}
filters={userMediaStatsFilters}
pagination={<UserMediaStatsPagination />}
sort={{ field: "media_length", order: "DESC" }}
>
<Datagrid
rowClick={(id, resource, record) => "/users/" + id + "/media"}
bulkActionButtons={false}
>
<TextField source="user_id" label="resources.users.fields.id" />
<TextField
source="displayname"
label="resources.users.fields.displayname"
/>
<NumberField source="media_count" />
<NumberField source="media_length" />
</Datagrid>
</List>
);
const resource = {
name: "user_media_statistics",
icon: EqualizerIcon,
list: UserMediaStatsList,
};
export default resource;
@@ -1,14 +1,14 @@
import React, { cloneElement, Fragment } from "react"; import React, { cloneElement } from "react";
import Avatar from "@material-ui/core/Avatar"; import AssignmentIndIcon from "@mui/icons-material/AssignmentInd";
import AssignmentIndIcon from "@material-ui/icons/AssignmentInd"; import ContactMailIcon from "@mui/icons-material/ContactMail";
import ContactMailIcon from "@material-ui/icons/ContactMail"; import DevicesIcon from "@mui/icons-material/Devices";
import DevicesIcon from "@material-ui/icons/Devices"; import GetAppIcon from "@mui/icons-material/GetApp";
import GetAppIcon from "@material-ui/icons/GetApp"; import NotificationsIcon from "@mui/icons-material/Notifications";
import NotificationsIcon from "@material-ui/icons/Notifications"; import PermMediaIcon from "@mui/icons-material/PermMedia";
import PermMediaIcon from "@material-ui/icons/PermMedia"; import PersonPinIcon from "@mui/icons-material/PersonPin";
import PersonPinIcon from "@material-ui/icons/PersonPin"; import SettingsInputComponentIcon from "@mui/icons-material/SettingsInputComponent";
import SettingsInputComponentIcon from "@material-ui/icons/SettingsInputComponent"; import UserIcon from "@mui/icons-material/Group";
import ViewListIcon from "@material-ui/icons/ViewList"; import ViewListIcon from "@mui/icons-material/ViewList";
import { import {
ArrayInput, ArrayInput,
ArrayField, ArrayField,
@@ -18,7 +18,6 @@ import {
Create, Create,
Edit, Edit,
List, List,
Filter,
Toolbar, Toolbar,
SimpleForm, SimpleForm,
SimpleFormIterator, SimpleFormIterator,
@@ -36,7 +35,10 @@ import {
BulkDeleteButton, BulkDeleteButton,
DeleteButton, DeleteButton,
SaveButton, SaveButton,
maxLength,
regex, regex,
required,
useRecordContext,
useTranslate, useTranslate,
Pagination, Pagination,
CreateButton, CreateButton,
@@ -46,31 +48,32 @@ import {
NumberField, NumberField,
} from "react-admin"; } from "react-admin";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import AvatarField from "./AvatarField";
import { ServerNoticeButton, ServerNoticeBulkButton } from "./ServerNotices"; import { ServerNoticeButton, ServerNoticeBulkButton } from "./ServerNotices";
import { DeviceRemoveButton } from "./devices"; import { DeviceRemoveButton } from "./devices";
import { ProtectMediaButton, QuarantineMediaButton } from "./media"; import { ProtectMediaButton, QuarantineMediaButton } from "./media";
import { makeStyles } from "@material-ui/core/styles";
const redirect = () => { const choices_medium = [
return { { id: "email", name: "resources.users.email" },
pathname: "/import_users", { id: "msisdn", name: "resources.users.msisdn" },
}; ];
const choices_type = [
{ id: "bot", name: "bot" },
{ id: "support", name: "support" },
];
const date_format = {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}; };
const useStyles = makeStyles({
small: {
height: "40px",
width: "40px",
},
large: {
height: "120px",
width: "120px",
float: "right",
},
});
const UserListActions = ({ const UserListActions = ({
currentSort, sort,
className, className,
resource, resource,
filters, filters,
@@ -79,7 +82,6 @@ const UserListActions = ({
filterValues, filterValues,
permanentFilter, permanentFilter,
hasCreate, // you can hide CreateButton if hasCreate = false hasCreate, // you can hide CreateButton if hasCreate = false
basePath,
selectedIds, selectedIds,
onUnselectItems, onUnselectItems,
showFilter, showFilter,
@@ -97,18 +99,18 @@ const UserListActions = ({
filterValues, filterValues,
context: "button", context: "button",
})} })}
<CreateButton basePath={basePath} /> <CreateButton />
<ExportButton <ExportButton
disabled={total === 0} disabled={total === 0}
resource={resource} resource={resource}
sort={currentSort} sort={sort}
filter={{ ...filterValues, ...permanentFilter }} filter={{ ...filterValues, ...permanentFilter }}
exporter={exporter} exporter={exporter}
maxResults={maxResults} maxResults={maxResults}
/> />
{/* Add your custom actions */} {/* Add your custom actions */}
<Button component={Link} to={redirect} label="CSV Import"> <Button component={Link} to="/import_users" label="CSV Import">
<GetAppIcon style={{ transform: "rotate(180deg)", fontSize: "20" }} /> <GetAppIcon sx={{ transform: "rotate(180deg)", fontSize: "20px" }} />
</Button> </Button>
</TopToolbar> </TopToolbar>
); );
@@ -119,54 +121,44 @@ UserListActions.defaultProps = {
onUnselectItems: () => null, onUnselectItems: () => null,
}; };
const UserPagination = props => ( const UserPagination = () => (
<Pagination {...props} rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} /> <Pagination rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />
); );
const UserFilter = props => ( const userFilters = [
<Filter {...props}> <SearchInput source="name" alwaysOn />,
<SearchInput source="name" alwaysOn /> <BooleanInput source="guests" alwaysOn />,
<BooleanInput source="guests" alwaysOn />
<BooleanInput <BooleanInput
label="resources.users.fields.show_deactivated" label="resources.users.fields.show_deactivated"
source="deactivated" source="deactivated"
alwaysOn alwaysOn
/> />,
</Filter> ];
);
const UserBulkActionButtons = props => ( const UserBulkActionButtons = () => (
<Fragment> <>
<ServerNoticeBulkButton {...props} /> <ServerNoticeBulkButton />
<BulkDeleteButton <BulkDeleteButton
{...props}
label="resources.users.action.erase" label="resources.users.action.erase"
confirmTitle="resources.users.helper.erase" confirmTitle="resources.users.helper.erase"
undoable={false} mutationMode="pessimistic"
/> />
</Fragment> </>
); );
const AvatarField = ({ source, className, record = {} }) => ( export const UserList = props => (
<Avatar src={record[source]} className={className} />
);
export const UserList = props => {
const classes = useStyles();
return (
<List <List
{...props} {...props}
filters={<UserFilter />} filters={userFilters}
filterDefaultValues={{ guests: true, deactivated: false }} filterDefaultValues={{ guests: true, deactivated: false }}
sort={{ field: "name", order: "ASC" }} sort={{ field: "name", order: "ASC" }}
actions={<UserListActions maxResults={10000} />} actions={<UserListActions maxResults={10000} />}
bulkActionButtons={<UserBulkActionButtons />}
pagination={<UserPagination />} pagination={<UserPagination />}
> >
<Datagrid rowClick="edit"> <Datagrid rowClick="edit" bulkActionButtons={<UserBulkActionButtons />}>
<AvatarField <AvatarField
source="avatar_src" source="avatar_src"
className={classes.small} sx={{ height: "40px", width: "40px" }}
sortBy="avatar_url" sortBy="avatar_url"
/> />
<TextField source="id" sortBy="name" /> <TextField source="id" sortBy="name" />
@@ -174,16 +166,27 @@ export const UserList = props => {
<BooleanField source="is_guest" /> <BooleanField source="is_guest" />
<BooleanField source="admin" /> <BooleanField source="admin" />
<BooleanField source="deactivated" /> <BooleanField source="deactivated" />
<DateField
source="creation_ts"
label="resources.users.fields.creation_ts_ms"
showTime
options={date_format}
/>
</Datagrid> </Datagrid>
</List> </List>
); );
};
// https://matrix.org/docs/spec/appendices#user-identifiers // https://matrix.org/docs/spec/appendices#user-identifiers
const validateUser = regex( // here only local part of user_id
/^@[a-z0-9._=\-/]+:.*/, // maxLength = 255 - "@" - ":" - localStorage.getItem("home_server").length
"synapseadmin.users.invalid_user_id" // localStorage.getItem("home_server").length is not valid here
); const validateUser = [
required(),
maxLength(253),
regex(/^[a-z0-9._=\-/]+$/, "synapseadmin.users.invalid_user_id"),
];
const validateAddress = [required(), maxLength(255)];
export function generateRandomUser() { export function generateRandomUser() {
const homeserver = localStorage.getItem("home_server"); const homeserver = localStorage.getItem("home_server");
@@ -226,20 +229,31 @@ export function generateRandomUser() {
}; };
} }
const UserEditToolbar = props => { const UserEditToolbar = props => (
const translate = useTranslate();
return (
<Toolbar {...props}> <Toolbar {...props}>
<SaveButton submitOnEnter={true} /> <SaveButton disabled={props.pristine} />
</Toolbar>
);
const UserEditActions = ({ data }) => {
const translate = useTranslate();
var userStatus = "";
if (data) {
userStatus = data.deactivated;
}
return (
<TopToolbar>
{!userStatus && <ServerNoticeButton record={data} />}
<DeleteButton <DeleteButton
record={data}
label="resources.users.action.erase" label="resources.users.action.erase"
confirmTitle={translate("resources.users.helper.erase", { confirmTitle={translate("resources.users.helper.erase", {
smart_count: 1, smart_count: 1,
})} })}
mutationMode="pessimistic" mutationMode="pessimistic"
/> />
<ServerNoticeButton /> </TopToolbar>
</Toolbar>
); );
}; };
@@ -247,26 +261,45 @@ export const UserCreate = props => (
<Create {...props}> <Create {...props}>
<SimpleForm> <SimpleForm>
<TextInput source="id" autoComplete="off" validate={validateUser} /> <TextInput source="id" autoComplete="off" validate={validateUser} />
<TextInput source="displayname" /> <TextInput source="displayname" validate={maxLength(256)} />
<PasswordInput source="password" autoComplete="new-password" /> <PasswordInput
source="password"
autoComplete="new-password"
validate={maxLength(512)}
/>
<SelectInput
source="user_type"
choices={choices_type}
translateChoice={false}
resettable
/>
<BooleanInput source="admin" /> <BooleanInput source="admin" />
<ArrayInput source="threepids"> <ArrayInput source="threepids">
<SimpleFormIterator> <SimpleFormIterator disableReordering>
<SelectInput <SelectInput
source="medium" source="medium"
choices={[ choices={choices_medium}
{ id: "email", name: "resources.users.email" }, validate={required()}
{ id: "msisdn", name: "resources.users.msisdn" }, />
]} <TextInput source="address" validate={validateAddress} />
</SimpleFormIterator>
</ArrayInput>
<ArrayInput source="external_ids" label="synapseadmin.users.tabs.sso">
<SimpleFormIterator disableReordering>
<TextInput source="auth_provider" validate={required()} />
<TextInput
source="external_id"
label="resources.users.fields.id"
validate={required()}
/> />
<TextInput source="address" />
</SimpleFormIterator> </SimpleFormIterator>
</ArrayInput> </ArrayInput>
</SimpleForm> </SimpleForm>
</Create> </Create>
); );
const UserTitle = ({ record }) => { const UserTitle = () => {
const record = useRecordContext();
const translate = useTranslate(); const translate = useTranslate();
return ( return (
<span> <span>
@@ -277,11 +310,11 @@ const UserTitle = ({ record }) => {
</span> </span>
); );
}; };
export const UserEdit = props => { export const UserEdit = props => {
const classes = useStyles();
const translate = useTranslate(); const translate = useTranslate();
return ( return (
<Edit {...props} title={<UserTitle />}> <Edit {...props} title={<UserTitle />} actions={<UserEditActions />}>
<TabbedForm toolbar={<UserEditToolbar />}> <TabbedForm toolbar={<UserEditToolbar />}>
<FormTab <FormTab
label={translate("resources.users.name", { smart_count: 1 })} label={translate("resources.users.name", { smart_count: 1 })}
@@ -290,28 +323,27 @@ export const UserEdit = props => {
<AvatarField <AvatarField
source="avatar_src" source="avatar_src"
sortable={false} sortable={false}
className={classes.large} sx={{ height: "120px", width: "120px", float: "right" }}
/> />
<TextInput source="id" disabled /> <TextInput source="id" disabled />
<TextInput source="displayname" /> <TextInput source="displayname" />
<PasswordInput source="password" autoComplete="new-password" /> <PasswordInput
source="password"
autoComplete="new-password"
helperText="resources.users.helper.password"
/>
<SelectInput
source="user_type"
choices={choices_type}
translateChoice={false}
resettable
/>
<BooleanInput source="admin" /> <BooleanInput source="admin" />
<BooleanInput <BooleanInput
source="deactivated" source="deactivated"
helperText="resources.users.helper.deactivate" helperText="resources.users.helper.deactivate"
/> />
<DateField <DateField source="creation_ts_ms" showTime options={date_format} />
source="creation_ts_ms"
showTime
options={{
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
/>
<TextField source="consent_version" /> <TextField source="consent_version" />
</FormTab> </FormTab>
@@ -321,14 +353,8 @@ export const UserEdit = props => {
path="threepid" path="threepid"
> >
<ArrayInput source="threepids"> <ArrayInput source="threepids">
<SimpleFormIterator> <SimpleFormIterator disableReordering>
<SelectInput <SelectInput source="medium" choices={choices_medium} />
source="medium"
choices={[
{ id: "email", name: "resources.users.email" },
{ id: "msisdn", name: "resources.users.msisdn" },
]}
/>
<TextInput source="address" /> <TextInput source="address" />
</SimpleFormIterator> </SimpleFormIterator>
</ArrayInput> </ArrayInput>
@@ -339,16 +365,16 @@ export const UserEdit = props => {
icon={<AssignmentIndIcon />} icon={<AssignmentIndIcon />}
path="sso" path="sso"
> >
<ArrayField source="external_ids" label={false}> <ArrayInput source="external_ids" label={false}>
<Datagrid style={{ width: "100%" }}> <SimpleFormIterator disableReordering>
<TextField source="auth_provider" sortable={false} /> <TextInput source="auth_provider" validate={required()} />
<TextField <TextInput
source="external_id" source="external_id"
label="resources.users.fields.id" label="resources.users.fields.id"
sortable={false} validate={required()}
/> />
</Datagrid> </SimpleFormIterator>
</ArrayField> </ArrayInput>
</FormTab> </FormTab>
<FormTab <FormTab
@@ -368,14 +394,7 @@ export const UserEdit = props => {
<DateField <DateField
source="last_seen_ts" source="last_seen_ts"
showTime showTime
options={{ options={date_format}
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
sortable={false} sortable={false}
/> />
<DeviceRemoveButton /> <DeviceRemoveButton />
@@ -403,14 +422,7 @@ export const UserEdit = props => {
<DateField <DateField
source="last_seen" source="last_seen"
showTime showTime
options={{ options={date_format}
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
sortable={false} sortable={false}
/> />
<TextField <TextField
@@ -437,29 +449,11 @@ export const UserEdit = props => {
sort={{ field: "created_ts", order: "DESC" }} sort={{ field: "created_ts", order: "DESC" }}
> >
<Datagrid style={{ width: "100%" }}> <Datagrid style={{ width: "100%" }}>
<DateField <DateField source="created_ts" showTime options={date_format} />
source="created_ts"
showTime
options={{
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
/>
<DateField <DateField
source="last_access_ts" source="last_access_ts"
showTime showTime
options={{ options={date_format}
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
/> />
<TextField source="media_id" /> <TextField source="media_id" />
<NumberField source="media_length" /> <NumberField source="media_length" />
@@ -485,7 +479,7 @@ export const UserEdit = props => {
> >
<Datagrid <Datagrid
style={{ width: "100%" }} style={{ width: "100%" }}
rowClick={(id, basePath, record) => "/rooms/" + id + "/show"} rowClick={(id, resource, record) => "/rooms/" + id + "/show"}
> >
<TextField <TextField
source="id" source="id"
@@ -531,3 +525,13 @@ export const UserEdit = props => {
</Edit> </Edit>
); );
}; };
const resource = {
name: "users",
icon: UserIcon,
list: UserList,
edit: UserEdit,
create: UserCreate,
};
export default resource;
+39 -5
View File
@@ -10,10 +10,10 @@ const de = {
username_error: "Bitte vollständigen Nutzernamen angeben: '@user:domain'", username_error: "Bitte vollständigen Nutzernamen angeben: '@user:domain'",
protocol_error: "Die URL muss mit 'http://' oder 'https://' beginnen", protocol_error: "Die URL muss mit 'http://' oder 'https://' beginnen",
url_error: "Keine gültige Matrix Server URL", url_error: "Keine gültige Matrix Server URL",
sso_sign_in: "Anmeldung mit SSO",
}, },
users: { users: {
invalid_user_id: invalid_user_id: "Lokaler Anteil der Matrix Benutzer-ID ohne Homeserver.",
"Muss eine vollständige Matrix Benutzer-ID sein, z.B. @benutzer_id:homeserver",
tabs: { sso: "SSO" }, tabs: { sso: "SSO" },
}, },
rooms: { rooms: {
@@ -97,7 +97,6 @@ const de = {
}, },
resources: { resources: {
users: { users: {
backtolist: "Zurück zur Liste",
name: "Benutzer", name: "Benutzer",
email: "E-Mail", email: "E-Mail",
msisdn: "Telefon", msisdn: "Telefon",
@@ -122,8 +121,11 @@ const de = {
creation_ts_ms: "Zeitpunkt der Erstellung", creation_ts_ms: "Zeitpunkt der Erstellung",
consent_version: "Zugestimmte Geschäftsbedingungen", consent_version: "Zugestimmte Geschäftsbedingungen",
auth_provider: "Provider", auth_provider: "Provider",
user_type: "Benutzertyp",
}, },
helper: { helper: {
password:
"Durch die Änderung des Passworts wird der Benutzer von allen Sitzungen abgemeldet.",
deactivate: deactivate:
"Sie müssen ein Passwort angeben, um ein Konto wieder zu aktivieren.", "Sie müssen ein Passwort angeben, um ein Konto wieder zu aktivieren.",
erase: "DSGVO konformes Löschen der Benutzerdaten", erase: "DSGVO konformes Löschen der Benutzerdaten",
@@ -186,7 +188,7 @@ const de = {
}, },
}, },
reports: { reports: {
name: "Ereignisbericht |||| Ereignisberichte", name: "Gemeldetes Ereignis |||| Gemeldete Ereignisse",
fields: { fields: {
id: "ID", id: "ID",
received_ts: "Meldezeit", received_ts: "Meldezeit",
@@ -208,6 +210,13 @@ const de = {
}, },
}, },
}, },
action: {
erase: {
title: "Gemeldetes Event löschen",
content:
"Sind Sie sicher dass Sie das gemeldete Event löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.",
},
},
}, },
connections: { connections: {
name: "Verbindungen", name: "Verbindungen",
@@ -353,6 +362,31 @@ const de = {
send_failure: "Beim Entfernen ist ein Fehler aufgetreten.", send_failure: "Beim Entfernen ist ein Fehler aufgetreten.",
}, },
}, },
destinations: {
name: "Föderation",
fields: {
destination: "Ziel",
failure_ts: "Fehlerzeitpunkt",
retry_last_ts: "Letzter Wiederholungsversuch",
retry_interval: "Wiederholungsintervall",
last_successful_stream_ordering: "letzte erfogreicher Stream",
stream_ordering: "Stream",
},
action: { reconnect: "Neu verbinden" },
},
registration_tokens: {
name: "Registrierungstoken",
fields: {
token: "Token",
valid: "Gültige Token",
uses_allowed: "Anzahl",
pending: "Ausstehend",
completed: "Abgeschlossen",
expiry_time: "Ablaufzeit",
length: "Länge",
},
helper: { length: "Länge des Tokens, wenn kein Token vorgegeben wird." },
},
}, },
ra: { ra: {
...germanMessages.ra, ...germanMessages.ra,
@@ -373,7 +407,7 @@ const de = {
}, },
}, },
notification: { notification: {
...germanMessages.ra.notifiaction, ...germanMessages.ra.notification,
logged_out: "Abgemeldet", logged_out: "Abgemeldet",
}, },
page: { page: {
+40 -5
View File
@@ -10,10 +10,10 @@ const en = {
username_error: "Please enter fully qualified user ID: '@user:domain'", username_error: "Please enter fully qualified user ID: '@user:domain'",
protocol_error: "URL has to start with 'http://' or 'https://'", protocol_error: "URL has to start with 'http://' or 'https://'",
url_error: "Not a valid Matrix server URL", url_error: "Not a valid Matrix server URL",
sso_sign_in: "Sign in with SSO",
}, },
users: { users: {
invalid_user_id: invalid_user_id: "Localpart of a Matrix user-id without homeserver.",
"Must be a fully qualified Matrix user-id, e.g. @user_id:homeserver",
tabs: { sso: "SSO" }, tabs: { sso: "SSO" },
}, },
rooms: { rooms: {
@@ -96,7 +96,6 @@ const en = {
}, },
resources: { resources: {
users: { users: {
backtolist: "Back to list",
name: "User |||| Users", name: "User |||| Users",
email: "Email", email: "Email",
msisdn: "Phone", msisdn: "Phone",
@@ -121,8 +120,10 @@ const en = {
creation_ts_ms: "Creation timestamp", creation_ts_ms: "Creation timestamp",
consent_version: "Consent version", consent_version: "Consent version",
auth_provider: "Provider", auth_provider: "Provider",
user_type: "User type",
}, },
helper: { helper: {
password: "Changing password will log user out of all sessions.",
deactivate: "You must provide a password to re-activate an account.", deactivate: "You must provide a password to re-activate an account.",
erase: "Mark the user as GDPR-erased", erase: "Mark the user as GDPR-erased",
}, },
@@ -175,12 +176,14 @@ const en = {
}, },
unencrypted: "Unencrypted", unencrypted: "Unencrypted",
}, },
action: {
erase: { erase: {
title: "Delete room", title: "Delete room",
content: content:
"Are you sure you want to delete the room? This cannot be undone. All messages and shared media in the room will be deleted from the server!", "Are you sure you want to delete the room? This cannot be undone. All messages and shared media in the room will be deleted from the server!",
}, },
}, },
},
reports: { reports: {
name: "Reported event |||| Reported events", name: "Reported event |||| Reported events",
fields: { fields: {
@@ -194,7 +197,7 @@ const en = {
event_json: { event_json: {
origin: "origin server", origin: "origin server",
origin_server_ts: "time of send", origin_server_ts: "time of send",
type: "event typ", type: "event type",
content: { content: {
msgtype: "content type", msgtype: "content type",
body: "content", body: "content",
@@ -204,6 +207,13 @@ const en = {
}, },
}, },
}, },
action: {
erase: {
title: "Delete reported event",
content:
"Are you sure you want to delete the reported event? This cannot be undone.",
},
},
}, },
connections: { connections: {
name: "Connections", name: "Connections",
@@ -342,13 +352,38 @@ const en = {
title: title:
"Delete room from directory |||| Delete %{smart_count} rooms from directory", "Delete room from directory |||| Delete %{smart_count} rooms from directory",
content: content:
"Are you sure you want to remove this room from directory? |||| Are you sure you want to remove these %{smart_count} rooms from directory", "Are you sure you want to remove this room from directory? |||| Are you sure you want to remove these %{smart_count} rooms from directory?",
erase: "Delete from room directory", erase: "Delete from room directory",
create: "Publish in room directory", create: "Publish in room directory",
send_success: "Room successfully published.", send_success: "Room successfully published.",
send_failure: "An error has occurred.", send_failure: "An error has occurred.",
}, },
}, },
destinations: {
name: "Federation",
fields: {
destination: "Destination",
failure_ts: "Failure timestamp",
retry_last_ts: "Last retry timestamp",
retry_interval: "Retry interval",
last_successful_stream_ordering: "Last successful stream",
stream_ordering: "Stream",
},
action: { reconnect: "Reconnect" },
},
},
registration_tokens: {
name: "Registration tokens",
fields: {
token: "Token",
valid: "Valid token",
uses_allowed: "Uses allowed",
pending: "Pending",
completed: "Completed",
expiry_time: "Expiry time",
length: "Length",
},
helper: { length: "Length of the token if no token is given." },
}, },
}; };
export default en; export default en;
+377
View File
@@ -0,0 +1,377 @@
import frenchMessages from "ra-language-french";
const fr = {
...frenchMessages,
synapseadmin: {
auth: {
base_url: "URL du serveur daccueil",
welcome: "Bienvenue sur Synapse-admin",
server_version: "Version du serveur Synapse",
username_error:
"Veuillez entrer un nom d'utilisateur complet : « @utilisateur:domaine »",
protocol_error: "L'URL doit commencer par « http:// » ou « https:// »",
url_error: "L'URL du serveur Matrix n'est pas valide",
sso_sign_in: "Se connecter avec lauthentification unique",
},
users: {
invalid_user_id:
"Partie locale d'un identifiant utilisateur Matrix sans le nom du serveur daccueil.",
tabs: { sso: "Authentification unique" },
},
rooms: {
tabs: {
basic: "Informations de base",
members: "Membres",
detail: "Détails",
permission: "Permissions",
},
},
reports: { tabs: { basic: "Informations de base", detail: "Détails" } },
},
import_users: {
error: {
at_entry: "Pour l'entrée %{entry} : %{message}",
error: "Erreur",
required_field: "Le champ requis « %{field} » est manquant",
invalid_value:
"Valeur non valide à la ligne %{row}. Le champ « %{field} » ne peut être que « true » ou « false »",
unreasonably_big:
"Refus de charger un fichier trop volumineux de %{size} mégaoctets",
already_in_progress: "Un import est déjà en cours",
id_exits: "L'identifiant %{id} déjà présent",
},
title: "Importer des utilisateurs à partir d'un fichier CSV",
goToPdf: "Voir le PDF",
cards: {
importstats: {
header: "Importer des utilisateurs",
users_total:
"%{smart_count} utilisateur dans le fichier CSV |||| %{smart_count} utilisateurs dans le fichier CSV",
guest_count: "%{smart_count} visiteur |||| %{smart_count} visiteurs",
admin_count:
"%{smart_count} administrateur |||| %{smart_count} administrateurs",
},
conflicts: {
header: "Stratégie de résolution des conflits",
mode: {
stop: "S'arrêter en cas de conflit",
skip: "Afficher l'erreur et ignorer le conflit",
},
},
ids: {
header: "Identifiants",
all_ids_present: "Identifiants présents pour chaque entrée",
count_ids_present:
"%{smart_count} entrée avec identifiant |||| %{smart_count} entrées avec identifiant",
mode: {
ignore:
"Ignorer les identifiants dans le ficher CSV et en créer de nouveaux",
update: "Mettre à jour les enregistrements existants",
},
},
passwords: {
header: "Mots de passe",
all_passwords_present: "Mots de passe présents pour chaque entrée",
count_passwords_present:
"%{smart_count} entrée avec mot de passe |||| %{smart_count} entrées avec mot de passe",
use_passwords: "Utiliser les mots de passe provenant du fichier CSV",
},
upload: {
header: "Fichier CSV en entrée",
explanation:
"Vous pouvez télécharger ici un fichier contenant des valeurs séparées par des virgules qui sera traité pour créer ou mettre à jour des utilisateurs. Le fichier doit inclure les champs « id » et « displayname ». Vous pouvez télécharger et adapter un fichier d'exemple ici : ",
},
startImport: {
simulate_only: "Simuler",
run_import: "Importer",
},
results: {
header: "Résultats de l'import",
total:
"%{smart_count} entrée au total |||| %{smart_count} entrées au total",
successful: "%{smart_count} entrées importées avec succès",
skipped: "%{smart_count} entrées ignorées",
download_skipped: "Télécharger les entrées ignorées",
with_error:
"%{smart_count} entrée avec des erreurs ||| %{smart_count} entrées avec des erreurs",
simulated_only: "L'import était simulé",
},
},
},
resources: {
users: {
name: "Utilisateur |||| Utilisateurs",
email: "Adresse électronique",
msisdn: "Numéro de téléphone",
threepid: "Adresse électronique / Numéro de téléphone",
fields: {
avatar: "Avatar",
id: "Identifiant",
name: "Nom",
is_guest: "Visiteur",
admin: "Administrateur du serveur",
deactivated: "Désactivé",
guests: "Afficher les visiteurs",
show_deactivated: "Afficher les utilisateurs désactivés",
user_id: "Rechercher un utilisateur",
displayname: "Nom d'affichage",
password: "Mot de passe",
avatar_url: "URL de l'avatar",
avatar_src: "Avatar",
medium: "Type",
threepids: "Identifiants tiers",
address: "Adresse",
creation_ts_ms: "Date de création",
consent_version: "Version du consentement",
auth_provider: "Fournisseur d'identité",
},
helper: {
deactivate:
"Vous devrez fournir un mot de passe pour réactiver le compte.",
erase: "Marquer l'utilisateur comme effacé conformément au RGPD",
},
action: {
erase: "Effacer les données de l'utilisateur",
},
},
rooms: {
name: "Salon |||| Salons",
fields: {
room_id: "Identifiant du salon",
name: "Nom",
canonical_alias: "Alias",
joined_members: "Membres",
joined_local_members: "Membres locaux",
joined_local_devices: "Appareils locaux",
state_events: "Événements d'État / Complexité",
version: "Version",
is_encrypted: "Chiffré",
encryption: "Chiffrement",
federatable: "Fédérable",
public: "Visible dans le répertoire des salons",
creator: "Créateur",
join_rules: "Règles d'adhésion",
guest_access: "Accès des visiteurs",
history_visibility: "Visibilité de l'historique",
topic: "Sujet",
avatar: "Avatar",
},
helper: {
forward_extremities:
"Les extrémités avant sont les événements feuilles à la fin d'un graphe orienté acyclique (DAG) dans un salon, c'est-à-dire les événements qui n'ont pas de descendants. Plus il y en a dans un salon, plus la résolution d'état que Synapse doit effectuer est importante (indice : c'est une opération coûteuse). Bien que Synapse dispose d'un algorithme pour éviter qu'un trop grand nombre de ces événements n'existent en même temps dans un salon, des bogues peuvent parfois les faire réapparaître. Si un salon présente plus de 10 extrémités avant, cela vaut la peine d'y prêter attention et éventuellement de les supprimer en utilisant les requêtes SQL mentionnées dans la discussion traitant du problème https://github.com/matrix-org/synapse/issues/1760.",
},
enums: {
join_rules: {
public: "Public",
knock: "Sur demande",
invite: "Sur invitation",
private: "Privé",
},
guest_access: {
can_join: "Les visiteurs peuvent rejoindre le salon",
forbidden: "Les visiteurs ne peuvent pas rejoindre le salon",
},
history_visibility: {
invited: "Depuis l'invitation",
joined: "Depuis l'adhésion",
shared: "Depuis le partage",
world_readable: "Tout le monde",
},
unencrypted: "Non chiffré",
},
action: {
erase: {
title: "Supprimer le salon",
content:
"Voulez-vous vraiment supprimer le salon ? Cette opération ne peut être annulée. Tous les messages et médias partagés du salon seront supprimés du serveur !",
},
},
},
reports: {
name: "Événement signalé |||| Événements signalés",
fields: {
id: "Identifiant",
received_ts: "Date du rapport",
user_id: "Rapporteur",
name: "Nom du salon",
score: "Score",
reason: "Motif",
event_id: "Identifiant de l'événement",
event_json: {
origin: "Serveur d'origine",
origin_server_ts: "Date d'envoi",
type: "Type d'événement",
content: {
msgtype: "Type de contenu",
body: "Contenu",
format: "Format",
formatted_body: "Contenu mis en forme",
algorithm: "Algorithme",
},
},
},
},
connections: {
name: "Connexions",
fields: {
last_seen: "Date",
ip: "Adresse IP",
user_agent: "Agent utilisateur",
},
},
devices: {
name: "Appareil |||| Appareils",
fields: {
device_id: "Identifiant de l'appareil",
display_name: "Nom de l'appareil",
last_seen_ts: "Date",
last_seen_ip: "Adresse IP",
},
action: {
erase: {
title: "Suppression de %{id}",
content: "Voulez-vous vraiment supprimer l'appareil « %{name} » ?",
success: "Appareil supprimé avec succès",
failure: "Une erreur s'est produite",
},
},
},
users_media: {
name: "Media",
fields: {
media_id: "Identifiant du média",
media_length: "Taille du fichier (en octets)",
media_type: "Type",
upload_name: "Nom du fichier",
quarantined_by: "Mis en quarantaine par",
safe_from_quarantine: "Protection contre la mise en quarantaine",
created_ts: "Date de création",
last_access_ts: "Dernier accès",
},
},
delete_media: {
name: "Media",
fields: {
before_ts: "Dernier accès avant",
size_gt: "Plus grand que (en octets)",
keep_profiles: "Conserver les images de profil",
},
action: {
send: "Supprimer le média",
send_success: "Requête envoyée avec succès",
send_failure: "Une erreur s'est produite",
},
helper: {
send: "Cette API supprime les médias locaux du disque de votre propre serveur. Cela inclut toutes les vignettes locales et les copies des médias téléchargés. Cette API n'affectera pas les médias qui ont été téléversés dans des dépôts de médias externes.",
},
},
protect_media: {
action: {
create: "Protéger",
delete: "Révoquer la protection",
none: "En quarantaine",
send_success: "Le statut de protection a été modifié avec succès",
send_failure: "Une erreur s'est produite",
},
},
quarantine_media: {
action: {
name: "Quarantaine",
create: "Mettre en quarantaine",
delete: "Révoquer la mise en quarantaine",
none: "Protégé contre la mise en quarantaine",
send_success: "Le statut de la quarantaine a été modifié avec succès",
send_failure: "Une erreur s'est produite",
},
},
pushers: {
name: "Émetteur de notifications |||| Émetteurs de notifications",
fields: {
app: "Application",
app_display_name: "Nom d'affichage de l'application",
app_id: "Identifiant de l'application",
device_display_name: "Nom d'affichage de l'appareil",
kind: "Type",
lang: "Langue",
profile_tag: "Profil",
pushkey: "Identifiant de l'émetteur",
data: { url: "URL" },
},
},
servernotices: {
name: "Annonces du serveur",
send: "Envoyer des « Annonces du serveur »",
fields: {
body: "Message",
},
action: {
send: "Envoyer une annonce",
send_success: "Annonce envoyée avec succès",
send_failure: "Une erreur s'est produite",
},
helper: {
send: "Envoie une annonce au nom du serveur aux utilisateurs sélectionnés. La fonction « Annonces du serveur » doit être activée sur le serveur.",
},
},
user_media_statistics: {
name: "Médias des utilisateurs",
fields: {
media_count: "Nombre de médias",
media_length: "Taille des médias",
},
},
forward_extremities: {
name: "Extrémités avant",
fields: {
id: "Identifiant de l'événement",
received_ts: "Date de réception",
depth: "Profondeur",
state_group: "Groupe d'état",
},
},
room_state: {
name: "Événements d'état",
fields: {
type: "Type",
content: "Contenu",
origin_server_ts: "Date d'envoi",
sender: "Expéditeur",
},
},
room_directory: {
name: "Répertoire des salons",
fields: {
world_readable:
"Tout utilisateur peut avoir un aperçu du salon, sans en devenir membre",
guest_can_join: "Les visiteurs peuvent rejoindre le salon",
},
action: {
title:
"Supprimer un salon du répertoire |||| Supprimer %{smart_count} salons du répertoire",
content:
"Voulez-vous vraiment supprimer ce salon du répertoire ? |||| Voulez-vous vraiment supprimer ces %{smart_count} salons du répertoire ?",
erase: "Supprimer du répertoire des salons",
create: "Publier dans le répertoire des salons",
send_success: "Salon publié avec succès",
send_failure: "Une erreur s'est produite",
},
},
},
registration_tokens: {
name: "Jetons d'inscription",
fields: {
token: "Jeton",
valid: "Jeton valide",
uses_allowed: "Nombre d'inscription autorisées",
pending: "Nombre d'inscription en cours",
completed: "Nombre d'inscription accomplie",
expiry_time: "Date d'expiration",
length: "Longueur",
},
helper: {
length:
"Longueur du jeton généré aléatoirement si aucun jeton n'est pas spécifié",
},
},
};
export default fr;
+385
View File
@@ -0,0 +1,385 @@
import italianMessages from "ra-language-italian";
const it = {
...italianMessages,
synapseadmin: {
auth: {
base_url: "URL dell'homeserver",
welcome: "Benvenuto in Synapse-admin",
server_version: "Versione di Synapse",
username_error:
"Per favore inserisci un ID utente completo: '@utente:dominio'",
protocol_error: "L'URL deve iniziare per 'http://' o 'https://'",
url_error: "URL del server Matrix non valido",
sso_sign_in: "Accedi con SSO",
},
users: {
invalid_user_id: "ID utente non valido su questo homeserver.",
tabs: { sso: "SSO" },
},
rooms: {
tabs: {
basic: "Semplice",
members: "Membro",
detail: "Dettagli",
permission: "Permessi",
},
},
reports: { tabs: { basic: "Semplice", detail: "Dettagli" } },
},
import_users: {
error: {
at_entry: "Alla voce %{entry}: %{message}",
error: "Errore",
required_field: "Il campo '%{field}' non è presente",
invalid_value:
"Valore non valido alla riga %{row}. '%{field}' Il campo può essere solo 'true' o 'false'",
unreasonably_big:
"Impossibile caricare un file così grosso (%{size} megabyte)",
already_in_progress: "Un import è attualmente già in caricamento",
id_exits: "L'ID %{id} è già presente",
},
title: "Importa utenti tramite file CSV",
goToPdf: "Vai al PDF",
cards: {
importstats: {
header: "Importa utenti",
users_total:
"%{smart_count} utente nel file CSV |||| %{smart_count} utenti nel file CSV",
guest_count: "%{smart_count} ospite |||| %{smart_count} ospiti",
admin_count:
"%{smart_count} amministratore |||| %{smart_count} amministratori",
},
conflicts: {
header: "Strategia di conflitto",
mode: {
stop: "Stoppa al conflitto",
skip: "Mostra l'errore e ignora il conflitto",
},
},
ids: {
header: "ID",
all_ids_present: "ID presenti in ogni voce",
count_ids_present:
"%{smart_count} voce con ID |||| %{smart_count} voci con ID",
mode: {
ignore: "Ignora gli ID nel file CSV e creane di nuovi",
update: "Aggiorna le voci esistenti",
},
},
passwords: {
header: "Passwords",
all_passwords_present: "Password presenti in ogni voce",
count_passwords_present:
"%{smart_count} voce con password |||| %{smart_count} voci con password",
use_passwords: "Usa le password dal file CSV",
},
upload: {
header: "Input file CSV",
explanation:
"Qui puoi caricare un file con valori separati da virgole che verrà poi utilizzato per creare o aggiornare gli utenti. Il file deve includere i campi 'id' and 'displayname'. Puoi scaricare un file di esempio per adattarlo: ",
},
startImport: {
simulate_only: "Solo simulazione",
run_import: "Importa",
},
results: {
header: "Importa i risultati",
total:
"%{smart_count} voce in totale |||| %{smart_count} voci in totale",
successful: "%{smart_count} voci importate con successo",
skipped: "%{smart_count} voci ignorate",
download_skipped: "Scarica le voci ignorate",
with_error:
"%{smart_count} voce con errori ||| %{smart_count} voci con errori",
simulated_only: "Il processo era stato solamente simulato",
},
},
},
resources: {
users: {
name: "Utente |||| Utenti",
email: "Email",
msisdn: "Telefono",
threepid: "Email / Telefono",
fields: {
avatar: "Avatar",
id: "ID utente",
name: "Nome",
is_guest: "Ospite",
admin: "Amministratore",
deactivated: "Disattivato",
guests: "Mostra gli ospiti",
show_deactivated: "Mostra gli utenti disattivati",
user_id: "Cerca utente",
displayname: "Nickname",
password: "Password",
avatar_url: "URL dell'avatar",
avatar_src: "Avatar",
medium: "Medium",
threepids: "3PID",
address: "Indirizzo",
creation_ts_ms: "Creazione del timestamp",
consent_version: "Versione minima richiesta",
auth_provider: "Provider",
user_type: "Tipo d'utente",
},
helper: {
password:
"Cambiando la password l'utente verrà disconnesso da tutte le sessioni attive.",
deactivate: "Devi fornire una password per riattivare l'account.",
erase: "Constrassegna l'utente come cancellato dal GDPR",
},
action: {
erase: "Cancella i dati dell'utente",
},
},
rooms: {
name: "Stanza |||| Stanze",
fields: {
room_id: "ID della stanza",
name: "Nome",
canonical_alias: "Alias",
joined_members: "Membri",
joined_local_members: "Membri locali",
joined_local_devices: "Dispositivi locali",
state_events: "Eventi di stato / Complessità",
version: "Versione",
is_encrypted: "Criptato",
encryption: "Crittografia",
federatable: "Federabile",
public: "Visibile nella cartella della stanza",
creator: "Creatore",
join_rules: "Regole per entrare",
guest_access: "Entra come ospite",
history_visibility: "Visibilità temporale",
topic: "Topic",
avatar: "Avatar",
},
helper: {
/* forward_extremities:
"Forward extremities are the leaf events at the end of a Directed acyclic graph (DAG) in a room, aka events that have no children. The more exist in a room, the more state resolution that Synapse needs to perform (hint: it's an expensive operation). While Synapse has code to prevent too many of these existing at one time in a room, bugs can sometimes make them crop up again. If a room has >10 forward extremities, it's worth checking which room is the culprit and potentially removing them using the SQL queries mentioned in #1760.", */
},
enums: {
join_rules: {
public: "Pubblica",
knock: "Bussa",
invite: "Invita",
private: "Privata",
},
guest_access: {
can_join: "Gli utenti ospiti possono entrare",
forbidden: "Gli utenti ospiti non possono entrare",
},
history_visibility: {
invited: "Dall'invito",
joined: "Dall'entrata",
shared: "Dalla condivisione",
world_readable: "Chiunque",
},
unencrypted: "Non criptata",
},
action: {
erase: {
title: "Cancella stanza",
content:
"Sei sicuro di voler eliminare questa stanza? Questa azione è definitiva. Tutti i messaggi e i media condivisi in questa stanza verranno eliminati dal server!",
},
},
},
reports: {
name: "Evento segnalato |||| Eventi segnalati",
fields: {
id: "ID",
received_ts: "Orario del report",
user_id: "richiedente",
name: "nome della stanza",
score: "punteggio",
reason: "ragione",
event_id: "ID dell'evento",
event_json: {
origin: "server di origine",
origin_server_ts: "ora dell'invio",
type: "tipo di evento",
content: {
msgtype: "tipo di contenuto",
body: "contenuto",
format: "formato",
formatted_body: "contenuto formattato",
algorithm: "algoritmo",
},
},
},
},
connections: {
name: "Connessioni",
fields: {
last_seen: "Data",
ip: "Indirizzo IP",
user_agent: "agente utente",
},
},
devices: {
name: "Dispositivo |||| Dispositivi",
fields: {
device_id: "ID del dispositivo",
display_name: "Nome del dispositivo",
last_seen_ts: "Timestamp",
last_seen_ip: "Indirizzo IP",
},
action: {
erase: {
title: "Rimozione del dispositivo %{id}",
content: 'Sei sicuro di voler rimuovere il dispositivo "%{name}"?',
success: "Dispositivo rimosso con successo.",
failure: "C'è stato un errore.",
},
},
},
users_media: {
name: "Media",
fields: {
media_id: "ID del media",
media_length: "Peso del file (in Byte)",
media_type: "Tipo",
upload_name: "Nome del file",
quarantined_by: "In quarantena da",
safe_from_quarantine: "Protetto dalla quarantena",
created_ts: "Creato",
last_access_ts: "Ultimo accesso",
},
},
delete_media: {
name: "Media",
fields: {
before_ts: "ultimo accesso effettuato prima",
size_gt: "Più grande di (in byte)",
keep_profiles: "Mantieni le immagini del profilo",
},
action: {
send: "Cancella media",
send_success: "Richiesta inviata con successo.",
send_failure: "C'è stato un errore.",
},
helper: {
send: "Questa API cancella i media locali dal disco del tuo server. Questo include anche ogni miniatura e copia del media scaricato. Questa API non inciderà sui media che sono stati caricati nei repository esterni.",
},
},
protect_media: {
action: {
create: "Non protetto, proteggi",
delete: "Protetto, rimuovi protezione",
none: "In quarantena",
send_success: "Stato della protezione cambiato con successo.",
send_failure: "C'è stato un errore.",
},
},
quarantine_media: {
action: {
name: "Quarantina",
create: "Aggiungi alla quarantena",
delete: "In quarantena, rimuovi dalla quarantena",
none: "Protetto dalla quarantena",
send_success: "Stato della quarantena cambiato con successo.",
send_failure: "C'è stato un errore.",
},
},
pushers: {
name: "Pusher |||| Pusher",
fields: {
app: "App",
app_display_name: "Nome dell'app",
app_id: "ID dell'app",
device_display_name: "Nome del dispositivo",
kind: "Tipo",
lang: "Lingua",
profile_tag: "Tag del profilo",
pushkey: "Pushkey",
data: { url: "URL" },
},
},
servernotices: {
name: "Avvisi del server",
send: "Invia avvisi",
fields: {
body: "Messaggio",
},
action: {
send: "Invia nota",
send_success: "Avviso inviato con successo.",
send_failure: "C'è stato un errore.",
},
helper: {
send: 'Invia un avviso dal server agli utenti selezionati. La feature "Avvisi del server" è stata attivata sul server.',
},
},
user_media_statistics: {
name: "Media degli utenti",
fields: {
media_count: "Numero media",
media_length: "Lunghezza media",
},
},
forward_extremities: {
name: "Invia estremità",
fields: {
id: "Event ID",
received_ts: "Timestamp",
depth: "Profondità",
state_group: "State group",
},
},
room_state: {
name: "Eventi di stato",
fields: {
type: "Tipo",
content: "Contenuto",
origin_server_ts: "Ora dell'invio",
sender: "Mittente",
},
},
room_directory: {
name: "Elenco delle stanze",
fields: {
world_readable: "gli utenti ospite possono vedere senza entrare",
guest_can_join: "gli utenti ospite possono entrare",
},
action: {
title:
"Cancella stanza dall'elenco |||| Cancella %{smart_count} stanze dall'elenco",
content:
"Sei sicuro di voler rimuovere questa stanza dall'elenco? |||| Sei sicuro di voler rimuovere %{smart_count} stanze dall'elenco?",
erase: "Rimuovi dall'elenco",
create: "Crea",
send_success: "Stanza creata con successo.",
send_failure: "C'è stato un errore.",
},
},
destinations: {
name: "Federazione",
fields: {
destination: "Destinazione",
failure_ts: "Timestamp dell'errore",
retry_last_ts: "Tentativo ultimo timestamp",
retry_interval: "Intervallo dei tentativi",
last_successful_stream_ordering: "Ultimo flusso riuscito con successo",
stream_ordering: "Flusso",
},
action: { reconnect: "Riconnetti" },
},
},
registration_tokens: {
name: "Token di registrazione",
fields: {
token: "Token",
valid: "Token valido",
uses_allowed: "Usi permessi",
pending: "In attesa",
completed: "Completato",
expiry_time: "Data della scadenza",
length: "Lunghezza",
},
helper: { length: "Lunghezza del token se non viene dato alcun token." },
},
};
export default it;
+2 -1
View File
@@ -10,10 +10,12 @@ const zh = {
username_error: "请输入完整有效的用户 ID: '@user:domain'", username_error: "请输入完整有效的用户 ID: '@user:domain'",
protocol_error: "URL 需要以'http://'或'https://'作为起始", protocol_error: "URL 需要以'http://'或'https://'作为起始",
url_error: "不是一个有效的 Matrix 服务器地址", url_error: "不是一个有效的 Matrix 服务器地址",
sso_sign_in: "使用 SSO 登录",
}, },
users: { users: {
invalid_user_id: invalid_user_id:
"必须要是一个有效的 Matrix 用户 ID ,例如 @user_id:homeserver", "必须要是一个有效的 Matrix 用户 ID ,例如 @user_id:homeserver",
tabs: { sso: "SSO" },
}, },
rooms: { rooms: {
tabs: { tabs: {
@@ -98,7 +100,6 @@ const zh = {
}, },
resources: { resources: {
users: { users: {
backtolist: "回到列表",
name: "用户", name: "用户",
email: "邮箱", email: "邮箱",
msisdn: "电话", msisdn: "电话",
-5
View File
@@ -1,5 +0,0 @@
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
ReactDOM.render(<App />, document.getElementById("root"));
+11
View File
@@ -0,0 +1,11 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
const REACT_APP_SERVER = import.meta.env.VITE_APP_SERVER;
ReactDOM.createRoot(document.getElementById("root")).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
+24 -13
View File
@@ -1,37 +1,48 @@
import { fetchUtils } from "react-admin"; import { fetchUtils } from "react-admin";
const authProvider = { const authProvider = (fixed_base_url, store) => ({
// called when the user attempts to log in // called when the user attempts to log in
login: ({ base_url, username, password }) => { login: ({ base_url, username, password, loginToken }) => {
// force homeserver for protection in case the form is manipulated // force homeserver for protection in case the form is manipulated
base_url = process.env.REACT_APP_SERVER || base_url; base_url = fixed_base_url || base_url;
console.log("login "); console.log("login ");
const options = { const options = {
method: "POST", method: "POST",
body: JSON.stringify({ body: JSON.stringify(
Object.assign(
{
device_id: store.getItem("device_id"),
initial_device_display_name: "Synapse Admin",
},
loginToken
? {
type: "m.login.token",
token: loginToken,
}
: {
type: "m.login.password", type: "m.login.password",
user: username, user: username,
password: password, password: password,
device_id: localStorage.getItem("device_id"), }
initial_device_display_name: "Synapse Admin", )
}), ),
}; };
// use the base_url from login instead of the well_known entry from the // use the base_url from login instead of the well_known entry from the
// server, since the admin might want to access the admin API via some // server, since the admin might want to access the admin API via some
// private address // private address
base_url = base_url.replace(/\/+$/g, ""); base_url = base_url.replace(/\/+$/g, "");
localStorage.setItem("base_url", base_url); store.setItem("base_url", base_url);
const decoded_base_url = window.decodeURIComponent(base_url); const decoded_base_url = window.decodeURIComponent(base_url);
const login_api_url = decoded_base_url + "/_matrix/client/r0/login"; const login_api_url = decoded_base_url + "/_matrix/client/r0/login";
return fetchUtils.fetchJson(login_api_url, options).then(({ json }) => { return fetchUtils.fetchJson(login_api_url, options).then(({ json }) => {
localStorage.setItem("home_server", json.home_server); store.setItem("home_server", json.home_server);
localStorage.setItem("user_id", json.user_id); store.setItem("user_id", json.user_id);
localStorage.setItem("access_token", json.access_token); store.setItem("access_token", json.access_token);
localStorage.setItem("device_id", json.device_id); store.setItem("device_id", json.device_id);
}); });
}, },
// called when the user clicks on the logout button // called when the user clicks on the logout button
@@ -75,6 +86,6 @@ const authProvider = {
}, },
// called when the user navigates to a new location, to check for permissions / roles // called when the user navigates to a new location, to check for permissions / roles
getPermissions: () => Promise.resolve(), getPermissions: () => Promise.resolve(),
}; });
export default authProvider; export default authProvider;
+95 -22
View File
@@ -41,12 +41,16 @@ const resourceMap = {
data: "users", data: "users",
total: json => json.total, total: json => json.total,
create: data => ({ create: data => ({
endpoint: `/_synapse/admin/v2/users/${data.id}`, endpoint: `/_synapse/admin/v2/users/@${encodeURIComponent(
data.id
)}:${localStorage.getItem("home_server")}`,
body: data, body: data,
method: "PUT", method: "PUT",
}), }),
delete: params => ({ delete: params => ({
endpoint: `/_synapse/admin/v1/deactivate/${params.id}`, endpoint: `/_synapse/admin/v1/deactivate/${encodeURIComponent(
params.id
)}`,
body: { erase: true }, body: { erase: true },
method: "POST", method: "POST",
}), }),
@@ -67,7 +71,7 @@ const resourceMap = {
return json.total_rooms; return json.total_rooms;
}, },
delete: params => ({ delete: params => ({
endpoint: `/_synapse/admin/v1/rooms/${params.id}`, endpoint: `/_synapse/admin/v2/rooms/${params.id}`,
body: { block: false }, body: { block: false },
}), }),
}, },
@@ -90,10 +94,12 @@ const resourceMap = {
return json.total; return json.total;
}, },
reference: id => ({ reference: id => ({
endpoint: `/_synapse/admin/v2/users/${id}/devices`, endpoint: `/_synapse/admin/v2/users/${encodeURIComponent(id)}/devices`,
}), }),
delete: params => ({ delete: params => ({
endpoint: `/_synapse/admin/v2/users/${params.user_id}/devices/${params.id}`, endpoint: `/_synapse/admin/v2/users/${encodeURIComponent(
params.previousData.user_id
)}/devices/${params.id}`,
}), }),
}, },
connections: { connections: {
@@ -135,7 +141,7 @@ const resourceMap = {
id: p.pushkey, id: p.pushkey,
}), }),
reference: id => ({ reference: id => ({
endpoint: `/_synapse/admin/v1/users/${id}/pushers`, endpoint: `/_synapse/admin/v1/users/${encodeURIComponent(id)}/pushers`,
}), }),
data: "pushers", data: "pushers",
total: json => { total: json => {
@@ -147,7 +153,9 @@ const resourceMap = {
id: jr, id: jr,
}), }),
reference: id => ({ reference: id => ({
endpoint: `/_synapse/admin/v1/users/${id}/joined_rooms`, endpoint: `/_synapse/admin/v1/users/${encodeURIComponent(
id
)}/joined_rooms`,
}), }),
data: "joined_rooms", data: "joined_rooms",
total: json => { total: json => {
@@ -160,7 +168,7 @@ const resourceMap = {
id: um.media_id, id: um.media_id,
}), }),
reference: id => ({ reference: id => ({
endpoint: `/_synapse/admin/v1/users/${id}/media`, endpoint: `/_synapse/admin/v1/users/${encodeURIComponent(id)}/media`,
}), }),
data: "media", data: "media",
total: json => { total: json => {
@@ -176,9 +184,9 @@ const resourceMap = {
delete: params => ({ delete: params => ({
endpoint: `/_synapse/admin/v1/media/${localStorage.getItem( endpoint: `/_synapse/admin/v1/media/${localStorage.getItem(
"home_server" "home_server"
)}/delete?before_ts=${params.before_ts}&size_gt=${ )}/delete?before_ts=${params.meta.before_ts}&size_gt=${
params.size_gt params.meta.size_gt
}&keep_profiles=${params.keep_profiles}`, }&keep_profiles=${params.meta.keep_profiles}`,
method: "POST", method: "POST",
}), }),
}, },
@@ -189,7 +197,7 @@ const resourceMap = {
method: "POST", method: "POST",
}), }),
delete: params => ({ delete: params => ({
endpoint: `/_synapse/admin/v1/media/unprotect/${params.media_id}`, endpoint: `/_synapse/admin/v1/media/unprotect/${params.id}`,
method: "POST", method: "POST",
}), }),
}, },
@@ -204,7 +212,7 @@ const resourceMap = {
delete: params => ({ delete: params => ({
endpoint: `/_synapse/admin/v1/media/unquarantine/${localStorage.getItem( endpoint: `/_synapse/admin/v1/media/unquarantine/${localStorage.getItem(
"home_server" "home_server"
)}/${params.media_id}`, )}/${params.id}`,
method: "POST", method: "POST",
}), }),
}, },
@@ -273,11 +281,59 @@ const resourceMap = {
method: "PUT", method: "PUT",
}), }),
}, },
destinations: {
path: "/_synapse/admin/v1/federation/destinations",
map: dst => ({
...dst,
id: dst.destination,
}),
data: "destinations",
total: json => {
return json.total;
},
delete: params => ({
endpoint: `/_synapse/admin/v1/federation/destinations/${params.id}/reset_connection`,
method: "POST",
}),
},
destination_rooms: {
map: dstroom => ({
...dstroom,
id: dstroom.room_id,
}),
reference: id => ({
endpoint: `/_synapse/admin/v1/federation/destinations/${id}/rooms`,
}),
data: "rooms",
total: json => {
return json.total;
},
},
registration_tokens: {
path: "/_synapse/admin/v1/registration_tokens",
map: rt => ({
...rt,
id: rt.token,
}),
data: "registration_tokens",
total: json => {
return json.registration_tokens.length;
},
create: params => ({
endpoint: "/_synapse/admin/v1/registration_tokens/new",
body: params,
method: "POST",
}),
delete: params => ({
endpoint: `/_synapse/admin/v1/registration_tokens/${params.id}`,
}),
},
}; };
function filterNullValues(key, value) { function filterNullValues(key, value) {
// Filtering out null properties // Filtering out null properties
if (value === null) { // to reset user_type from user, it must be null
if (value === null && key !== "user_type") {
return undefined; return undefined;
} }
return value; return value;
@@ -294,7 +350,15 @@ function getSearchOrder(order) {
const dataProvider = { const dataProvider = {
getList: (resource, params) => { getList: (resource, params) => {
console.log("getList " + resource); console.log("getList " + resource);
const { user_id, name, guests, deactivated, search_term } = params.filter; const {
user_id,
name,
guests,
deactivated,
search_term,
destination,
valid,
} = params.filter;
const { page, perPage } = params.pagination; const { page, perPage } = params.pagination;
const { field, order } = params.sort; const { field, order } = params.sort;
const from = (page - 1) * perPage; const from = (page - 1) * perPage;
@@ -304,8 +368,10 @@ const dataProvider = {
user_id: user_id, user_id: user_id,
search_term: search_term, search_term: search_term,
name: name, name: name,
destination: destination,
guests: guests, guests: guests,
deactivated: deactivated, deactivated: deactivated,
valid: valid,
order_by: field, order_by: field,
dir: getSearchOrder(order), dir: getSearchOrder(order),
}; };
@@ -331,9 +397,11 @@ const dataProvider = {
const res = resourceMap[resource]; const res = resourceMap[resource];
const endpoint_url = homeserver + res.path; const endpoint_url = homeserver + res.path;
return jsonClient(`${endpoint_url}/${params.id}`).then(({ json }) => ({ return jsonClient(`${endpoint_url}/${encodeURIComponent(params.id)}`).then(
({ json }) => ({
data: res.map(json), data: res.map(json),
})); })
);
}, },
getMany: (resource, params) => { getMany: (resource, params) => {
@@ -345,7 +413,9 @@ const dataProvider = {
const endpoint_url = homeserver + res.path; const endpoint_url = homeserver + res.path;
return Promise.all( return Promise.all(
params.ids.map(id => jsonClient(`${endpoint_url}/${id}`)) params.ids.map(id =>
jsonClient(`${endpoint_url}/${encodeURIComponent(id)}`)
)
).then(responses => ({ ).then(responses => ({
data: responses.map(({ json }) => res.map(json)), data: responses.map(({ json }) => res.map(json)),
total: responses.length, total: responses.length,
@@ -386,7 +456,7 @@ const dataProvider = {
const res = resourceMap[resource]; const res = resourceMap[resource];
const endpoint_url = homeserver + res.path; const endpoint_url = homeserver + res.path;
return jsonClient(`${endpoint_url}/${params.data.id}`, { return jsonClient(`${endpoint_url}/${encodeURIComponent(params.id)}`, {
method: "PUT", method: "PUT",
body: JSON.stringify(params.data, filterNullValues), body: JSON.stringify(params.data, filterNullValues),
}).then(({ json }) => ({ }).then(({ json }) => ({
@@ -403,10 +473,13 @@ const dataProvider = {
const endpoint_url = homeserver + res.path; const endpoint_url = homeserver + res.path;
return Promise.all( return Promise.all(
params.ids.map(id => jsonClient(`${endpoint_url}/${id}`), { params.ids.map(
id => jsonClient(`${endpoint_url}/${encodeURIComponent(id)}`),
{
method: "PUT", method: "PUT",
body: JSON.stringify(params.data, filterNullValues), body: JSON.stringify(params.data, filterNullValues),
}) }
)
).then(responses => ({ ).then(responses => ({
data: responses.map(({ json }) => json), data: responses.map(({ json }) => json),
})); }));
@@ -473,7 +546,7 @@ const dataProvider = {
const endpoint_url = homeserver + res.path; const endpoint_url = homeserver + res.path;
return jsonClient(`${endpoint_url}/${params.id}`, { return jsonClient(`${endpoint_url}/${params.id}`, {
method: "DELETE", method: "DELETE",
body: JSON.stringify(params.data, filterNullValues), body: JSON.stringify(params.previousData, filterNullValues),
}).then(({ json }) => ({ }).then(({ json }) => ({
data: json, data: json,
})); }));
+48
View File
@@ -0,0 +1,48 @@
import { fetchUtils } from "react-admin";
export const splitMxid = mxid => {
const re =
/^@(?<name>[a-zA-Z0-9._=\-/]+):(?<domain>[a-zA-Z0-9\-.]+\.[a-zA-Z]+)$/;
return re.exec(mxid)?.groups;
};
export const isValidBaseUrl = baseUrl =>
/^(http|https):\/\/[a-zA-Z0-9\-.]+(:\d{1,5})?$/.test(baseUrl);
/**
* Resolve the homeserver URL using the well-known lookup
* @param domain the domain part of an MXID
* @returns homeserver base URL
*/
export const getWellKnownUrl = async domain => {
const wellKnownUrl = `https://${domain}/.well-known/matrix/client`;
try {
const json = await fetchUtils.fetchJson(wellKnownUrl, { method: "GET" });
return json["m.homeserver"].base_url;
} catch {
// if there is no .well-known entry, return the domain itself
return `https://${domain}`;
}
};
/**
* Get synapse server version
* @param base_url the base URL of the homeserver
* @returns server version
*/
export const getServerVersion = async baseUrl => {
const versionUrl = `${baseUrl}/_synapse/admin/v1/server_version`;
const response = await fetchUtils.fetchJson(versionUrl, { method: "GET" });
return response.json.server_version;
};
/**
* Get supported login flows
* @param baseUrl the base URL of the homeserver
* @returns array of supported login flows
*/
export const getSupportedLoginFlows = async baseUrl => {
const loginFlowsUrl = `${baseUrl}/_matrix/client/r0/login`;
const response = await fetchUtils.fetchJson(loginFlowsUrl, { method: "GET" });
return response.json.flows;
};
+31
View File
@@ -0,0 +1,31 @@
import { isValidBaseUrl, splitMxid } from "./synapse";
describe("splitMxid", () => {
it("splits valid MXIDs", () =>
expect(splitMxid("@name:domain.tld")).toEqual({
name: "name",
domain: "domain.tld",
}));
it("rejects invalid MXIDs", () => expect(splitMxid("foo")).toBeUndefined());
});
describe("isValidBaseUrl", () => {
it("accepts a http URL", () =>
expect(isValidBaseUrl("http://foo.bar")).toBeTruthy());
it("accepts a https URL", () =>
expect(isValidBaseUrl("https://foo.bar")).toBeTruthy());
it("accepts a valid URL with port", () =>
expect(isValidBaseUrl("https://foo.bar:1234")).toBeTruthy());
it("rejects undefined base URLs", () =>
expect(isValidBaseUrl(undefined)).toBeFalsy());
it("rejects null base URLs", () => expect(isValidBaseUrl(null)).toBeFalsy());
it("rejects empty base URLs", () => expect(isValidBaseUrl("")).toBeFalsy());
it("rejects non-string base URLs", () =>
expect(isValidBaseUrl({})).toBeFalsy());
it("rejects base URLs without protocol", () =>
expect(isValidBaseUrl("foo.bar")).toBeFalsy());
it("rejects base URLs with path", () =>
expect(isValidBaseUrl("http://foo.bar/path")).toBeFalsy());
it("rejects invalid base URLs", () =>
expect(isValidBaseUrl("http:/foo.bar")).toBeFalsy());
});
+6
View File
@@ -0,0 +1,6 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
});
+3167 -10549
View File
File diff suppressed because it is too large Load Diff