fix: logs bug where it was repeating due to flaw in most recent id query

This commit is contained in:
HRG @ SCExC 2025-01-09 15:59:21 -05:00
parent 7a5a1a5e9d
commit 38b9c0e538
4 changed files with 36 additions and 31 deletions

View file

@ -1,6 +1,6 @@
<div hx-swap="outerHTML" hx-get="/workshop/<%= it.structId %>/route/<%= it.routeId %>/logs?since=<%= it.since || 0 %>" hx-trigger="every 2s" class="hidden"></div>
<% it.logs.forEach((log) => { %>
<div class="<% if (log.error) { %>bg-red-800 text-white <% } %>">
<!-- <div class="<% if (log.error) { %>bg-red-800 text-white <% } %>"> -->
<%= log.content %>
</div>
<!-- </div> -->
<% }) %>
<div hx-swap="outerHTML" hx-get="/workshop/<%= it.structId %>/route/<%= it.routeId %>/logs?since=<%= it.since || 0 %>" hx-trigger="every 5s" class="hidden"></div>

View file

@ -22,8 +22,7 @@
<button id="save-btn" type="submit">Save</button>
<button id="save-btn" type="submit" _="on click toggle .hidden on #logs">Logs</button>
</div>
<pre id="logs" class="max-h-[50vh] overflow-scroll hidden">
<ul hx-get="/workshop/<%= it.structure.id %>/route/<%= it.route.id %>/logs" hx-trigger="load" class="flex flex-col-reverse"></ul>
<pre id="logs" class="max-h-[50vh] overflow-scroll flex hidden" hx-get="/workshop/<%= it.structure.id %>/route/<%= it.route.id %>/logs" hx-trigger="load">
</pre>
</div>
<div id="preview-area" class="w-1/2 h-full flex flex-col">