diff --git a/web/js/admin.js b/web/js/admin.js index a9ded6b..bec9dd4 100644 --- a/web/js/admin.js +++ b/web/js/admin.js @@ -621,7 +621,7 @@ ${escapeHtml(runLabel)} ` : ""}
-
+
${this.renderStars(rating, prompt.id)}
@@ -1636,7 +1636,7 @@ resultsContainer.innerHTML = `

❌ Maintenance Failed

-

${error.message}

+

${escapeHtml(error.message)}

`; this.showNotification('❌ Maintenance failed', 'error'); @@ -1658,7 +1658,7 @@ html += `
Operations Completed - ${data.operations_completed} + ${escapeHtml(data.operations_completed)}
`; html += ` @@ -1680,29 +1680,29 @@ html += `
`; html += `

`; html += `${statusIcon}`; - html += `${operation.replace(/_/g, ' ')}`; + html += `${escapeHtml(operation.replace(/_/g, ' '))}`; html += `${statusText}`; html += `

`; if (result.message) { - html += `

${result.message}

`; + html += `

${escapeHtml(result.message)}

`; } // Show specific details if (result.removed_count !== undefined) { - html += `
Items removed: ${result.removed_count}
`; + html += `
Items removed: ${escapeHtml(result.removed_count)}
`; } if (result.duplicate_hashes !== undefined) { - html += `
Duplicate hash groups found: ${result.duplicate_hashes}
`; + html += `
Duplicate hash groups found: ${escapeHtml(result.duplicate_hashes)}
`; } if (result.issues_found !== undefined) { - html += `
Issues found: ${result.issues_found}
`; + html += `
Issues found: ${escapeHtml(result.issues_found)}
`; if (result.issues && result.issues.length > 0) { html += ``; } @@ -1710,14 +1710,14 @@ if (result.info) { html += `
`; - html += `

Total prompts: ${result.info.total_prompts || 'N/A'}

`; - html += `

Database size: ${result.info.database_size_bytes ? this.formatFileSize(result.info.database_size_bytes) : 'N/A'}

`; + html += `

Total prompts: ${escapeHtml(result.info.total_prompts || 'N/A')}

`; + html += `

Database size: ${escapeHtml(result.info.database_size_bytes ? this.formatFileSize(result.info.database_size_bytes) : 'N/A')}

`; html += `
`; } if (result.error) { html += `
`; - html += `Error: ${result.error}`; + html += `Error: ${escapeHtml(result.error)}`; html += `
`; } @@ -1754,7 +1754,7 @@ content.innerHTML = `

❌ Diagnostics Failed

-

${error.message}

+

${escapeHtml(error.message)}

`; } @@ -1793,25 +1793,25 @@ html += `

${escapeHtml(category)}

`; if (result.message) { - html += `

${result.message}

`; + html += `

${escapeHtml(result.message)}

`; } // Show specific details based on category if (category === 'database' && result.status === 'ok') { html += `
`; - html += `

Prompts: ${result.prompt_count || 0}

`; + html += `

Prompts: ${escapeHtml(result.prompt_count || 0)}

`; html += `

Images table: ${result.has_images_table ? 'Yes' : 'No'}

`; html += `
`; } if (category === 'images_table' && result.status === 'ok') { html += `
`; - html += `

Images: ${result.image_count || 0}

`; + html += `

Images: ${escapeHtml(result.image_count || 0)}

`; if (result.recent_images && result.recent_images.length > 0) { html += `

Recent images:

`; html += `
    `; result.recent_images.slice(0, 3).forEach(img => { - html += `
  • ${img.filename} → Prompt ${img.prompt_id}
  • `; + html += `
  • ${escapeHtml(img.filename)} → Prompt ${escapeHtml(img.prompt_id)}
  • `; }); html += `
`; } @@ -1823,7 +1823,7 @@ html += `

Output directories found:

`; html += `
    `; result.output_dirs.forEach(dir => { - html += `
  • ${dir}
  • `; + html += `
  • ${escapeHtml(dir)}
  • `; }); html += `
`; html += `
`; @@ -2044,7 +2044,7 @@

Copy Prompt Text

Please manually copy the text below:

- +
- Type: ${fileExt} Video + Type: ${escapeHtml(fileExt)} Video
@@ -1094,7 +1094,7 @@ container.innerHTML = `

❌ Video Info Error

-

${error.message}

+

${escapeHtml(error.message)}

`; } @@ -1188,7 +1188,7 @@ container.innerHTML = `

❌ Metadata Error

-

${error.message}

+

${escapeHtml(error.message)}

`; } @@ -2152,10 +2152,10 @@ Seed: ${this.currentMetadata.seed || 'Unknown'}`; groupEl.innerHTML = `
- Duplicate Group ${groupIndex + 1} (${group.images.length} identical ${group.images[0].media_type}s) + Duplicate Group ${groupIndex + 1} (${group.images.length} identical ${escapeHtml(group.images[0].media_type)}s)
- Content Hash: ${group.hash.substring(0, 16)}... + Content Hash: ${escapeHtml(String(group.hash || '').substring(0, 16))}...
${group.images.map((image, imageIndex) => `