Merge branch 'master' into users_media
This commit is contained in:
commit
ab76faef20
@ -53,6 +53,8 @@ const App = () => (
|
|||||||
<Resource name="devices" />
|
<Resource name="devices" />
|
||||||
<Resource name="room_members" />
|
<Resource name="room_members" />
|
||||||
<Resource name="users_media" />
|
<Resource name="users_media" />
|
||||||
|
<Resource name="joined_rooms" />
|
||||||
|
<Resource name="pushers" />
|
||||||
<Resource name="servernotices" />
|
<Resource name="servernotices" />
|
||||||
</Admin>
|
</Admin>
|
||||||
);
|
);
|
||||||
|
@ -4,6 +4,7 @@ import {
|
|||||||
BooleanField,
|
BooleanField,
|
||||||
BulkDeleteWithConfirmButton,
|
BulkDeleteWithConfirmButton,
|
||||||
Datagrid,
|
Datagrid,
|
||||||
|
DeleteButton,
|
||||||
Filter,
|
Filter,
|
||||||
List,
|
List,
|
||||||
Pagination,
|
Pagination,
|
||||||
@ -15,6 +16,7 @@ import {
|
|||||||
Tab,
|
Tab,
|
||||||
TabbedShowLayout,
|
TabbedShowLayout,
|
||||||
TextField,
|
TextField,
|
||||||
|
TopToolbar,
|
||||||
useTranslate,
|
useTranslate,
|
||||||
} from "react-admin";
|
} from "react-admin";
|
||||||
import get from "lodash/get";
|
import get from "lodash/get";
|
||||||
@ -70,10 +72,26 @@ const RoomTitle = ({ record }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const RoomShowActions = ({ basePath, data, resource }) => {
|
||||||
|
const translate = useTranslate();
|
||||||
|
return (
|
||||||
|
<TopToolbar>
|
||||||
|
<DeleteButton
|
||||||
|
basePath={basePath}
|
||||||
|
record={data}
|
||||||
|
resource={resource}
|
||||||
|
undoable={false}
|
||||||
|
confirmTitle={translate("synapseadmin.rooms.delete.title")}
|
||||||
|
confirmContent={translate("synapseadmin.rooms.delete.message")}
|
||||||
|
/>
|
||||||
|
</TopToolbar>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const RoomShow = props => {
|
export const RoomShow = props => {
|
||||||
const translate = useTranslate();
|
const translate = useTranslate();
|
||||||
return (
|
return (
|
||||||
<Show {...props} title={<RoomTitle />}>
|
<Show {...props} actions={<RoomShowActions />} title={<RoomTitle />}>
|
||||||
<TabbedShowLayout>
|
<TabbedShowLayout>
|
||||||
<Tab label="synapseadmin.rooms.tabs.basic" icon={<ViewListIcon />}>
|
<Tab label="synapseadmin.rooms.tabs.basic" icon={<ViewListIcon />}>
|
||||||
<TextField source="room_id" />
|
<TextField source="room_id" />
|
||||||
|
@ -5,7 +5,9 @@ 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 PermMediaIcon from "@material-ui/icons/PermMedia";
|
import PermMediaIcon from "@material-ui/icons/PermMedia";
|
||||||
|
import ViewListIcon from "@material-ui/icons/ViewList";
|
||||||
import {
|
import {
|
||||||
ArrayInput,
|
ArrayInput,
|
||||||
ArrayField,
|
ArrayField,
|
||||||
@ -455,6 +457,61 @@ export const UserEdit = props => {
|
|||||||
</Datagrid>
|
</Datagrid>
|
||||||
</ReferenceManyField>
|
</ReferenceManyField>
|
||||||
</FormTab>
|
</FormTab>
|
||||||
|
|
||||||
|
<FormTab
|
||||||
|
label={translate("resources.rooms.name", { smart_count: 2 })}
|
||||||
|
icon={<ViewListIcon />}
|
||||||
|
path="rooms"
|
||||||
|
>
|
||||||
|
<ReferenceManyField
|
||||||
|
reference="joined_rooms"
|
||||||
|
target="user_id"
|
||||||
|
addLabel={false}
|
||||||
|
>
|
||||||
|
<Datagrid
|
||||||
|
style={{ width: "100%" }}
|
||||||
|
rowClick={(id, basePath, record) => "/rooms/" + id + "/show"}
|
||||||
|
>
|
||||||
|
<TextField
|
||||||
|
source="id"
|
||||||
|
sortable={false}
|
||||||
|
label="resources.rooms.fields.room_id"
|
||||||
|
/>
|
||||||
|
<ReferenceField
|
||||||
|
label="resources.rooms.fields.name"
|
||||||
|
source="id"
|
||||||
|
reference="rooms"
|
||||||
|
sortable={false}
|
||||||
|
link=""
|
||||||
|
>
|
||||||
|
<TextField source="name" sortable={false} />
|
||||||
|
</ReferenceField>
|
||||||
|
</Datagrid>
|
||||||
|
</ReferenceManyField>
|
||||||
|
</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>
|
||||||
);
|
);
|
||||||
|
@ -234,6 +234,18 @@ export default {
|
|||||||
safe_from_quarantine: "Geschützt vor Quarantäne",
|
safe_from_quarantine: "Geschützt vor Quarantäne",
|
||||||
created_ts: "Erstellt",
|
created_ts: "Erstellt",
|
||||||
last_access_ts: "Letzter Zugriff",
|
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: {
|
servernotices: {
|
||||||
|
@ -231,6 +231,18 @@ export default {
|
|||||||
safe_from_quarantine: "Safe from quarantine",
|
safe_from_quarantine: "Safe from quarantine",
|
||||||
created_ts: "Created",
|
created_ts: "Created",
|
||||||
last_access_ts: "Last access",
|
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: {
|
servernotices: {
|
||||||
|
@ -87,7 +87,9 @@ const resourceMap = {
|
|||||||
id: d.device_id,
|
id: d.device_id,
|
||||||
}),
|
}),
|
||||||
data: "devices",
|
data: "devices",
|
||||||
total: json => json.devices.length,
|
total: json => {
|
||||||
|
return json.total;
|
||||||
|
},
|
||||||
reference: id => ({
|
reference: id => ({
|
||||||
endpoint: `/_synapse/admin/v2/users/${id}/devices`,
|
endpoint: `/_synapse/admin/v2/users/${id}/devices`,
|
||||||
}),
|
}),
|
||||||
@ -111,7 +113,34 @@ const resourceMap = {
|
|||||||
endpoint: `/_synapse/admin/v1/rooms/${id}/members`,
|
endpoint: `/_synapse/admin/v1/rooms/${id}/members`,
|
||||||
}),
|
}),
|
||||||
data: "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: {
|
users_media: {
|
||||||
map: um => ({
|
map: um => ({
|
||||||
|
Loading…
Reference in New Issue
Block a user