Spaces:
Sleeping
Sleeping
fix logging, show results
Browse files- static/index.html +22 -0
static/index.html
CHANGED
@@ -32,6 +32,17 @@
|
|
32 |
<input type="datetime-local" id="endTime">
|
33 |
<button onclick="filterLogs()">Filter Logs</button>
|
34 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
</div>
|
36 |
|
37 |
<script>
|
@@ -77,6 +88,8 @@
|
|
77 |
$('<td>').text(log.success ? 'Success' : 'Failure')
|
78 |
.css('color', log.success ? 'blue' : 'red')
|
79 |
.appendTo(row);
|
|
|
|
|
80 |
tbody.append(row);
|
81 |
});
|
82 |
});
|
@@ -98,7 +111,16 @@
|
|
98 |
updateLogs(model, startTime, endTime);
|
99 |
}
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
$(document).ready(function() {
|
|
|
102 |
updateCharts();
|
103 |
updateLogs();
|
104 |
updateModelSelect();
|
|
|
32 |
<input type="datetime-local" id="endTime">
|
33 |
<button onclick="filterLogs()">Filter Logs</button>
|
34 |
</div>
|
35 |
+
<table id="logTable">
|
36 |
+
<thead>
|
37 |
+
<tr>
|
38 |
+
<th>Timestamp</th>
|
39 |
+
<th>Model</th>
|
40 |
+
<th>Status</th>
|
41 |
+
</tr>
|
42 |
+
</thead>
|
43 |
+
<tbody>
|
44 |
+
</tbody>
|
45 |
+
</table>
|
46 |
</div>
|
47 |
|
48 |
<script>
|
|
|
88 |
$('<td>').text(log.success ? 'Success' : 'Failure')
|
89 |
.css('color', log.success ? 'blue' : 'red')
|
90 |
.appendTo(row);
|
91 |
+
$('<td>').text(log.failure_message || 'N/A').appendTo(row);
|
92 |
+
$('<td>').text(log.response_data ? JSON.stringify(log.response_data) : 'N/A').appendTo(row);
|
93 |
tbody.append(row);
|
94 |
});
|
95 |
});
|
|
|
111 |
updateLogs(model, startTime, endTime);
|
112 |
}
|
113 |
|
114 |
+
function setDefaultDates() {
|
115 |
+
const now = new Date();
|
116 |
+
const oneWeekAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
|
117 |
+
|
118 |
+
document.getElementById('endTime').value = now.toISOString().slice(0, 16);
|
119 |
+
document.getElementById('startTime').value = oneWeekAgo.toISOString().slice(0, 16);
|
120 |
+
}
|
121 |
+
|
122 |
$(document).ready(function() {
|
123 |
+
setDefaultDates();
|
124 |
updateCharts();
|
125 |
updateLogs();
|
126 |
updateModelSelect();
|