Skip to content

Commit 1d733fa

Browse files
authored
add debug button (#88)
* add debug button * move the "Show Logs" button
1 parent f1e9adb commit 1d733fa

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

static/index.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ input {
7171
margin-left: 10px;
7272
}
7373

74+
#debug-btn{
75+
height: 2.2em;
76+
background-color: orange;
77+
color: white;
78+
border: none;
79+
border-radius: 4px;
80+
padding: 8px 16px;
81+
cursor: pointer;
82+
margin-left: 10px;
83+
}
84+
7485
.card {
7586
background: hsla(0, 0%, 31%, 0.7);
7687
border-radius: 12px;

static/index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
</div>
1717
<div class="card">
1818
<div style="display: flex; justify-content: center; align-items: center; flex-direction: column;">
19-
<div style="display: flex; justify-content: center; align-items: center; padding-bottom: 10px;">
19+
<div style="display: flex; justify-content: center; align-items: center; padding-bottom: 5px;">
2020
<h2 id="cache_tag">SCE TV</h2>
21+
</div>
22+
<div style="display: flex; justify-content: center; align-items: center; padding-bottom: 10px;">
2123
<button id="show-logs-btn">Show Logs</button>
24+
<button id="debug-btn">Debug</button>
2225
</div>
2326
</div>
2427

@@ -250,6 +253,15 @@ <h2 id="title"></h2>
250253
// Scroll to bottom
251254
logsContent.scrollTop = logsContent.scrollHeight;
252255
}
256+
257+
// Adds a function to open the debug page in a new window when the debug button is clicked
258+
document.getElementById("debug-btn").addEventListener("click", function () {
259+
const debugURL = new URL(window.location.origin + window.location.pathname);
260+
debugURL.pathname = debugURL.pathname.endsWith('/')
261+
? `${debugURL.pathname}debug`
262+
: `${debugURL.pathname}/debug`;
263+
window.open(debugURL);
264+
});
253265
</script>
254266
</body>
255267

0 commit comments

Comments
 (0)