MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / loadLogContent

Function loadLogContent

codeclash/viewer/static/js/app.js:397–428  ·  view source on GitHub ↗
(logPath, container)

Source from the content-addressed store, hash-verified

395
396// Log loading functionality
397function loadLogContent(logPath, container) {
398 const placeholder = container.querySelector(".log-load-placeholder");
399 const spinner = container.querySelector(".log-loading-spinner");
400 const contentPre = container.querySelector(".log-content-scrollable");
401 const contentCode = container.querySelector(".log-content");
402
403 // Hide placeholder, show spinner
404 placeholder.style.display = "none";
405 spinner.style.display = "block";
406
407 // Fetch log content from server
408 fetch(`/load-log?path=${encodeURIComponent(logPath)}`)
409 .then((response) => response.json())
410 .then((data) => {
411 spinner.style.display = "none";
412
413 if (data.success) {
414 // Display the content
415 contentCode.textContent = data.content;
416 contentPre.style.display = "block";
417 } else {
418 // Show error message
419 contentCode.textContent = `Error loading log: ${data.error}`;
420 contentPre.style.display = "block";
421 }
422 })
423 .catch((error) => {
424 spinner.style.display = "none";
425 contentCode.textContent = `Error loading log: ${error}`;
426 contentPre.style.display = "block";
427 });
428}
429
430// Trajectory diffs loading functionality
431function loadTrajectoryDiffs(playerName, roundNum, button) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected