diff --git a/src/pyob/pyob_dashboard.py b/src/pyob/pyob_dashboard.py
index 95409a3..7b43ffe 100644
--- a/src/pyob/pyob_dashboard.py
+++ b/src/pyob/pyob_dashboard.py
@@ -66,6 +66,10 @@
Scanning structure...
+
Manual Override
@@ -94,6 +98,7 @@
document.getElementById('analysis').innerText = data.analysis || "Parsing...";
const queueDiv = document.getElementById('queue');
queueDiv.innerText = data.cascade_queue?.length > 0 ? data.cascade_queue.join('\\n') : "EMPTY";
+ await updatePendingPatches(); // Refresh pending patches
} catch (e) { document.getElementById('status-pill').innerText = "OFFLINE"; }
}
@@ -108,6 +113,50 @@
document.getElementById('manualTargetFile').value = '';
}
+ async function updatePendingPatches() {
+ try {
+ const response = await fetch('/api/pending_patches');
+ const data = await response.json();
+ const patchesDiv = document.getElementById('pending-patches');
+ patchesDiv.innerHTML = ''; // Clear previous content
+
+ if (data.patches && data.patches.length > 0) {
+ data.patches.forEach(patch => {
+ const patchElement = document.createElement('div');
+ patchElement.style.marginBottom = '10px';
+ patchElement.innerHTML = `
+
Patch ID: ${patch.id}
+
File: ${patch.target_file}
+
Description: ${patch.description || 'N/A'}
+
+
+ `;
+ patchesDiv.appendChild(patchElement);
+ });
+ } else {
+ patchesDiv.innerText = "No pending patches.";
+ }
+ } catch (e) {
+ console.error("Failed to fetch pending patches:", e);
+ document.getElementById('pending-patches').innerText = "Error loading patches.";
+ }
+ }
+
+ async function reviewPatch(patchId, action) {
+ try {
+ await fetch('/api/review_patch', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ patch_id: patchId, action: action })
+ });
+ // Refresh stats and patches after review
+ await updateStats();
+ } catch (e) {
+ console.error(`Failed to ${action} patch ${patchId}:`, e);
+ alert(`Failed to ${action} patch ${patchId}. Check console for details.`);
+ }
+ }
+
setInterval(updateStats, 3000);
updateStats();