Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vite-app/dist/assets/index-34WaHH5W.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion vite-app/dist/assets/index-DpYZaoAr.css

This file was deleted.

4 changes: 2 additions & 2 deletions vite-app/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>EP | Log Viewer</title>
<link rel="icon" href="/assets/favicon-BkAAWQga.png" />
<script type="module" crossorigin src="/assets/index-C81y9r9l.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DpYZaoAr.css">
<script type="module" crossorigin src="/assets/index-DOPsfOMT.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-34WaHH5W.css">
</head>
<body>
<div id="root"></div>
Expand Down
15 changes: 13 additions & 2 deletions vite-app/src/components/LogsSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { observer } from "mobx-react";
import { useState, useEffect } from "react";
import { useState, useEffect, useRef } from "react";
import {
LogsResponseSchema,
type LogEntry,
Expand All @@ -18,6 +18,7 @@ export const LogsSection = observer(({ rolloutId }: LogsSectionProps) => {
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
const [selectedLevel, setSelectedLevel] = useState<string>("");
const scrollContainerRef = useRef<HTMLDivElement | null>(null);

const fetchLogs = async (isInitialLoad = false) => {
if (!rolloutId) return;
Expand Down Expand Up @@ -114,6 +115,13 @@ export const LogsSection = observer(({ rolloutId }: LogsSectionProps) => {
}
}, [rolloutId, selectedLevel]);

// Auto-scroll to bottom whenever logs update
useEffect(() => {
const el = scrollContainerRef.current;
if (!el) return;
el.scrollTo({ top: el.scrollHeight, behavior: "smooth" });
}, [logs]);

if (!rolloutId) {
return null;
}
Expand Down Expand Up @@ -160,7 +168,10 @@ export const LogsSection = observer(({ rolloutId }: LogsSectionProps) => {
)}

{logs.length > 0 && (
<div className="max-h-[800px] min-h-4 overflow-auto border border-gray-200">
<div
ref={scrollContainerRef}
className="max-h-[800px] min-h-4 overflow-auto border border-gray-200"
>
<div>
{logs.map((log, index) => (
<div
Expand Down
Loading