diff --git a/src/App.js b/src/App.js index f305d0b..d5c9bfd 100644 --- a/src/App.js +++ b/src/App.js @@ -53,6 +53,8 @@ const App = () => ( + + ); diff --git a/src/components/rooms.js b/src/components/rooms.js index 041f0a6..efef5cb 100644 --- a/src/components/rooms.js +++ b/src/components/rooms.js @@ -4,6 +4,7 @@ import { BooleanField, BulkDeleteWithConfirmButton, Datagrid, + DeleteButton, Filter, List, Pagination, @@ -15,6 +16,7 @@ import { Tab, TabbedShowLayout, TextField, + TopToolbar, useTranslate, } from "react-admin"; import get from "lodash/get"; @@ -70,10 +72,26 @@ const RoomTitle = ({ record }) => { ); }; +const RoomShowActions = ({ basePath, data, resource }) => { + const translate = useTranslate(); + return ( + + + + ); +}; + export const RoomShow = props => { const translate = useTranslate(); return ( - }> + } title={}> }> diff --git a/src/components/users.js b/src/components/users.js index 609de70..e66eb44 100644 --- a/src/components/users.js +++ b/src/components/users.js @@ -5,7 +5,9 @@ import ContactMailIcon from "@material-ui/icons/ContactMail"; import DevicesIcon from "@material-ui/icons/Devices"; import GetAppIcon from "@material-ui/icons/GetApp"; import SettingsInputComponentIcon from "@material-ui/icons/SettingsInputComponent"; +import NotificationsIcon from "@material-ui/icons/Notifications"; import PermMediaIcon from "@material-ui/icons/PermMedia"; +import ViewListIcon from "@material-ui/icons/ViewList"; import { ArrayInput, ArrayField, @@ -455,6 +457,61 @@ export const UserEdit = props => { + + } + path="rooms" + > + + "/rooms/" + id + "/show"} + > + + + + + + + + + } + path="pushers" + > + + + + + + + + + + + + + ); diff --git a/src/i18n/de.js b/src/i18n/de.js index e780b8e..8acb992 100644 --- a/src/i18n/de.js +++ b/src/i18n/de.js @@ -234,6 +234,18 @@ export default { safe_from_quarantine: "Geschützt vor Quarantäne", created_ts: "Erstellt", last_access_ts: "Letzter Zugriff", + pushers: { + name: "Pusher |||| Pushers", + fields: { + app: "App", + app_display_name: "App-Anzeigename", + app_id: "App ID", + device_display_name: "Geräte-Anzeigename", + kind: "Art", + lang: "Sprache", + profile_tag: "Profil-Tag", + pushkey: "Pushkey", + data: { url: "URL" }, }, }, servernotices: { diff --git a/src/i18n/en.js b/src/i18n/en.js index 591bfbc..f04bf5d 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -231,6 +231,18 @@ export default { safe_from_quarantine: "Safe from quarantine", created_ts: "Created", last_access_ts: "Last access", + pushers: { + name: "Pusher |||| Pushers", + fields: { + app: "App", + app_display_name: "App display name", + app_id: "App ID", + device_display_name: "Device display name", + kind: "Kind", + lang: "Language", + profile_tag: "Profile tag", + pushkey: "Pushkey", + data: { url: "URL" }, }, }, servernotices: { diff --git a/src/synapse/dataProvider.js b/src/synapse/dataProvider.js index f41500a..2a664c4 100644 --- a/src/synapse/dataProvider.js +++ b/src/synapse/dataProvider.js @@ -87,7 +87,9 @@ const resourceMap = { id: d.device_id, }), data: "devices", - total: json => json.devices.length, + total: json => { + return json.total; + }, reference: id => ({ endpoint: `/_synapse/admin/v2/users/${id}/devices`, }), @@ -111,7 +113,34 @@ const resourceMap = { endpoint: `/_synapse/admin/v1/rooms/${id}/members`, }), data: "members", - total: json => json.members.length, + total: json => { + return json.total; + }, + }, + pushers: { + map: p => ({ + ...p, + id: p.pushkey, + }), + reference: id => ({ + endpoint: `/_synapse/admin/v1/users/${id}/pushers`, + }), + data: "pushers", + total: json => { + return json.total; + }, + }, + joined_rooms: { + map: jr => ({ + id: jr, + }), + reference: id => ({ + endpoint: `/_synapse/admin/v1/users/${id}/joined_rooms`, + }), + data: "joined_rooms", + total: json => { + return json.total; + }, }, users_media: { map: um => ({