mirror of
https://github.com/etkecc/synapse-admin.git
synced 2025-03-15 02:38:35 +03:00
Enable visual customization (#81)
* Enable visual customization * update readme
This commit is contained in:
parent
4f2cd38344
commit
abc922c956
8 changed files with 24 additions and 13 deletions
|
@ -70,6 +70,7 @@ The following changes are already implemented:
|
|||
* [Fix footer causing vertical scrollbar](https://github.com/etkecc/synapse-admin/pull/60)
|
||||
* [Custom Menu Items](https://github.com/etkecc/synapse-admin/pull/79)
|
||||
* [Add user profile to the top menu](https://github.com/etkecc/synapse-admin/pull/80)
|
||||
* [Enable visual customization](https://github.com/etkecc/synapse-admin/pull/81)
|
||||
|
||||
_the list will be updated as new changes are added_
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { AppBar, Confirm, Layout, Logout, Menu, useLogout, UserMenu } from "react-admin";
|
||||
import { AppBar, TitlePortal, InspectorButton, Confirm, Layout, Logout, Menu, useLogout, UserMenu } from "react-admin";
|
||||
import { LoginMethod } from "../pages/LoginPage";
|
||||
import { useEffect, useState, Suspense } from "react";
|
||||
import { Icons, DefaultIcon } from "./icons";
|
||||
|
@ -44,7 +44,12 @@ const AdminUserMenu = () => {
|
|||
);
|
||||
};
|
||||
|
||||
const AdminAppBar = () => <AppBar userMenu={<AdminUserMenu />} />;
|
||||
const AdminAppBar = () => {
|
||||
return (<AppBar userMenu={<AdminUserMenu />}>
|
||||
<TitlePortal />
|
||||
<InspectorButton />
|
||||
</AppBar>);
|
||||
};
|
||||
|
||||
const AdminMenu = (props) => {
|
||||
const [menu, setMenu] = useState([]);
|
||||
|
|
|
@ -13,7 +13,7 @@ const LoginFormBox = styled(Box)(({ theme }) => ({
|
|||
backgroundSize: "cover",
|
||||
|
||||
[`& .card`]: {
|
||||
width: "30rem",
|
||||
maxWidth: "30rem",
|
||||
marginTop: "6rem",
|
||||
marginBottom: "6rem",
|
||||
},
|
||||
|
|
|
@ -8,6 +8,7 @@ import ErrorIcon from '@mui/icons-material/Error';
|
|||
import {
|
||||
Button,
|
||||
Datagrid,
|
||||
DatagridConfigurable,
|
||||
DateField,
|
||||
List,
|
||||
ListProps,
|
||||
|
@ -123,14 +124,14 @@ export const DestinationList = (props: ListProps) => {
|
|||
pagination={<DestinationPagination />}
|
||||
sort={{ field: "destination", order: "ASC" }}
|
||||
>
|
||||
<Datagrid rowClick={id => `${id}/show/rooms`} bulkActionButtons={false}>
|
||||
<DatagridConfigurable rowClick={id => `${id}/show/rooms`} bulkActionButtons={false}>
|
||||
<FunctionField source="destination" render={destinationFieldRender} />
|
||||
<DateField source="failure_ts" showTime options={DATE_FORMAT} />
|
||||
<RetryDateField source="retry_last_ts" showTime options={DATE_FORMAT} />
|
||||
<TextField source="retry_interval" />
|
||||
<TextField source="last_successful_stream_ordering" />
|
||||
<DestinationReconnectButton />
|
||||
</Datagrid>
|
||||
</DatagridConfigurable>
|
||||
</List>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -4,6 +4,7 @@ import {
|
|||
Create,
|
||||
CreateProps,
|
||||
Datagrid,
|
||||
DatagridConfigurable,
|
||||
DateField,
|
||||
DateTimeInput,
|
||||
Edit,
|
||||
|
@ -39,13 +40,13 @@ export const RegistrationTokenList = (props: ListProps) => (
|
|||
pagination={false}
|
||||
perPage={500}
|
||||
>
|
||||
<Datagrid rowClick="edit">
|
||||
<DatagridConfigurable rowClick="edit">
|
||||
<TextField source="token" sortable={false} />
|
||||
<NumberField source="uses_allowed" sortable={false} />
|
||||
<NumberField source="pending" sortable={false} />
|
||||
<NumberField source="completed" sortable={false} />
|
||||
<DateField source="expiry_time" showTime options={DATE_FORMAT} sortable={false} />
|
||||
</Datagrid>
|
||||
</DatagridConfigurable>
|
||||
</List>
|
||||
);
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import ViewListIcon from "@mui/icons-material/ViewList";
|
|||
import ReportIcon from "@mui/icons-material/Warning";
|
||||
import {
|
||||
Datagrid,
|
||||
DatagridConfigurable,
|
||||
DateField,
|
||||
DeleteButton,
|
||||
List,
|
||||
|
@ -90,13 +91,13 @@ const ReportShowActions = () => {
|
|||
|
||||
export const ReportList = (props: ListProps) => (
|
||||
<List {...props} pagination={<ReportPagination />} sort={{ field: "received_ts", order: "DESC" }}>
|
||||
<Datagrid rowClick="show" bulkActionButtons={false}>
|
||||
<DatagridConfigurable rowClick="show" bulkActionButtons={false}>
|
||||
<TextField source="id" sortable={false} />
|
||||
<DateField source="received_ts" showTime options={DATE_FORMAT} sortable={true} />
|
||||
<TextField sortable={false} source="user_id" />
|
||||
<TextField sortable={false} source="name" />
|
||||
<TextField sortable={false} source="score" />
|
||||
</Datagrid>
|
||||
</DatagridConfigurable>
|
||||
</List>
|
||||
);
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import PermMediaIcon from "@mui/icons-material/PermMedia";
|
||||
import {
|
||||
Datagrid,
|
||||
DatagridConfigurable,
|
||||
ExportButton,
|
||||
List,
|
||||
ListProps,
|
||||
|
@ -37,12 +38,12 @@ export const UserMediaStatsList = (props: ListProps) => (
|
|||
pagination={<UserMediaStatsPagination />}
|
||||
sort={{ field: "media_length", order: "DESC" }}
|
||||
>
|
||||
<Datagrid rowClick={id => "/users/" + id + "/media"} bulkActionButtons={false}>
|
||||
<DatagridConfigurable rowClick={id => "/users/" + id + "/media"} bulkActionButtons={false}>
|
||||
<TextField source="user_id" label="resources.users.fields.id" />
|
||||
<TextField source="displayname" label="resources.users.fields.displayname" />
|
||||
<NumberField source="media_count" />
|
||||
<NumberField source="media_length" />
|
||||
</Datagrid>
|
||||
</DatagridConfigurable>
|
||||
</List>
|
||||
);
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import {
|
|||
ArrayField,
|
||||
Button,
|
||||
Datagrid,
|
||||
DatagridConfigurable,
|
||||
DateField,
|
||||
Create,
|
||||
CreateProps,
|
||||
|
@ -156,7 +157,7 @@ export const UserList = (props: ListProps) => (
|
|||
actions={<UserListActions />}
|
||||
pagination={<UserPagination />}
|
||||
>
|
||||
<Datagrid
|
||||
<DatagridConfigurable
|
||||
rowClick={(id: Identifier, resource: string) => `/${resource}/${id}`}
|
||||
bulkActionButtons={<UserBulkActionButtons />}
|
||||
>
|
||||
|
@ -169,7 +170,7 @@ export const UserList = (props: ListProps) => (
|
|||
<BooleanField source="locked" />
|
||||
<BooleanField source="erased" sortable={false} />
|
||||
<DateField source="creation_ts" label="resources.users.fields.creation_ts_ms" showTime options={DATE_FORMAT} />
|
||||
</Datagrid>
|
||||
</DatagridConfigurable>
|
||||
</List>
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue