fix: wire dashboard to central api, fix JS quote escaping

This commit is contained in:
root 2025-12-16 22:13:51 +00:00
parent 6c41a412c7
commit 843d1b199d

18
api.py
View file

@ -347,21 +347,21 @@ async function loadLost() {
var data = await res.json(); var data = await res.json();
var html = "<h2>lost builders (" + (data.total || 0) + ")</h2>"; var html = "<h2>lost builders (" + (data.total || 0) + ")</h2>";
html += "<p style=\"color:#c792ea;font-size:0.8em;margin-bottom:10px\">people who need to see that someone like them made it</p>"; html += '<p style=\"color:#c792ea;font-size:0.8em;margin-bottom:10px\">people who need to see that someone like them made it</p>';
if (!data.matches || data.matches.length === 0) { if (!data.matches || data.matches.length === 0) {
html += "<div class=\"meta\">no lost builders found</div>"; html += '<div class=\"meta\">no lost builders found</div>';
} }
for (var i = 0; i < (data.matches || []).length; i++) { for (var i = 0; i < (data.matches || []).length; i++) {
var m = data.matches[i]; var m = data.matches[i];
html += "<div class=\"card\">"; html += '<div class=\"card\">";
html += "<div class=\"card-hdr\"><span class=\"to\">LOST: " + m.lost_user + "</span><span class=\"score\">" + m.match_score + "</span></div>"; html += '<div class=\"card-hdr\"><span class=\"to\">LOST: " + m.lost_user + "</span><span class=\"score\">" + m.match_score + "</span></div>';
html += "<div class=\"meta\">lost: " + m.lost_score + " | values: " + m.values_score + "</div>"; html += '<div class=\"meta\">lost: " + m.lost_score + " | values: " + m.values_score + "</div>';
html += "<div class=\"meta\" style=\"color:#0f8\">BUILDER: " + m.builder + " (" + m.builder_platform + ")</div>"; html += '<div class=\"meta\" style=\"color:#0f8\">BUILDER: " + m.builder + " (" + m.builder_platform + ")</div>';
html += "<div class=\"meta\">score: " + m.builder_score + " | repos: " + m.builder_repos + " | stars: " + m.builder_stars + "</div>"; html += '<div class=\"meta\">score: " + m.builder_score + " | repos: " + m.builder_repos + " | stars: " + m.builder_stars + "</div>';
html += "<div class=\"meta\">shared: " + (m.shared || []).join(", ") + "</div>"; html += '<div class=\"meta\">shared: " + (m.shared || []).join(", ") + "</div>';
html += "</div>"; html += '</div>';
} }
$("lost").innerHTML = html; $("lost").innerHTML = html;