diff --git a/src/components/rooms.js b/src/components/rooms.js
index 8cac414..4c598b9 100644
--- a/src/components/rooms.js
+++ b/src/components/rooms.js
@@ -1,17 +1,68 @@
import React from "react";
-import { Datagrid, List, TextField, Pagination } from "react-admin";
+import {
+ Datagrid,
+ List,
+ TextField,
+ Pagination,
+ BooleanField,
+ useTranslate,
+} from "react-admin";
+import get from "lodash/get";
+import { Tooltip, Typography } from "@material-ui/core";
+import HttpsIcon from "@material-ui/icons/Https";
+import NoEncryptionIcon from "@material-ui/icons/NoEncryption";
const RoomPagination = props => (
);
+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 (
+
+
+ {value === true ? (
+
+ ) : (
+
+ )}
+
+
+ );
+ }
+
+ return (
+
+ {emptyText}
+
+ );
+};
+
export const RoomList = props => (
-
}>
+
}
+ sort={{ field: "name", order: "ASC" }}
+ >
-
+ }
+ />
+
+
+
+
+
+
);
diff --git a/src/i18n/de.js b/src/i18n/de.js
index b3dc31c..5266e19 100644
--- a/src/i18n/de.js
+++ b/src/i18n/de.js
@@ -56,6 +56,12 @@ export default {
name: "Name",
canonical_alias: "Alias",
joined_members: "Mitglieder",
+ joined_local_members: "lokale Mitglieder",
+ state_events: "Ereignisse",
+ version: "Version",
+ is_encrypted: "Verschlüsselt",
+ federatable: "Föderiert",
+ public: "Öffentlich",
},
},
connections: {
diff --git a/src/i18n/en.js b/src/i18n/en.js
index ff8a539..5a2469f 100644
--- a/src/i18n/en.js
+++ b/src/i18n/en.js
@@ -55,6 +55,12 @@ export default {
name: "Name",
canonical_alias: "Alias",
joined_members: "Members",
+ joined_local_members: "local members",
+ state_events: "State events",
+ version: "Version",
+ is_encrypted: "Encrypted",
+ federatable: "Federatable",
+ public: "Public",
},
},
connections: {
diff --git a/src/synapse/dataProvider.js b/src/synapse/dataProvider.js
index d3125c0..21748fd 100644
--- a/src/synapse/dataProvider.js
+++ b/src/synapse/dataProvider.js
@@ -50,6 +50,9 @@ const resourceMap = {
id: r.room_id,
alias: r.canonical_alias,
members: r.joined_members,
+ is_encrypted: !!r.encryption,
+ federatable: !!r.federatable,
+ public: !!r.public,
}),
data: "rooms",
total: json => {
@@ -88,11 +91,20 @@ function filterNullValues(key, value) {
return value;
}
+function getSearchOrder(order) {
+ if (order === "DESC") {
+ return "b";
+ } else {
+ return "f";
+ }
+}
+
const dataProvider = {
getList: (resource, params) => {
console.log("getList " + resource);
const { user_id, guests, deactivated } = params.filter;
const { page, perPage } = params.pagination;
+ const { field, order } = params.sort;
const from = (page - 1) * perPage;
const query = {
from: from,
@@ -100,6 +112,8 @@ const dataProvider = {
user_id: user_id,
guests: guests,
deactivated: deactivated,
+ order_by: field,
+ dir: getSearchOrder(order),
};
const homeserver = localStorage.getItem("base_url");
if (!homeserver || !(resource in resourceMap)) return Promise.reject();