diff --git a/Core/Objects/Router/DocumentRoute.class.php b/Core/Objects/Router/DocumentRoute.class.php index b00cdd8..5739a5f 100644 --- a/Core/Objects/Router/DocumentRoute.class.php +++ b/Core/Objects/Router/DocumentRoute.class.php @@ -35,7 +35,7 @@ class DocumentRoute extends Route { public function preInsert(array &$row) { parent::preInsert($row); - $this->extra = json_encode($this->args); + $this->extra = json_encode($this->args, JSON_UNESCAPED_SLASHES); } #[Pure] private function getClassName(): string { diff --git a/react/admin-panel/src/views/log-view.js b/react/admin-panel/src/views/log-view.js index 2b328b5..97dd80d 100644 --- a/react/admin-panel/src/views/log-view.js +++ b/react/admin-panel/src/views/log-view.js @@ -9,6 +9,7 @@ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'; import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; import {API_DATETIME_FORMAT} from "shared/constants"; import {format, toDate} from "date-fns"; +import {Select} from "@material-ui/core"; export default function LogView(props) { @@ -59,6 +60,7 @@ export default function LogView(props) { const messageColumn = (() => { let column = new DataColumn(L("message"), "message"); + column.sortable = false; column.renderData = (L, entry) => { return
{entry.message}} @@ -93,11 +95,11 @@ export default function LogView(props) {
diff --git a/react/admin-panel/src/views/route/route-form.js b/react/admin-panel/src/views/route/route-form.js index 5187f2d..8c328a3 100644 --- a/react/admin-panel/src/views/route/route-form.js +++ b/react/admin-panel/src/views/route/route-form.js @@ -1,6 +1,6 @@ import {Box, Checkbox, FormControl, FormControlLabel, FormGroup, Select, styled, TextField} from "@material-ui/core"; import * as React from "react"; -import {useCallback, useContext} from "react"; +import {useCallback, useContext, useEffect, useRef} from "react"; import {LocaleContext} from "shared/locale"; const RouteFormControl = styled(FormControl)((props) => ({ @@ -16,6 +16,7 @@ export default function RouteForm(props) { const {route, setRoute} = props; const {translate: L} = useContext(LocaleContext); + const extraRef = useRef(); const onChangeRouteType = useCallback((type) => { let newRoute = {...route, type: type }; @@ -28,6 +29,13 @@ export default function RouteForm(props) { setRoute(newRoute); }, [route]); + useEffect(() => { + if (extraRef.current) { + const scrollHeight = extraRef.current.scrollHeight + 5; + extraRef.current.style.height = scrollHeight + "px"; + } + }, [extraRef?.current, route.extra]); + const elements = [@@ -48,7 +56,7 @@ export default function RouteForm(props) { , ]; + const minifyJson = (value) => { + try { + return JSON.stringify(JSON.parse(value)); + } catch (e) { + return value; + } + } + if (route.type) { elements.push( onChangeRouteType(e.target.value)}> + onChange={e => onChangeRouteType(e.target.value)} native> @@ -58,6 +66,14 @@ export default function RouteForm(props) { @@ -69,9 +85,11 @@ export default function RouteForm(props) { ); if (route.type === "dynamic") { - let extraArgs; + let extraArgs, type; try { - extraArgs = JSON.parse(route.extra) + extraArgs = JSON.parse(route.extra); + type = typeof extraArgs; + extraArgs = JSON.stringify(extraArgs, null, 2); } catch (e) { extraArgs = null } @@ -79,12 +97,13 @@ export default function RouteForm(props) { diff --git a/react/shared/hooks/pagination.js b/react/shared/hooks/pagination.js index a1093d8..bc675e2 100644 --- a/react/shared/hooks/pagination.js +++ b/react/shared/hooks/pagination.js @@ -60,13 +60,14 @@ class Pagination { return this.setPageSize(parseInt(e.target.value))} size={"small"} > - {options.map(size => )} + {options.map(size => )}