mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
refactor(activity-logs): migrate activity logs table to react [EE-4714] (#10891)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:s390x platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Waiting to run
ci / build_images (map[arch:s390x platform:linux version:]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
This commit is contained in:
parent
960d18998f
commit
c22d280491
29 changed files with 659 additions and 429 deletions
41
app/react/components/JsonTree.tsx
Normal file
41
app/react/components/JsonTree.tsx
Normal file
|
@ -0,0 +1,41 @@
|
|||
import { ComponentProps } from 'react';
|
||||
import { JsonView, defaultStyles } from 'react-json-view-lite';
|
||||
import 'react-json-view-lite/dist/index.css';
|
||||
import clsx from 'clsx';
|
||||
|
||||
import './JsonTree.css';
|
||||
|
||||
export function JsonTree({ style, ...props }: ComponentProps<typeof JsonView>) {
|
||||
const currentStyle = getCurrentStyle(style);
|
||||
return (
|
||||
<JsonView
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
style={currentStyle}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type StyleProps = ComponentProps<typeof JsonView>['style'];
|
||||
|
||||
function getCurrentStyle(style: StyleProps | undefined): StyleProps {
|
||||
if (style) {
|
||||
return style;
|
||||
}
|
||||
|
||||
return {
|
||||
...defaultStyles,
|
||||
container: 'json-tree',
|
||||
booleanValue: 'leaf-value',
|
||||
nullValue: 'leaf-value',
|
||||
otherValue: 'leaf-value',
|
||||
numberValue: 'leaf-value',
|
||||
stringValue: 'leaf-value',
|
||||
undefinedValue: 'leaf-value',
|
||||
label: 'key',
|
||||
punctuation: 'leaf-value',
|
||||
collapseIcon: clsx(defaultStyles.collapseIcon, 'key'),
|
||||
expandIcon: clsx(defaultStyles.expandIcon, 'key'),
|
||||
collapsedContent: clsx(defaultStyles.collapsedContent, 'branch-preview'),
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue