forked from Eshajha19/Algo-Infinity-Verse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecution-history.html
More file actions
256 lines (247 loc) · 11.3 KB
/
Copy pathexecution-history.html
File metadata and controls
256 lines (247 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Execution History — Algo Infinity Verse</title>
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#38bdf8" />
<link rel="stylesheet" href="styles.css" />
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Poppins:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
<script src="theme.js"></script>
<script type="importmap">
{
"imports": {
"firebase/app": "https://www.gstatic.com/firebasejs/11.6.0/firebase-app.js",
"firebase/auth": "https://www.gstatic.com/firebasejs/11.6.0/firebase-auth.js"
}
}
</script>
<style>
.exec-history-container {
max-width: 1200px;
margin: 2rem auto;
padding: 0 1rem;
}
.exec-header h1 {
font-family: 'Orbitron', monospace;
font-size: 1.5rem;
margin-bottom: 1rem;
display: flex;
align-items: center;
gap: 0.6rem;
}
.exec-filters {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
align-items: center;
margin-bottom: 1.5rem;
}
.exec-filter-select, .exec-filter-date {
padding: 0.45rem 0.7rem;
border: 1px solid var(--border-color, #334155);
border-radius: 6px;
background: var(--card-bg, #1e293b);
color: var(--text-primary, #e2e8f0);
font-size: 0.875rem;
}
.exec-btn {
padding: 0.45rem 1rem;
border: 1px solid var(--border-color, #334155);
border-radius: 6px;
background: var(--card-bg, #1e293b);
color: var(--text-primary, #e2e8f0);
cursor: pointer;
font-size: 0.875rem;
transition: all 0.2s;
display: inline-flex;
align-items: center;
gap: 0.4rem;
}
.exec-btn:hover { opacity: 0.85; border-color: var(--accent, #38bdf8); }
.exec-btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.exec-btn-primary { background: var(--accent, #38bdf8); color: #0f172a; border-color: var(--accent, #38bdf8); }
.exec-btn-ghost { background: transparent; border-color: transparent; }
.exec-btn-ghost:hover { background: var(--card-bg, #1e293b); border-color: var(--border-color, #334155); }
.exec-loading { text-align: center; padding: 3rem; color: var(--text-secondary, #94a3b8); }
.exec-empty { text-align: center; padding: 3rem; color: var(--text-secondary, #94a3b8); }
.exec-empty i { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.exec-count { font-size: 0.85rem; color: var(--text-secondary, #94a3b8); margin-bottom: 0.75rem; }
.exec-cards { display: grid; gap: 0.75rem; }
.exec-card {
background: var(--card-bg, #1e293b);
border: 1px solid var(--border-color, #334155);
border-radius: 8px;
padding: 0.85rem 1rem;
cursor: pointer;
transition: all 0.2s;
}
.exec-card:hover { border-color: var(--accent, #38bdf8); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.exec-card:focus-visible { outline: 2px solid var(--accent, #38bdf8); outline-offset: 2px; }
.exec-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.exec-card-lang { font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 0.4rem; }
.exec-card-status { font-size: 0.7rem; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 600; }
.exec-status-success { background: rgba(34,197,94,0.15); color: #22c55e; }
.exec-status-error { background: rgba(239,68,68,0.15); color: #ef4444; }
.exec-card-body { margin-bottom: 0.5rem; }
.exec-card-preview {
font-family: 'Fira Code', monospace;
font-size: 0.75rem;
color: var(--text-secondary, #94a3b8);
overflow: hidden;
max-height: 2.4em;
line-height: 1.2;
margin: 0;
white-space: pre-wrap;
}
.exec-card-preview code { background: none; padding: 0; }
.exec-card-footer { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--text-secondary, #94a3b8); }
.exec-card-trace { color: var(--accent, #38bdf8); }
.exec-replay-layout { display: flex; flex-direction: column; gap: 0; }
.exec-replay-toolbar {
display: flex; align-items: center; gap: 1rem;
padding: 0.75rem 0; border-bottom: 1px solid var(--border-color, #334155);
margin-bottom: 1rem; flex-wrap: wrap;
}
.exec-replay-title { font-weight: 600; flex: 1; display: flex; align-items: center; gap: 0.5rem; }
.exec-replay-stats { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-secondary, #94a3b8); }
.exec-replay-main { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; }
@media (max-width: 900px) { .exec-replay-main { grid-template-columns: 1fr; } }
.exec-replay-code-panel {
background: var(--card-bg, #1e293b);
border: 1px solid var(--border-color, #334155);
border-radius: 8px; overflow: hidden;
display: flex; flex-direction: column;
}
.exec-replay-panel-header {
display: flex; justify-content: space-between; align-items: center;
padding: 0.55rem 0.85rem;
background: var(--bg-secondary, #0f172a);
border-bottom: 1px solid var(--border-color, #334155);
font-size: 0.8rem; font-weight: 600;
}
.exec-code-display { overflow: auto; max-height: 70vh; flex: 1; }
.exec-code-table { width: 100%; border-collapse: collapse; font-family: 'Fira Code', monospace; font-size: 0.8rem; }
.exec-code-line { transition: background 0.15s; }
.exec-line-num {
width: 3rem; text-align: right; padding: 0.1rem 0.6rem;
color: var(--text-secondary, #475569); user-select: none;
border-right: 1px solid var(--border-color, #1e293b);
vertical-align: top;
}
.exec-line-code { padding: 0.1rem 0.75rem; white-space: pre-wrap; }
.exec-line-code pre { margin: 0; background: none; padding: 0; }
.exec-line-code code { background: none; padding: 0; }
.exec-line-active { background: rgba(56,189,248,0.1); }
.exec-line-active .exec-line-num { color: var(--accent, #38bdf8); font-weight: 700; background: rgba(56,189,248,0.08); }
.exec-line-executed .exec-line-num { color: var(--accent, #38bdf8); }
.exec-replay-controls {
display: flex; align-items: center; gap: 0.5rem;
padding: 0.6rem 0.85rem;
border-top: 1px solid var(--border-color, #334155);
background: var(--bg-secondary, #0f172a);
}
#replayStepCounter { flex: 1; text-align: center; font-size: 0.8rem; color: var(--text-secondary, #94a3b8); }
.exec-replay-sidebar { display: flex; flex-direction: column; gap: 0; }
.exec-vars-panel, .exec-output-panel {
background: var(--card-bg, #1e293b);
border: 1px solid var(--border-color, #334155);
border-radius: 0 0 8px 8px;
padding: 0.75rem;
max-height: 35vh;
overflow: auto;
font-family: 'Fira Code', monospace;
font-size: 0.78rem;
}
.exec-output-panel { max-height: 25vh; }
.exec-output-panel pre { margin: 0; background: none; padding: 0; white-space: pre-wrap; }
.exec-stderr { color: #ef4444; }
.exec-vars-empty { color: var(--text-secondary, #94a3b8); font-size: 0.8rem; padding: 0.5rem 0; }
.exec-vars-step { font-size: 0.75rem; color: var(--text-secondary, #94a3b8); margin-bottom: 0.5rem; }
.exec-vars-list { display: flex; flex-direction: column; gap: 0.3rem; }
.exec-var-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0; border-bottom: 1px solid var(--border-color, #1e293b); }
.exec-var-item:last-child { border-bottom: none; }
.exec-var-name { font-weight: 600; color: #38bdf8; }
.exec-var-eq { color: var(--text-secondary, #64748b); }
.exec-var-value { color: #a78bfa; word-break: break-all; }
.exec-val-null { color: #94a3b8; font-style: italic; }
.exec-val-undefined { color: #94a3b8; font-style: italic; }
.exec-val-bool { color: #f472b6; }
.exec-val-number { color: #fbbf24; }
.exec-val-string { color: #34d399; }
.exec-trace-badge { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 4px; background: rgba(56,189,248,0.1); }
.exec-trace-badge.has-trace { background: rgba(34,197,94,0.15); color: #22c55e; }
.light-mode .exec-filter-select, .light-mode .exec-filter-date,
.light-mode .exec-card, .light-mode .exec-replay-code-panel,
.light-mode .exec-vars-panel, .light-mode .exec-output-panel {
background: #ffffff;
border-color: #e2e8f0;
}
.light-mode .exec-replay-panel-header { background: #f8fafc; border-color: #e2e8f0; }
.light-mode .exec-replay-controls { background: #f8fafc; border-color: #e2e8f0; }
.light-mode .exec-line-active { background: rgba(56,189,248,0.08); }
.light-mode .exec-line-active .exec-line-num { background: rgba(56,189,248,0.06); }
.light-mode .exec-line-num { border-right-color: #e2e8f0; }
.light-mode .exec-code-line { border-color: #f1f5f9; }
.light-mode .exec-header h1 { color: #0f172a; }
.page-header {
padding: 6rem 2rem 0.5rem !important;
}
.page-header .section-subtitle {
margin-bottom: 0;
}
.page-header + .exec-history-container {
margin-top: 0;
}
.exec-filters {
justify-content: center;
margin-bottom: 0;
}
</style>
</head>
<body>
<div id="navbar"></div>
<main id="app">
<header class="section page-header">
<div class="container">
<h1 class="section-title">
<span class="title-icon"><i class="fas fa-history"></i></span>
Execution History
</h1>
<p class="section-subtitle">Browse your past code runs, inspect outputs, and replay step-by-step variable traces.</p>
</div>
</header>
<div class="exec-history-container" id="execHistoryRoot">
<div class="exec-loading"><i class="fas fa-spinner fa-spin"></i> Loading...</div>
</div>
</main>
<div id="footer"></div>
<script src="auth.js"></script>
<script src="auth-gate.js"></script>
<script type="module">
import { initNavbar } from "/modules/navbar.js";
import { ExecutionHistory } from "/modules/executionHistory.js";
async function loadPartial(id, url) {
try {
const res = await fetch(url);
if (!res.ok) throw new Error("Not found");
const html = await res.text();
document.getElementById(id).innerHTML = html;
} catch {
console.warn("Failed to load", url);
}
}
await Promise.all([
loadPartial("navbar", "/partials/navbar.html"),
loadPartial("footer", "/partials/footer.html"),
]);
initNavbar();
const root = document.getElementById("execHistoryRoot");
if (root) {
new ExecutionHistory(root);
}
</script>
</body>
</html>