fix queue and stats
This commit is contained in:
@@ -54,33 +54,6 @@ function Monitor() {
|
||||
return () => clearInterval(interval);
|
||||
}, [fetchData]);
|
||||
|
||||
const triggerScan = async () => {
|
||||
try {
|
||||
await fetch('/api/scan/trigger', { method: 'POST' });
|
||||
fetchData();
|
||||
} catch (err) {
|
||||
console.error('Failed to trigger scan:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const stopProcessing = async () => {
|
||||
try {
|
||||
await fetch('/api/processing/stop', { method: 'POST' });
|
||||
fetchData();
|
||||
} catch (err) {
|
||||
console.error('Failed to stop processing:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const startProcessing = async () => {
|
||||
try {
|
||||
await fetch('/api/processing/start', { method: 'POST' });
|
||||
fetchData();
|
||||
} catch (err) {
|
||||
console.error('Failed to start processing:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const retryFile = async (filePath: string) => {
|
||||
try {
|
||||
await fetch('/api/processing/retry', {
|
||||
@@ -103,25 +76,6 @@ function Monitor() {
|
||||
}
|
||||
};
|
||||
|
||||
const clearMetadata = async () => {
|
||||
if (!window.confirm('Are you sure you want to clear all metadata? This will delete all file metadata and trigger a full rescan.')) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const response = await fetch('/api/metadata/clear', { method: 'POST' });
|
||||
const data = await response.json();
|
||||
if (response.ok) {
|
||||
alert(`Cleared ${data.deletedCount} files. Rescan triggered.`);
|
||||
} else {
|
||||
alert(`Failed to clear metadata: ${data.message}`);
|
||||
}
|
||||
fetchData();
|
||||
} catch (err) {
|
||||
console.error('Failed to clear metadata:', err);
|
||||
alert('Failed to clear metadata');
|
||||
}
|
||||
};
|
||||
|
||||
// Calculate progress for 6-stage pipeline (including failed)
|
||||
// Discovered = files waiting for fast queue (validated but not yet processing)
|
||||
const getProgress = () => {
|
||||
@@ -193,23 +147,6 @@ function Monitor() {
|
||||
<div className="monitor-page">
|
||||
<div className="monitor-header">
|
||||
<h1>Processing Monitor</h1>
|
||||
<div className="header-actions">
|
||||
{status?.computed?.gateOpen === false ? (
|
||||
<button className="btn btn-success" onClick={startProcessing}>
|
||||
Start Processing
|
||||
</button>
|
||||
) : (
|
||||
<button className="btn btn-danger" onClick={stopProcessing}>
|
||||
Stop Processing
|
||||
</button>
|
||||
)}
|
||||
<button className="btn btn-primary" onClick={triggerScan}>
|
||||
Trigger Scan
|
||||
</button>
|
||||
<button className="btn btn-warning" onClick={clearMetadata}>
|
||||
Clear Metadata
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Pipeline Progress Bar - 6 Stage (including failed) */}
|
||||
@@ -574,30 +511,6 @@ function Monitor() {
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
background: linear-gradient(135deg, #10b981, #059669);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-success:hover {
|
||||
background: linear-gradient(135deg, #059669, #047857);
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: linear-gradient(135deg, #ef4444, #dc2626);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: linear-gradient(135deg, #dc2626, #b91c1c);
|
||||
}
|
||||
|
||||
|
||||
/* Pipeline Progress Bar */
|
||||
.pipeline-section {
|
||||
margin-bottom: 24px;
|
||||
|
||||
@@ -21,7 +21,6 @@ function Plugins() {
|
||||
const [configEditing, setConfigEditing] = useState<Record<string, unknown> | null>(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [scanStatus, setScanStatus] = useState<string | null>(null);
|
||||
|
||||
// Container plugin management state
|
||||
const [showAddPluginModal, setShowAddPluginModal] = useState(false);
|
||||
@@ -115,18 +114,6 @@ function Plugins() {
|
||||
}
|
||||
};
|
||||
|
||||
const triggerScan = async () => {
|
||||
setScanStatus('Scanning...');
|
||||
try {
|
||||
await fetch('/api/scan/trigger', { method: 'POST' });
|
||||
setScanStatus('Scan triggered');
|
||||
setTimeout(() => setScanStatus(null), 3000);
|
||||
} catch (err) {
|
||||
console.error('Failed to trigger scan:', err);
|
||||
setScanStatus('Scan failed');
|
||||
}
|
||||
};
|
||||
|
||||
const rescanPlugins = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
@@ -344,13 +331,6 @@ function Plugins() {
|
||||
>
|
||||
Rescan Plugins
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-primary"
|
||||
onClick={triggerScan}
|
||||
disabled={loading}
|
||||
>
|
||||
{scanStatus || 'Trigger File Scan'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user