Add a new tab to user page with pushers
This commit is contained in:
parent
e5d2d895d9
commit
6a9e252791
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
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.18.0 for all functions to work as expected!
|
It needs at least Synapse v1.23.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://github.com/matrix-org/synapse/blob/develop/docs/admin_api/version_api.rst).
|
See also [Synapse version API](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/version_api.rst).
|
||||||
|
@ -44,6 +44,7 @@ const App = () => (
|
|||||||
<Resource name="connections" />
|
<Resource name="connections" />
|
||||||
<Resource name="devices" />
|
<Resource name="devices" />
|
||||||
<Resource name="room_members" />
|
<Resource name="room_members" />
|
||||||
|
<Resource name="pushers" />
|
||||||
<Resource name="servernotices" />
|
<Resource name="servernotices" />
|
||||||
</Admin>
|
</Admin>
|
||||||
);
|
);
|
||||||
|
@ -5,6 +5,7 @@ import ContactMailIcon from "@material-ui/icons/ContactMail";
|
|||||||
import DevicesIcon from "@material-ui/icons/Devices";
|
import DevicesIcon from "@material-ui/icons/Devices";
|
||||||
import GetAppIcon from "@material-ui/icons/GetApp";
|
import GetAppIcon from "@material-ui/icons/GetApp";
|
||||||
import SettingsInputComponentIcon from "@material-ui/icons/SettingsInputComponent";
|
import SettingsInputComponentIcon from "@material-ui/icons/SettingsInputComponent";
|
||||||
|
import NotificationsIcon from "@material-ui/icons/Notifications";
|
||||||
import {
|
import {
|
||||||
ArrayInput,
|
ArrayInput,
|
||||||
ArrayField,
|
ArrayField,
|
||||||
@ -312,6 +313,7 @@ export const UserEdit = props => {
|
|||||||
/>
|
/>
|
||||||
<TextField source="consent_version" />
|
<TextField source="consent_version" />
|
||||||
</FormTab>
|
</FormTab>
|
||||||
|
|
||||||
<FormTab
|
<FormTab
|
||||||
label="resources.users.threepid"
|
label="resources.users.threepid"
|
||||||
icon={<ContactMailIcon />}
|
icon={<ContactMailIcon />}
|
||||||
@ -330,6 +332,7 @@ export const UserEdit = props => {
|
|||||||
</SimpleFormIterator>
|
</SimpleFormIterator>
|
||||||
</ArrayInput>
|
</ArrayInput>
|
||||||
</FormTab>
|
</FormTab>
|
||||||
|
|
||||||
<FormTab
|
<FormTab
|
||||||
label={translate("resources.devices.name", { smart_count: 2 })}
|
label={translate("resources.devices.name", { smart_count: 2 })}
|
||||||
icon={<DevicesIcon />}
|
icon={<DevicesIcon />}
|
||||||
@ -361,6 +364,7 @@ export const UserEdit = props => {
|
|||||||
</Datagrid>
|
</Datagrid>
|
||||||
</ReferenceManyField>
|
</ReferenceManyField>
|
||||||
</FormTab>
|
</FormTab>
|
||||||
|
|
||||||
<FormTab
|
<FormTab
|
||||||
label="resources.connections.name"
|
label="resources.connections.name"
|
||||||
icon={<SettingsInputComponentIcon />}
|
icon={<SettingsInputComponentIcon />}
|
||||||
@ -400,6 +404,29 @@ export const UserEdit = props => {
|
|||||||
</ArrayField>
|
</ArrayField>
|
||||||
</ReferenceField>
|
</ReferenceField>
|
||||||
</FormTab>
|
</FormTab>
|
||||||
|
|
||||||
|
<FormTab
|
||||||
|
label={translate("resources.pushers.name", { smart_count: 2 })}
|
||||||
|
icon={<NotificationsIcon />}
|
||||||
|
path="pushers"
|
||||||
|
>
|
||||||
|
<ReferenceManyField
|
||||||
|
reference="pushers"
|
||||||
|
target="user_id"
|
||||||
|
addLabel={false}
|
||||||
|
>
|
||||||
|
<Datagrid style={{ width: "100%" }}>
|
||||||
|
<TextField source="kind" sortable={false} />
|
||||||
|
<TextField source="app_display_name" sortable={false} />
|
||||||
|
<TextField source="app_id" sortable={false} />
|
||||||
|
<TextField source="data.url" sortable={false} />
|
||||||
|
<TextField source="device_display_name" sortable={false} />
|
||||||
|
<TextField source="lang" sortable={false} />
|
||||||
|
<TextField source="profile_tag" sortable={false} />
|
||||||
|
<TextField source="pushkey" sortable={false} />
|
||||||
|
</Datagrid>
|
||||||
|
</ReferenceManyField>
|
||||||
|
</FormTab>
|
||||||
</TabbedForm>
|
</TabbedForm>
|
||||||
</Edit>
|
</Edit>
|
||||||
);
|
);
|
||||||
|
@ -195,6 +195,20 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
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: {
|
servernotices: {
|
||||||
name: "Serverbenachrichtigungen",
|
name: "Serverbenachrichtigungen",
|
||||||
send: "Servernachricht versenden",
|
send: "Servernachricht versenden",
|
||||||
|
@ -193,6 +193,20 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
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: {
|
servernotices: {
|
||||||
name: "Server Notices",
|
name: "Server Notices",
|
||||||
send: "Send server notices",
|
send: "Send server notices",
|
||||||
|
@ -102,6 +102,15 @@ const resourceMap = {
|
|||||||
}),
|
}),
|
||||||
data: "members",
|
data: "members",
|
||||||
},
|
},
|
||||||
|
pushers: {
|
||||||
|
map: p => ({
|
||||||
|
...p,
|
||||||
|
}),
|
||||||
|
reference: id => ({
|
||||||
|
endpoint: `/_synapse/admin/v1/users/${id}/pushers`,
|
||||||
|
}),
|
||||||
|
data: "pushers",
|
||||||
|
},
|
||||||
servernotices: {
|
servernotices: {
|
||||||
map: n => ({ id: n.event_id }),
|
map: n => ({ id: n.event_id }),
|
||||||
create: data => ({
|
create: data => ({
|
||||||
|
Loading…
Reference in New Issue
Block a user