mirror of
https://github.com/etkecc/synapse-admin.git
synced 2024-11-21 15:25:22 +03:00
Federation page improvements for dark mode and last_entry without a date (#19)
Federation page improvements This is almost a copy of https://github.com/Awesome-Technologies/synapse-admin/pull/583 PR, authored by @rkfg
This commit is contained in:
parent
cceae77529
commit
0bf3440fc8
3 changed files with 17 additions and 3 deletions
2
.github/workflows/workflow.yml
vendored
2
.github/workflows/workflow.yml
vendored
|
@ -4,7 +4,7 @@ on:
|
|||
branches: [ "main" ]
|
||||
env:
|
||||
upstream_version: v0.10.3
|
||||
etke_version: etke11
|
||||
etke_version: etke12
|
||||
bunny_version: v0.1.0
|
||||
base_path: ./
|
||||
permissions:
|
||||
|
|
|
@ -34,6 +34,7 @@ The following changes are already implemented:
|
|||
* [Display actual Synapse errors](https://github.com/etkecc/synapse-admin/pull/17)
|
||||
* [Fix base_url being undefined on unsuccessful login](https://github.com/etkecc/synapse-admin/pull/18)
|
||||
* [Put the version into manifest.json](https://github.com/Awesome-Technologies/synapse-admin/issues/507) (CI only)
|
||||
* [Federation page improvements](https://github.com/Awesome-Technologies/synapse-admin/pull/583) (using theme colors)
|
||||
|
||||
_the list will be updated as new changes are added_
|
||||
|
||||
|
|
|
@ -27,14 +27,19 @@ import {
|
|||
useNotify,
|
||||
useRefresh,
|
||||
useTranslate,
|
||||
DateFieldProps,
|
||||
} from "react-admin";
|
||||
|
||||
import { DATE_FORMAT } from "../components/date";
|
||||
import { get } from "lodash";
|
||||
|
||||
const DestinationPagination = () => <Pagination rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />;
|
||||
|
||||
const destinationRowSx = (record: RaRecord) => ({
|
||||
backgroundColor: record.retry_last_ts > 0 ? "#ffcccc" : "white",
|
||||
backgroundColor: record.retry_last_ts > 0 ? "warning.light" : "primary.contrastText",
|
||||
"& .MuiButtonBase-root": {
|
||||
color: "primary.dark",
|
||||
},
|
||||
});
|
||||
|
||||
const destinationFilters = [<SearchInput source="destination" alwaysOn />];
|
||||
|
@ -92,6 +97,14 @@ const DestinationTitle = () => {
|
|||
);
|
||||
};
|
||||
|
||||
const RetryDateField = (props: DateFieldProps) => {
|
||||
const record = useRecordContext(props);
|
||||
if (props.source && get(record, props.source) === 0) {
|
||||
return <DateField {...props} record={{ ...record, [props.source]: null }} />;
|
||||
}
|
||||
return <DateField {...props} />;
|
||||
};
|
||||
|
||||
export const DestinationList = (props: ListProps) => {
|
||||
return (
|
||||
<List
|
||||
|
@ -103,7 +116,7 @@ export const DestinationList = (props: ListProps) => {
|
|||
<Datagrid rowSx={destinationRowSx} rowClick={id => `${id}/show/rooms`} bulkActionButtons={false}>
|
||||
<TextField source="destination" />
|
||||
<DateField source="failure_ts" showTime options={DATE_FORMAT} />
|
||||
<DateField source="retry_last_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 />
|
||||
|
|
Loading…
Reference in a new issue