From 593604dfdcec7e800899ca8340669f6d1b80d13f Mon Sep 17 00:00:00 2001 From: Benson Wong Date: Sat, 5 Apr 2025 10:36:54 -0700 Subject: [PATCH] Show proxy and upstream logs in separate columns in logs UI --- proxy/html/logs.html | 263 +++++++++++++++++++++++++++++++------------ 1 file changed, 188 insertions(+), 75 deletions(-) diff --git a/proxy/html/logs.html b/proxy/html/logs.html index c9f82cc..2a4c33e 100644 --- a/proxy/html/logs.html +++ b/proxy/html/logs.html @@ -12,32 +12,65 @@ flex-direction: column; font-family: "Courier New", Courier, monospace; } - #log-controls { - margin: 0.5em; + .log-container { display: flex; - align-items: center; - justify-content: space-between; /* Spaces out elements evenly */ - } - #log-controls input { - flex: 1; - } - #log-controls input:focus { - outline: none; /* Ensures no outline is shown when the input is focused */ - } - #log-stream { flex: 1; + gap: 0.5em; margin: 0.5em; + min-height: 0; + } + .log-column { + display: flex; + flex-direction: column; + flex: 1; + min-width: 0; + transition: flex 0.3s ease; + } + .log-column.minimized { + flex: 0.1; + max-width: 50px; + border: 1px solid #777; + color: green; + } + .log-controls { + display: grid; + grid-template-columns: 1fr auto; + gap: 0.5em; + margin-bottom: 0.5em; + } + .log-controls input { + width: 100%; + padding: 4px; + } + .log-controls input:focus { + outline: none; + } + .log-stream { + flex: 1; padding: 1em; background: #f4f4f4; overflow-y: auto; - white-space: pre-wrap; /* Ensures line wrapping */ - word-wrap: break-word; /* Ensures long words wrap */ + white-space: pre-wrap; + word-wrap: break-word; + min-height: 0; } .regex-error { background-color: #ff0000 !important; } + /* Make headers clickable and show pointer cursor */ + h2 { + cursor: pointer; + user-select: none; + margin: 0 0 0.5em 0; + padding: 0.5em; + } + + h2:hover { + background-color: rgba(0, 0, 0, 0.05); + } + /* Dark mode styles */ @media (prefers-color-scheme: dark) { body { @@ -45,101 +78,181 @@ color: #fff; } - #log-stream { + .log-stream { background: #444; color: #fff; } - #log-controls input { + .log-controls input { background: #555; color: #fff; border: 1px solid #777; } - #log-controls button { + .log-controls button { background: #555; color: #fff; border: 1px solid #777; } + + h2:hover { + background-color: rgba(255, 255, 255, 0.1); + } + } + + /* Hide content when minimized */ + .log-column.minimized .log-controls, + .log-column.minimized .log-stream { + display: none; + } + + .log-column.minimized h2 { + writing-mode: vertical-rl; + text-orientation: mixed; + transform: rotate(180deg); + white-space: nowrap; + margin: auto; } -
Waiting for logs...
-
- - +
+
+

Proxy Logs

+
+ + +
+
Waiting for proxy logs...
+
+
+

Upstream Logs

+
+ + +
+
Waiting for upstream logs...
+
\ No newline at end of file