From 60d52ee7c3fbf272ebac05779760bab75a6ad4ff Mon Sep 17 00:00:00 2001 From: Blake Burkhart Date: Fri, 1 Nov 2024 12:28:38 -0500 Subject: [PATCH 1/2] fix: prevent XSS in AnsiDisplay component (#397) Co-authored-by: UncleGedd <42304551+UncleGedd@users.noreply.github.com> --- ui/src/lib/components/AnsiDisplay/component.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/src/lib/components/AnsiDisplay/component.svelte b/ui/src/lib/components/AnsiDisplay/component.svelte index 5266691b7..99529df1f 100644 --- a/ui/src/lib/components/AnsiDisplay/component.svelte +++ b/ui/src/lib/components/AnsiDisplay/component.svelte @@ -9,6 +9,7 @@ const convert = new Convert({ newline: true, stream: true, + escapeXML: true, }) let termElement: HTMLElement | null let scrollAnchor: Element | null | undefined From 6ae1097a79678ba5187bbc39d114f2a2cdb0278e Mon Sep 17 00:00:00 2001 From: Tristan Holaday <40547442+TristanHoladay@users.noreply.github.com> Date: Fri, 1 Nov 2024 14:28:06 -0600 Subject: [PATCH 2/2] fix(ui): url updates from link clicks not showing current route in sidenav (#522) --- .../features/navigation/sidebar/component.svelte | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ui/src/lib/features/navigation/sidebar/component.svelte b/ui/src/lib/features/navigation/sidebar/component.svelte index c2705d0ef..706545950 100644 --- a/ui/src/lib/features/navigation/sidebar/component.svelte +++ b/ui/src/lib/features/navigation/sidebar/component.svelte @@ -43,6 +43,20 @@ return route }) } + + // If link was clicked, updating url, but path is a child route that is currently not renendered + // we need to toggle the submenu to show the child route + function updateOnLinkClicks(path: string) { + for (const route of routes) { + if (path.includes(route.path) && !toggleSubmenus[route.path]) { + toggleSubmenus[route.path] = true + } + } + } + + $: if ($page.url.pathname) { + updateOnLinkClicks($page.url.pathname) + }