From ff122a3ab2a45affded3e1b7fe318964e9e7e311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Goral?= Date: Wed, 9 Apr 2025 13:32:07 +0200 Subject: [PATCH 01/49] yaml --- package-lock.json | 13 +++++++++++++ package.json | 3 ++- src/lib/api/types/crate/controlPlanes.ts | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 4a42ddf2..be6809c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "react-router-dom": "^7.2.0", "react-time-ago": "^7.3.3", "swr": "^2.3.0", + "yaml": "^2.7.1", "zod": "^3.24.2" }, "devDependencies": { @@ -8844,6 +8845,18 @@ "dev": true, "license": "ISC" }, + "node_modules/yaml": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", + "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", diff --git a/package.json b/package.json index 2c7c2785..02e12ad7 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "react-router-dom": "^7.2.0", "react-time-ago": "^7.3.3", "swr": "^2.3.0", + "yaml": "^2.7.1", "zod": "^3.24.2" }, "devDependencies": { @@ -65,4 +66,4 @@ "typescript-eslint": "^8.26.1", "vite": "^6.2.4" } -} \ No newline at end of file +} diff --git a/src/lib/api/types/crate/controlPlanes.ts b/src/lib/api/types/crate/controlPlanes.ts index e31acc99..50ce9cc2 100644 --- a/src/lib/api/types/crate/controlPlanes.ts +++ b/src/lib/api/types/crate/controlPlanes.ts @@ -60,6 +60,7 @@ export const ListControlPlanes = ( projectName: string | null, workspaceName: string, ): Resource => { + console.log('CP2'); return { path: projectName === null @@ -74,6 +75,7 @@ export const ControlPlane = ( workspaceName: string, controlPlaneName: string, ): Resource => { + console.log('CP1'); return { path: `/apis/core.openmcp.cloud/v1alpha1/namespaces/project-${projectName}--ws-${workspaceName}/managedcontrolplanes/${controlPlaneName}`, jq: '{ spec: .spec | {components}, status: { conditions: [.status.conditions[] | {type: .type, status: .status, message: .message, reason: .reason, lastTransitionTime: .lastTransitionTime}], access: .status.components.authentication.access, status: .status.status }}', From a8469a29949f1fafba23e5dcbb0ccffe6e733c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Goral?= Date: Wed, 9 Apr 2025 15:00:49 +0200 Subject: [PATCH 02/49] initialize --- .../ControlPlaneCard/ControlPlaneCard.tsx | 5 +++- src/context/YamlView.tsx | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/context/YamlView.tsx diff --git a/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx b/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx index a2308b83..37d18ce1 100644 --- a/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx +++ b/src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx @@ -4,6 +4,7 @@ import '@ui5/webcomponents-fiori/dist/illustrations/EmptyList.js'; import '@ui5/webcomponents-icons/dist/delete'; import ConnectButton from '../ConnectButton.tsx'; import { ListWorkspacesType } from '../../../lib/api/types/crate/listWorkspaces.ts'; +import { stringify } from 'yaml'; import { ListControlPlanesType, ReadyStatus, @@ -22,6 +23,7 @@ import { DeleteConfirmationDialog } from '../../Dialogs/DeleteConfirmationDialog import MCPHealthPopoverButton from '../../ControlPlane/MCPHealthPopoverButton.tsx'; import styles from './ControlPlaneCard.module.css'; import { KubectlDeleteMcp } from '../../Dialogs/KubectlCommandInfo/Controllers/KubectlDeleteMcp.tsx'; +import { YamlView } from '../../../context/YamlView.tsx'; interface Props { controlPlane: ListControlPlanesType; @@ -51,7 +53,7 @@ export function ControlPlaneCard({ const name = controlPlane.metadata.name; const namespace = controlPlane.metadata.namespace; - + console.log(stringify(controlPlane)); return ( <> @@ -82,6 +84,7 @@ export function ControlPlaneCard({ className={styles.row} > + = ({ content }) => { + const [isOpen, setIsOpen] = useState(false); + + return ( + <> + +