1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00

refactor(docker/containers): migrate inspect view to react [EE-2190] (#11005)
Some checks failed
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:s390x platform:linux version:]) (push) Has been cancelled
/ triage (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
ci / build_manifests (push) Has been cancelled

This commit is contained in:
Chaim Lev-Ari 2024-04-11 19:07:58 +03:00 committed by GitHub
parent de473fc10e
commit 2100155ab5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 181 additions and 105 deletions

View file

@ -3,7 +3,7 @@ import { JsonView, defaultStyles } from 'react-json-view-lite';
import 'react-json-view-lite/dist/index.css';
import clsx from 'clsx';
import './JsonTree.css';
import styles from './JsonTree.module.css';
export function JsonTree({ style, ...props }: ComponentProps<typeof JsonView>) {
const currentStyle = getCurrentStyle(style);
@ -25,17 +25,20 @@ function getCurrentStyle(style: StyleProps | undefined): StyleProps {
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'),
container: styles.jsonTree,
booleanValue: styles.leafValue,
nullValue: styles.leafValue,
otherValue: styles.leafValue,
numberValue: styles.leafValue,
stringValue: styles.leafValue,
undefinedValue: styles.leafValue,
label: styles.key,
punctuation: styles.leafValue,
collapseIcon: clsx(defaultStyles.collapseIcon, styles.chevronIcon),
expandIcon: clsx(defaultStyles.expandIcon, styles.chevronIcon),
collapsedContent: clsx(
defaultStyles.collapsedContent,
styles.branchPreview
),
};
}