From d870c047f9e7cd4c79a477ddb5a1e206aa25fc94 Mon Sep 17 00:00:00 2001 From: x032205 Date: Sat, 1 Nov 2025 04:34:32 -0400 Subject: [PATCH] animations and small tweaks --- .../components/PamSessionLogOutput.tsx | 7 +-- .../components/PamSessionLogsSection.tsx | 50 ++++++++++++------- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogOutput.tsx b/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogOutput.tsx index ba2f38057..a0cfb6cb9 100644 --- a/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogOutput.tsx +++ b/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogOutput.tsx @@ -1,6 +1,7 @@ -import { PamResourceType } from "@app/hooks/api/pam"; import { useState } from "react"; +import { PamResourceType } from "@app/hooks/api/pam"; + type TableLog = { command?: string; data_rows: Record[]; @@ -34,7 +35,7 @@ export const PamSessionLogOutput = ({ ) { parsedContent = parsed; } - } catch (error) { + } catch { // Not a valid JSON or doesn't match structure, will render as plain text } } @@ -69,7 +70,7 @@ export const PamSessionLogOutput = ({ className="border-b border-mineshaft-700 bg-mineshaft-900 last:border-b-0 hover:bg-mineshaft-800/50" > {headers.map((header) => ( - + {String(row[header] ?? "")} ))} diff --git a/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx b/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx index 413f379e2..b3c287380 100644 --- a/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx +++ b/frontend/src/pages/pam/PamSessionsByIDPage/components/PamSessionLogsSection.tsx @@ -1,8 +1,10 @@ import { useState } from "react"; -import { faChevronDown, faChevronRight } from "@fortawesome/free-solid-svg-icons"; +import { faChevronRight } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { twMerge } from "tailwind-merge"; import { TPamSession } from "@app/hooks/api/pam"; + import { PamSessionLogOutput } from "./PamSessionLogOutput"; import { formatLogContent } from "./PamSessionLogsSection.utils"; @@ -45,8 +47,11 @@ export const PamSessionLogsSection = ({ session }: Props) => {
{new Date(log.timestamp).toLocaleString()}
@@ -60,21 +65,30 @@ export const PamSessionLogsSection = ({ session }: Props) => { {formattedInput}
- {isExpanded && log.output && ( - <> -
-
- OUTPUT -
-
-
- -
- - )} +
+
+ {log.output && ( + <> +
+
+ OUTPUT +
+
+
+ +
+ + )} +
+
); })