yarn fix
This commit is contained in:
parent
b51882a5d8
commit
f5b56ee42f
@ -46,7 +46,7 @@ import {
|
||||
TopToolbar,
|
||||
sanitizeListRestProps,
|
||||
NumberField,
|
||||
ImageField
|
||||
ImageField,
|
||||
} from "react-admin";
|
||||
import { Link } from "react-router-dom";
|
||||
import { ServerNoticeButton, ServerNoticeBulkButton } from "./ServerNotices";
|
||||
@ -451,9 +451,10 @@ export const UserEdit = props => {
|
||||
perPage={50}
|
||||
sort={{ field: "created_ts", order: "DESC" }}
|
||||
>
|
||||
<Datagrid style={{ width: "100%" }}
|
||||
expand={ <ImageField source="url" /> }
|
||||
isRowExpandable={row => row.is_image }
|
||||
<Datagrid
|
||||
style={{ width: "100%" }}
|
||||
expand={<ImageField source="url" />}
|
||||
isRowExpandable={row => row.is_image}
|
||||
>
|
||||
<DateField source="created_ts" showTime options={date_format} />
|
||||
<DateField
|
||||
|
@ -27,7 +27,7 @@ const mxcUrlToHttp = mxcUrl => {
|
||||
|
||||
async function isImage(url) {
|
||||
const resp = await fetch(url, {
|
||||
method: "HEAD"
|
||||
method: "HEAD",
|
||||
});
|
||||
|
||||
const type = resp.headers.get("Content-Type");
|
||||
@ -170,8 +170,18 @@ const resourceMap = {
|
||||
map: async um => ({
|
||||
...um,
|
||||
id: um.media_id,
|
||||
url: `${localStorage.getItem("base_url")}/_matrix/media/v3/download/${localStorage.getItem("home_server")}/${um.media_id}`,
|
||||
is_image: await isImage(`${localStorage.getItem("base_url")}/_matrix/media/v3/download/${localStorage.getItem("home_server")}/${um.media_id}`)
|
||||
url: `${localStorage.getItem(
|
||||
"base_url"
|
||||
)}/_matrix/media/v3/download/${localStorage.getItem("home_server")}/${
|
||||
um.media_id
|
||||
}`,
|
||||
is_image: await isImage(
|
||||
`${localStorage.getItem(
|
||||
"base_url"
|
||||
)}/_matrix/media/v3/download/${localStorage.getItem("home_server")}/${
|
||||
um.media_id
|
||||
}`
|
||||
),
|
||||
}),
|
||||
reference: id => ({
|
||||
endpoint: `/_synapse/admin/v1/users/${id}/media`,
|
||||
@ -416,7 +426,7 @@ const dataProvider = {
|
||||
return {
|
||||
data: data,
|
||||
total: res.total(json, from, perPage),
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user