diff --git a/src/App.js b/src/App.js
index 68b8f2d..70b7f7b 100644
--- a/src/App.js
+++ b/src/App.js
@@ -3,7 +3,9 @@ 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 LoginPage from "./components/LoginPage";
+import UserIcon from "@material-ui/icons/Group";
import germanMessages from "./i18n/de";
import englishMessages from "./i18n/en";
@@ -24,7 +26,13 @@ const App = () => (
dataProvider={dataProvider}
i18nProvider={i18nProvider}
>
-
+
);
diff --git a/src/components/users.js b/src/components/users.js
new file mode 100644
index 0000000..068b59e
--- /dev/null
+++ b/src/components/users.js
@@ -0,0 +1,90 @@
+import React from "react";
+import {
+ Datagrid,
+ Create,
+ Edit,
+ List,
+ Filter,
+ SimpleForm,
+ BooleanField,
+ BooleanInput,
+ ImageField,
+ PasswordInput,
+ TextField,
+ TextInput,
+ ReferenceField,
+ regex,
+} from "react-admin";
+
+const UserFilter = props => (
+
+
+
+
+);
+
+export const UserList = props => (
+
}
+ filterDefaultValues={{ guests: true, deactivated: false }}
+ bulkActionButtons={false}
+ >
+
+
+
+
+
+ {/* Hack since the users endpoint does not give displaynames in the list*/}
+
+
+
+
+
+
+
+
+);
+
+// https://matrix.org/docs/spec/appendices#user-identifiers
+const validateUser = regex(
+ /^@[a-z0-9._=\-/]+:.*/,
+ "synapseadmin.users.invalid_user_id"
+);
+
+export const UserCreate = props => (
+
+
+
+
+
+
+
+
+);
+
+export const UserEdit = props => (
+
+
+
+
+
+
+
+
+
+);
diff --git a/src/i18n/de.js b/src/i18n/de.js
index 7ba3c22..6536802 100644
--- a/src/i18n/de.js
+++ b/src/i18n/de.js
@@ -7,5 +7,27 @@ export default {
homeserver: "Heimserver",
welcome: "Willkommen bei Synapse-admin",
},
+ users: {
+ invalid_user_id:
+ "Muss eine vollständige Matrix Benutzer-ID sein, z.B. @benutzer_id:homeserver",
+ },
+ },
+ resources: {
+ users: {
+ name: "Benutzer",
+ fields: {
+ avatar: "Avatar",
+ id: "Benutzer-ID",
+ name: "Name",
+ is_guest: "Gast",
+ admin: "Admin",
+ deactivated: "Deaktiviert",
+ guests: "Zeige Gäste",
+ show_deactivated: "Zeige deaktivierte Benutzer",
+ user_id: "Suche Benutzer",
+ displayname: "Anzeigename",
+ password: "Passwort",
+ },
+ },
},
};
diff --git a/src/i18n/en.js b/src/i18n/en.js
index 187af84..16adfd7 100644
--- a/src/i18n/en.js
+++ b/src/i18n/en.js
@@ -7,5 +7,27 @@ export default {
homeserver: "Homeserver",
welcome: "Welcome to Synapse-admin",
},
+ users: {
+ invalid_user_id:
+ "Must be a fully qualified Matrix user-id, e.g. @user_id:homeserver",
+ },
+ },
+ resources: {
+ users: {
+ name: "User |||| Users",
+ fields: {
+ avatar: "Avatar",
+ id: "User-ID",
+ name: "Name",
+ is_guest: "Guest",
+ admin: "Admin",
+ deactivated: "Deactivated",
+ guests: "Show guests",
+ show_deactivated: "Show deactivated users",
+ user_id: "Search user",
+ displayname: "Displayname",
+ password: "Password",
+ },
+ },
},
};