Make automation pause recoverable and fix log folder selection
CI / verify (push) Canceled after 0s

This commit is contained in:
Sucukdeluxe committed 2026-10-03 11:36:17 +02:00
1 parent 0cef0dd3a1
commit f2e400c89e
6 files changed
+140 -31

No files matched your search

+12 -3
View File
@@ -289,12 +289,14 @@
const candidates = asArray(value.candidates); const candidates = asArray(value.candidates);
const historyRows = asArray(value.historyRows); const historyRows = asArray(value.historyRows);
const uploadLogRows = asArray(value.uploadLogRows); const uploadLogRows = asArray(value.uploadLogRows);
const exactPaths = new Set(asArray(value.queuePaths).map(normalizePath).filter(Boolean)); const queuePaths = new Set(asArray(value.queuePaths).map(normalizePath).filter(Boolean));
const exactPaths = new Set();
for (const row of historyRows) { for (const row of historyRows) {
const exact = normalizePath(row?.path || row?.file); const exact = normalizePath(row?.path || row?.file);
if (exact) exactPaths.add(exact); if (exact) exactPaths.add(exact);
} }
const evidenceNames = new Set(); const evidenceNames = new Set();
const historyNames = new Set(historyRows.map(row => baseName(row?.fileName || row?.filename || row?.name || row?.path || row?.file)).filter(Boolean));
for (const row of [...historyRows, ...uploadLogRows]) { for (const row of [...historyRows, ...uploadLogRows]) {
const name = baseName(row?.fileName || row?.filename || row?.name || row?.path || row?.file); const name = baseName(row?.fileName || row?.filename || row?.name || row?.path || row?.file);
if (name) evidenceNames.add(name); if (name) evidenceNames.add(name);
@@ -307,14 +309,21 @@
const processedPaths = []; const processedPaths = [];
const ambiguousPaths = []; const ambiguousPaths = [];
const unprocessedPaths = []; const unprocessedPaths = [];
const reasons = {};
for (const candidate of candidates) { for (const candidate of candidates) {
const exact = normalizePath(candidate?.path); const exact = normalizePath(candidate?.path);
const name = baseName(candidate?.name || candidate?.path); const name = baseName(candidate?.name || candidate?.path);
if ((exact && exactPaths.has(exact)) || (evidenceNames.has(name) && nameCounts.get(name) === 1)) processedPaths.push(candidate?.path); if (exact && queuePaths.has(exact)) {
processedPaths.push(candidate?.path);
reasons[exact] = 'in-queue';
} else if ((exact && exactPaths.has(exact)) || (evidenceNames.has(name) && nameCounts.get(name) === 1)) {
processedPaths.push(candidate?.path);
reasons[exact] = exactPaths.has(exact) || historyNames.has(name) ? 'history' : 'upload-log';
}
else if (evidenceNames.has(name) && nameCounts.get(name) > 1) ambiguousPaths.push(candidate?.path); else if (evidenceNames.has(name) && nameCounts.get(name) > 1) ambiguousPaths.push(candidate?.path);
else unprocessedPaths.push(candidate?.path); else unprocessedPaths.push(candidate?.path);
} }
return { processedPaths, ambiguousPaths, unprocessedPaths }; return { processedPaths, ambiguousPaths, unprocessedPaths, reasons };
} }
return { return {
+9 -4
View File
@@ -349,21 +349,26 @@ class FolderMonitor extends EventEmitter {
const settings = this._settings; const settings = this._settings;
try { try {
await this._access(settings.folderPath); await this._access(settings.folderPath);
} catch { } catch (error) {
if (!this._isCurrent(generation)) return this._cancelledResult(trigger); if (!this._isCurrent(generation)) return this._cancelledResult(trigger);
return this._result([], false, false, trigger); return this._result([], false, false, trigger, { errorCode: this._scanErrorCode(error) });
} }
if (!this._isCurrent(generation)) return this._cancelledResult(trigger); if (!this._isCurrent(generation)) return this._cancelledResult(trigger);
try { try {
const files = await this._discoverFiles(settings, generation); const files = await this._discoverFiles(settings, generation);
if (!this._isCurrent(generation)) return this._cancelledResult(trigger); if (!this._isCurrent(generation)) return this._cancelledResult(trigger);
return this._result(files, true, this._reachable === false, trigger); return this._result(files, true, this._reachable === false, trigger);
} catch { } catch (error) {
if (!this._isCurrent(generation)) return this._cancelledResult(trigger); if (!this._isCurrent(generation)) return this._cancelledResult(trigger);
return this._result([], true, false, trigger, { error: 'Ordnerscan fehlgeschlagen' }); return this._result([], true, false, trigger, { error: 'Ordnerscan fehlgeschlagen', errorCode: this._scanErrorCode(error) });
} }
} }
_scanErrorCode(error) {
const code = String(error?.code || '');
return ['ENOENT', 'ENOTDIR', 'EACCES', 'EPERM', 'EBUSY', 'EIO', 'EMFILE', 'ENFILE'].includes(code) ? code : '';
}
async _discoverFiles(settings, generation) { async _discoverFiles(settings, generation) {
const discovered = await this._walkFolder(settings.folderPath, { recursive: !!settings.recursive }); const discovered = await this._walkFolder(settings.folderPath, { recursive: !!settings.recursive });
if (!this._isCurrent(generation)) return []; if (!this._isCurrent(generation)) return [];
+28 -2
View File
@@ -3196,6 +3196,7 @@ async function _scanOwnUploadLog() {
for await (const entry of directoryHandle) { for await (const entry of directoryHandle) {
directoryEntries++; directoryEntries++;
if (directoryEntries > 50000) throw new Error('Upload-Log-Verzeichnis enthält zu viele Einträge'); if (directoryEntries > 50000) throw new Error('Upload-Log-Verzeichnis enthält zu viele Einträge');
if (typeof entry.isFile === 'function' && !entry.isFile()) continue;
const file = entry.name; const file = entry.name;
if ( if (
isManagedUploadLogFileName(file, { baseName: name, ext }) isManagedUploadLogFileName(file, { baseName: name, ext })
@@ -3205,7 +3206,7 @@ async function _scanOwnUploadLog() {
} }
} }
} catch (error) { } catch (error) {
if (error?.code !== 'ENOENT') throw error; if (!['ENOENT', 'ENOTDIR'].includes(error?.code)) throw error;
} }
} }
if (_activeLogPath) logFiles.add(_activeLogPath); if (_activeLogPath) logFiles.add(_activeLogPath);
@@ -3237,7 +3238,7 @@ async function _scanOwnUploadLog() {
if (entries.size > 250000) throw new Error('Upload-Log enthält zu viele eindeutige Einträge'); if (entries.size > 250000) throw new Error('Upload-Log enthält zu viele eindeutige Einträge');
} }
} catch (error) { } catch (error) {
if (error?.code !== 'ENOENT') throw error; if (!['ENOENT', 'ENOTDIR'].includes(error?.code)) throw error;
} }
} }
return [...entries.values()]; return [...entries.values()];
@@ -3450,8 +3451,33 @@ ipcMain.handle('complete-upload-finalization', async (_event, payload) => {
} }
}); });
async function validateUploadLogPath(filePath) {
const value = String(filePath || '').trim();
if (!value) return;
let candidate = path.resolve(value);
let isTarget = true;
while (true) {
try {
const stat = await fs.promises.stat(candidate);
if (isTarget ? !stat.isFile() : !stat.isDirectory()) {
throw new Error(shellText('Upload-Log-Pfad ungültig: Datei und Ordner verwechselt.', 'Invalid upload log path: file and directory do not match.'));
}
return;
} catch (error) {
if (error?.code !== 'ENOENT') throw error;
}
const parent = path.dirname(candidate);
if (parent === candidate) return;
candidate = parent;
isTarget = false;
}
}
ipcMain.handle('save-global-settings', async (_event, globalSettings) => { ipcMain.handle('save-global-settings', async (_event, globalSettings) => {
assertConfigWriteAllowed(); assertConfigWriteAllowed();
if (String(globalSettings?.logFilePath || '').trim() !== String(configStore.load().globalSettings?.logFilePath || '').trim()) {
await validateUploadLogPath(globalSettings?.logFilePath);
}
await configStore.saveRendererGlobalSettings(globalSettings); await configStore.saveRendererGlobalSettings(globalSettings);
globalSettings = configStore.load().globalSettings; globalSettings = configStore.load().globalSettings;
_invalidateLogSettings(globalSettings); _invalidateLogSettings(globalSettings);
+69 -22
View File
@@ -658,11 +658,24 @@ function createAutomationStatusSnapshot() {
return freezeAutomationValue(snapshot); return freezeAutomationValue(snapshot);
} }
function automationErrorDetail(error) {
const message = String(error?.message || error || 'Unbekannter Fehler');
if (/(?:token|password|cookie|authorization|api[_-]?key|session)\s*[:=]/i.test(message)) return localizeUiText('Fehlerdetails enthalten geschützte Daten.');
return _sanitizeFailureClipboardValue(message, 700);
}
async function loadAutomationEvidenceSnapshot() { async function loadAutomationEvidenceSnapshot() {
const readEvidence = async (label, read) => {
try {
return await read();
} catch (error) {
throw new Error(`${localizeUiText(label)}: ${automationErrorDetail(error)}`);
}
};
const [history, uploadLog, automationCompletions] = await Promise.all([ const [history, uploadLog, automationCompletions] = await Promise.all([
window.api.getHistory(), readEvidence('Verlauf konnte nicht gelesen werden', () => window.api.getHistory()),
window.api.readOwnUploadLog(), readEvidence('Upload-Log konnte nicht gelesen werden', () => window.api.readOwnUploadLog()),
typeof window.api.getAutomationCompletions === 'function' ? window.api.getAutomationCompletions() : Promise.resolve([]) readEvidence('Abschlussnachweis konnte nicht gelesen werden', () => typeof window.api.getAutomationCompletions === 'function' ? window.api.getAutomationCompletions() : Promise.resolve([]))
]); ]);
return { history, uploadLog, automationCompletions }; return { history, uploadLog, automationCompletions };
} }
@@ -716,7 +729,7 @@ async function evaluateAutomationCandidates(files, options = {}) {
uploadLogRows: uploadLog uploadLogRows: uploadLog
}); });
const processedPaths = new Set(processed.processedPaths.map(normalizeAutomationPath)); const processedPaths = new Set(processed.processedPaths.map(normalizeAutomationPath));
for (const path of processedPaths) reasons.set(path, 'processed'); for (const path of processedPaths) reasons.set(path, processed.reasons[path] || 'processed');
const unprocessed = matched.filter(candidate => !processedPaths.has(normalizeAutomationPath(candidate.path))); const unprocessed = matched.filter(candidate => !processedPaths.has(normalizeAutomationPath(candidate.path)));
const inspection = await window.api.inspectImportFiles( const inspection = await window.api.inspectImportFiles(
unprocessed, unprocessed,
@@ -750,7 +763,7 @@ async function evaluateAutomationCandidates(files, options = {}) {
const completedHostersByPath = new Map(completionState.completedByPath.map(entry => [normalizeAutomationPath(entry.path), new Set(entry.hosters)])); const completedHostersByPath = new Map(completionState.completedByPath.map(entry => [normalizeAutomationPath(entry.path), new Set(entry.hosters)]));
for (const path of ledgerProcessedPaths) { for (const path of ledgerProcessedPaths) {
processedPaths.add(path); processedPaths.add(path);
reasons.set(path, 'processed'); reasons.set(path, 'completion');
} }
const plannedCandidates = initialPlannedCandidates const plannedCandidates = initialPlannedCandidates
.filter(candidate => !ledgerProcessedPaths.has(normalizeAutomationPath(candidate.path))) .filter(candidate => !ledgerProcessedPaths.has(normalizeAutomationPath(candidate.path)))
@@ -791,11 +804,16 @@ async function evaluateAutomationCandidates(files, options = {}) {
name: candidate.name, name: candidate.name,
reason: reasons.get(normalizeAutomationPath(candidate.path)) || 'unavailable' reason: reasons.get(normalizeAutomationPath(candidate.path)) || 'unavailable'
})); }));
const skippedReasons = new Set(['filter-rejected', 'processed', 'inspection-duplicate', 'unavailable', 'size-limited']); const skippedReasons = new Set(['filter-rejected', 'processed', 'completion', 'history', 'upload-log', 'in-queue', 'inspection-duplicate', 'unavailable', 'size-limited']);
const summary = { const summary = {
found: candidates.length, found: candidates.length,
filterMatched: matched.length, filterMatched: matched.length,
alreadyProcessed: processed.processedPaths.length + inspectionDuplicatePaths.size + ledgerProcessedPaths.size, alreadyProcessed: processed.processedPaths.length + inspectionDuplicatePaths.size + ledgerProcessedPaths.size,
processedByCompletion: ledgerProcessedPaths.size,
processedByHistory: classifications.filter(entry => entry.reason === 'history').length,
processedByUploadLog: classifications.filter(entry => entry.reason === 'upload-log').length,
inQueue: classifications.filter(entry => entry.reason === 'in-queue' || entry.reason === 'inspection-duplicate').length,
filterRejected: classifications.filter(entry => entry.reason === 'filter-rejected').length,
unavailable: unavailablePaths.size, unavailable: unavailablePaths.size,
sizeLimitedJobs, sizeLimitedJobs,
acceptedFiles: selectedHosters.length === 0 ? plannedCandidates.length : actionableCandidates.length, acceptedFiles: selectedHosters.length === 0 ? plannedCandidates.length : actionableCandidates.length,
@@ -804,6 +822,7 @@ async function evaluateAutomationCandidates(files, options = {}) {
availableSlots, availableSlots,
deferredFiles: deferredFiles.length deferredFiles: deferredFiles.length
}; };
if (options.dryRun !== true) window.api.debugLog(`automation-eval trigger=${String(options.trigger || 'watcher')} found=${summary.found} admitted=${admittedFiles.length} completion=${summary.processedByCompletion} history=${summary.processedByHistory} log=${summary.processedByUploadLog} queue=${summary.inQueue} filter=${summary.filterRejected} unavailable=${summary.unavailable} sizeLimitedJobs=${summary.sizeLimitedJobs} deferred=${summary.deferredFiles}`);
return freezeAutomationValue({ return freezeAutomationValue({
dryRun: options.dryRun === true, dryRun: options.dryRun === true,
trigger: String(options.trigger || 'watcher'), trigger: String(options.trigger || 'watcher'),
@@ -941,13 +960,14 @@ async function applyAutomationEvaluation(evaluation) {
const classifications = (evaluation.classifications || []).map(entry => dynamicPaths.has(normalizeAutomationPath(entry.path)) const classifications = (evaluation.classifications || []).map(entry => dynamicPaths.has(normalizeAutomationPath(entry.path))
? { ...entry, reason: dynamicReasons.get(normalizeAutomationPath(entry.path)) } ? { ...entry, reason: dynamicReasons.get(normalizeAutomationPath(entry.path)) }
: entry); : entry);
const skippedReasons = new Set(['filter-rejected', 'processed', 'inspection-duplicate', 'unavailable', 'size-limited']); const skippedReasons = new Set(['filter-rejected', 'processed', 'completion', 'history', 'upload-log', 'in-queue', 'inspection-duplicate', 'unavailable', 'size-limited']);
const telemetryDelta = { const telemetryDelta = {
detected: classifications.length, detected: classifications.length,
queued: admittedFiles.length, queued: admittedFiles.length,
skipped: classifications.filter(entry => skippedReasons.has(entry.reason)).length, skipped: classifications.filter(entry => skippedReasons.has(entry.reason)).length,
deferred: deferredFiles.length, deferred: deferredFiles.length,
lastDetectedName: evaluation.telemetryDelta?.lastDetectedName || '' lastDetectedName: evaluation.telemetryDelta?.lastDetectedName || '',
lastError: ''
}; };
if (admittedFiles.length === 0) { if (admittedFiles.length === 0) {
const telemetryResult = await persistAutomationTelemetry(telemetryDelta); const telemetryResult = await persistAutomationTelemetry(telemetryDelta);
@@ -1028,8 +1048,7 @@ async function applyAutomationEvaluation(evaluation) {
async function runFolderMonitorTestScan() { async function runFolderMonitorTestScan() {
const result = await window.api.folderMonitorTestScan(); const result = await window.api.folderMonitorTestScan();
if (result?.error) { if (result?.error) {
const knownErrors = ['Kein Ordnerpfad angegeben', 'Ordner nicht erreichbar', 'Ordnerscan fehlgeschlagen']; throw new Error(localizeUiText(result.error) + (result.errorCode ? ` (${result.errorCode})` : ''));
throw new Error(knownErrors.includes(result.error) ? result.error : 'Ordnerüberwachung konnte nicht getestet werden.');
} }
return evaluateAutomationCandidates(result?.files || [], { dryRun: true, trigger: result?.trigger || 'test' }); return evaluateAutomationCandidates(result?.files || [], { dryRun: true, trigger: result?.trigger || 'test' });
} }
@@ -1047,6 +1066,11 @@ const automationTestMetricDefinitions = Object.freeze([
Object.freeze(['found', 'Gefundene Dateien']), Object.freeze(['found', 'Gefundene Dateien']),
Object.freeze(['filterMatched', 'Passend zum Dateifilter']), Object.freeze(['filterMatched', 'Passend zum Dateifilter']),
Object.freeze(['alreadyProcessed', 'Bereits verarbeitet']), Object.freeze(['alreadyProcessed', 'Bereits verarbeitet']),
Object.freeze(['processedByCompletion', 'Bereits hochgeladen laut Abschlussnachweis']),
Object.freeze(['processedByHistory', 'Bereits im Verlauf']),
Object.freeze(['processedByUploadLog', 'Bereits im Upload-Log']),
Object.freeze(['inQueue', 'Bereits in Warteschlange oder Auswahl']),
Object.freeze(['filterRejected', 'Vom Dateifilter ausgeschlossen']),
Object.freeze(['unavailable', 'Fehlend, leer oder nicht lesbar']), Object.freeze(['unavailable', 'Fehlend, leer oder nicht lesbar']),
Object.freeze(['sizeLimitedJobs', 'Durch Größenlimits ausgeschlossen']), Object.freeze(['sizeLimitedJobs', 'Durch Größenlimits ausgeschlossen']),
Object.freeze(['acceptedFiles', 'Akzeptierte Dateien']), Object.freeze(['acceptedFiles', 'Akzeptierte Dateien']),
@@ -1127,6 +1151,11 @@ function renderAutomationStatusSnapshot(snapshot) {
const errorText = String(snapshot.error || telemetry.lastError || ''); const errorText = String(snapshot.error || telemetry.lastError || '');
if (errorRow) errorRow.hidden = errorText.length === 0; if (errorRow) errorRow.hidden = errorText.length === 0;
setAutomationText('automationLastError', errorText ? localizeUiText(errorText) : ''); setAutomationText('automationLastError', errorText ? localizeUiText(errorText) : '');
const pauseNotice = document.getElementById('automationPauseNotice');
if (pauseNotice) {
pauseNotice.hidden = !snapshot.paused;
pauseNotice.textContent = snapshot.paused ? `${localizeUiText('Automatik pausiert seit')} ${formatAutomationDateTime(snapshot.pausedAt)}. ${localizeUiText('Fortsetzen aktiviert die Ordnerüberwachung und die Warteschlange. Aktive Uploads werden beim Pausieren noch abgeschlossen.')}` : '';
}
return snapshot; return snapshot;
} }
@@ -1147,7 +1176,7 @@ function ensureAutomationPauseResumeButton() {
function syncAutomationPauseResumeButton(snapshot) { function syncAutomationPauseResumeButton(snapshot) {
const button = ensureAutomationPauseResumeButton(); const button = ensureAutomationPauseResumeButton();
if (!button || !snapshot) return; if (!button || !snapshot) return;
const label = snapshot.paused === true ? 'Fortsetzen' : 'Abschließen und pausieren'; const label = snapshot.paused === true ? 'Automatik fortsetzen' : 'Automatik pausieren';
const localized = localizeUiText(label); const localized = localizeUiText(label);
const text = button.querySelector('.automation-pause-resume-label'); const text = button.querySelector('.automation-pause-resume-label');
if (text) text.textContent = localized; if (text) text.textContent = localized;
@@ -1155,6 +1184,12 @@ function syncAutomationPauseResumeButton(snapshot) {
button.setAttribute('aria-label', localized); button.setAttribute('aria-label', localized);
button.classList.toggle('automation-resume', snapshot.paused === true); button.classList.toggle('automation-resume', snapshot.paused === true);
button.disabled = automationPauseResumeBusy; button.disabled = automationPauseResumeBusy;
const settingsButton = document.getElementById('automationSettingsPauseResumeBtn');
if (settingsButton) {
settingsButton.textContent = localized;
settingsButton.disabled = automationPauseResumeBusy || snapshot.statusAvailable !== true;
settingsButton.title = localizeUiText('Fortsetzen aktiviert die Ordnerüberwachung und die Warteschlange. Aktive Uploads werden beim Pausieren noch abgeschlossen.');
}
} }
function syncAutomationContextStartControls(blocked) { function syncAutomationContextStartControls(blocked) {
@@ -1330,9 +1365,10 @@ async function runAutomationTestOverlay() {
if (generation !== automationTestGeneration) return; if (generation !== automationTestGeneration) return;
renderAutomationTestViewState({ loading: false, summary: evaluation.summary, error: '' }); renderAutomationTestViewState({ loading: false, summary: evaluation.summary, error: '' });
} catch (error) { } catch (error) {
const detail = automationErrorDetail(error);
window.api.debugLog(`automation-test failed: ${detail}`);
if (generation !== automationTestGeneration) return; if (generation !== automationTestGeneration) return;
const knownErrors = ['Kein Ordnerpfad angegeben', 'Ordner nicht erreichbar', 'Ordnerscan fehlgeschlagen']; renderAutomationTestViewState({ loading: false, summary: null, error: `${localizeUiText('Ordnerüberwachung konnte nicht getestet werden.')} ${localizeUiText(detail)}` });
renderAutomationTestViewState({ loading: false, summary: null, error: knownErrors.includes(error?.message) ? error.message : 'Ordnerüberwachung konnte nicht getestet werden.' });
} }
} }
@@ -1374,6 +1410,7 @@ async function toggleAutomationPauseResume() {
lastUploadStats.state = 'stopping'; lastUploadStats.state = 'stopping';
updateStatusBar(); updateStatusBar();
} }
showCopyToast(localizeUiText('Automatik und Warteschlange pausiert. Fortsetzen ist unter Einstellungen → Automatik jederzeit möglich.'), 6500);
} }
} catch { } catch {
showCopyToast(localizeUiText(resume ? 'Automatik konnte nicht fortgesetzt werden.' : 'Automatik konnte nicht pausiert werden.'), 6000, 'error'); showCopyToast(localizeUiText(resume ? 'Automatik konnte nicht fortgesetzt werden.' : 'Automatik konnte nicht pausiert werden.'), 6000, 'error');
@@ -1539,7 +1576,11 @@ async function init() {
}); });
window.api.onFolderMonitorNewFiles(files => { window.api.onFolderMonitorNewFiles(files => {
handleFolderMonitorFiles(files).catch(error => window.api.debugLog(`folder-monitor renderer evaluation failed: ${error.message || String(error)}`)); handleFolderMonitorFiles(files).catch(error => {
const message = automationErrorDetail(error);
window.api.debugLog(`folder-monitor renderer evaluation failed: ${message}`);
persistAutomationTelemetry({ lastError: message }).then(refreshAutomationControlCenter);
});
}); });
window.api.signalFolderMonitorReady(); window.api.signalFolderMonitorReady();
if (typeof window.api.onAutomationStatus === 'function') { if (typeof window.api.onAutomationStatus === 'function') {
@@ -6482,7 +6523,10 @@ function renderSettings() {
${pageHeader('Automatik', 'Wiederholungen und überwachte Ordner für unbeaufsichtigte Uploads.')} ${pageHeader('Automatik', 'Wiederholungen und überwachte Ordner für unbeaufsichtigte Uploads.')}
<section class="automation-status-card" id="automationStatusCard" aria-live="polite"> <section class="automation-status-card" id="automationStatusCard" aria-live="polite">
<div class="automation-status-header"> <div class="automation-status-header">
<span class="automation-state-badge state-inactive" id="automationStateBadge">Inaktiv</span> <div class="automation-status-controls">
<span class="automation-state-badge state-inactive" id="automationStateBadge">Inaktiv</span>
<button class="btn btn-secondary" id="automationSettingsPauseResumeBtn" type="button">Automatik pausieren</button>
</div>
<div class="automation-queue-summary"> <div class="automation-queue-summary">
<span class="automation-queue-label">Aktuelle Queue-Auslastung</span> <span class="automation-queue-label">Aktuelle Queue-Auslastung</span>
<strong class="automation-status-value automation-queue-value" id="automationQueueMeter">0 / 15.000</strong> <strong class="automation-status-value automation-queue-value" id="automationQueueMeter">0 / 15.000</strong>
@@ -6491,14 +6535,16 @@ function renderSettings() {
</div> </div>
</div> </div>
</div> </div>
<p class="automation-pause-notice" id="automationPauseNotice" hidden></p>
<p class="hint">Die Tageszähler zählen Prüfungen und Aufnahmen. Wiederholte Abgleiche derselben Datei werden erneut gezählt.</p>
<div class="automation-status-metrics"> <div class="automation-status-metrics">
<div class="automation-status-metric"><span>Überwachung läuft seit</span><strong class="automation-status-value" id="automationMonitoringSince">Nie</strong></div> <div class="automation-status-metric"><span>Überwachung läuft seit</span><strong class="automation-status-value" id="automationMonitoringSince">Nie</strong></div>
<div class="automation-status-metric"><span>Ordner erreichbar</span><strong class="automation-status-value" id="automationFolderReachable">—</strong></div> <div class="automation-status-metric"><span>Ordner erreichbar</span><strong class="automation-status-value" id="automationFolderReachable">—</strong></div>
<div class="automation-status-metric"><span>Letzte erkannte Datei</span><strong class="automation-status-value" id="automationLastDetectedFile">Keine Datei erkannt</strong></div> <div class="automation-status-metric"><span>Letzte erkannte Datei</span><strong class="automation-status-value" id="automationLastDetectedFile">Keine Datei erkannt</strong></div>
<div class="automation-status-metric"><span>Heute erkannt</span><strong class="automation-status-value" id="automationDetectedToday">0</strong></div> <div class="automation-status-metric"><span>Dateiprüfungen heute</span><strong class="automation-status-value" id="automationDetectedToday">0</strong></div>
<div class="automation-status-metric"><span>Heute eingereiht</span><strong class="automation-status-value" id="automationQueuedToday">0</strong></div> <div class="automation-status-metric"><span>Heute eingereiht</span><strong class="automation-status-value" id="automationQueuedToday">0</strong></div>
<div class="automation-status-metric"><span>Heute übersprungen</span><strong class="automation-status-value" id="automationSkippedToday">0</strong></div> <div class="automation-status-metric"><span>Übersprungene Prüfungen heute</span><strong class="automation-status-value" id="automationSkippedToday">0</strong></div>
<div class="automation-status-metric"><span>Wegen Queue-Limit zurückgestellt</span><strong class="automation-status-value" id="automationDeferredToday">0</strong></div> <div class="automation-status-metric"><span>Zurückstellungen wegen Queue-Limit heute</span><strong class="automation-status-value" id="automationDeferredToday">0</strong></div>
<div class="automation-status-metric"><span>Letzter Abgleich</span><strong class="automation-status-value" id="automationLastReconcile">Nie</strong></div> <div class="automation-status-metric"><span>Letzter Abgleich</span><strong class="automation-status-value" id="automationLastReconcile">Nie</strong></div>
<div class="automation-status-metric"><span>Nächster Abgleich</span><strong class="automation-status-value" id="automationNextReconcile">Nie</strong></div> <div class="automation-status-metric"><span>Nächster Abgleich</span><strong class="automation-status-value" id="automationNextReconcile">Nie</strong></div>
</div> </div>
@@ -6581,7 +6627,7 @@ function renderSettings() {
<div class="settings-row checkbox-row folder-monitor-help-row"> <div class="settings-row checkbox-row folder-monitor-help-row">
<label>Vorhandene Dateien einmalig einlesen</label> <label>Vorhandene Dateien einmalig einlesen</label>
<input type="checkbox" class="settings-autosave" id="fmIncludeExistingInput" ${fm.includeExisting ? 'checked' : ''}> <input type="checkbox" class="settings-autosave" id="fmIncludeExistingInput" ${fm.includeExisting ? 'checked' : ''}>
${folderMonitorHelp('existing', 'Fügt beim nächsten Start der Überwachung alle bereits vorhandenen passenden Dateien hinzu. Die Option wird danach automatisch deaktiviert.')} ${folderMonitorHelp('existing', 'Bezieht beim Start bereits vorhandene Dateien ein. Bereits hochgeladene Dateien werden weiterhin übersprungen. Regelmäßige Abgleiche prüfen den gesamten Ordner erneut.')}
</div> </div>
<div class="settings-row checkbox-row folder-monitor-help-row"> <div class="settings-row checkbox-row folder-monitor-help-row">
<label>Duplikate überspringen</label> <label>Duplikate überspringen</label>
@@ -7108,6 +7154,7 @@ function renderSettings() {
} }
}); });
document.getElementById('automationTestBtn')?.addEventListener('click', runAutomationTestOverlay); document.getElementById('automationTestBtn')?.addEventListener('click', runAutomationTestOverlay);
document.getElementById('automationSettingsPauseResumeBtn')?.addEventListener('click', toggleAutomationPauseResume);
ensureAutomationTestOverlay(); ensureAutomationTestOverlay();
refreshAutomationControlCenter(); refreshAutomationControlCenter();
@@ -7323,9 +7370,9 @@ function syncLanguagePicker(value) {
} }
async function chooseLogFilePath() { async function chooseLogFilePath() {
const folders = await window.api.selectFolder(); const folder = await window.api.folderMonitorSelectFolder();
if (!folders || !folders[0]) return; if (!folder) return;
const normalized = folders[0].replace(/[\\\/]+$/, ''); const normalized = folder.replace(/[\\\/]+$/, '');
document.getElementById('logFilePathInput').value = `${normalized}\\fileuploader.log`; document.getElementById('logFilePathInput').value = `${normalized}\\fileuploader.log`;
markSettingsDirty(); markSettingsDirty();
} }
+19
View File
@@ -266,6 +266,22 @@
['Abgleichintervall', 'Reconciliation interval'], ['Abgleichintervall', 'Reconciliation interval'],
['Abschließen und pausieren', 'Finish and pause'], ['Abschließen und pausieren', 'Finish and pause'],
['Fortsetzen', 'Resume'], ['Fortsetzen', 'Resume'],
['Automatik fortsetzen', 'Resume automation'],
['Automatik pausieren', 'Pause automation'],
['Automatik pausiert seit', 'Automation paused since'],
['Verlauf konnte nicht gelesen werden', 'History could not be read'],
['Upload-Log konnte nicht gelesen werden', 'Upload log could not be read'],
['Abschlussnachweis konnte nicht gelesen werden', 'Completion records could not be read'],
['Fehlerdetails enthalten geschützte Daten.', 'Error details contain protected data.'],
['Fortsetzen aktiviert die Ordnerüberwachung und die Warteschlange. Aktive Uploads werden beim Pausieren noch abgeschlossen.', 'Resuming enables folder monitoring and the queue. Active uploads are allowed to finish when pausing.'],
['Automatik und Warteschlange pausiert. Fortsetzen ist unter Einstellungen → Automatik jederzeit möglich.', 'Automation and queue paused. Resume at any time under Settings → Automation.'],
['Die Tageszähler zählen Prüfungen und Aufnahmen. Wiederholte Abgleiche derselben Datei werden erneut gezählt.', 'Daily counters count checks and admissions. Repeated checks of the same file are counted again.'],
['Bereits hochgeladen laut Abschlussnachweis', 'Already uploaded according to completion records'],
['Bereits im Verlauf', 'Already in history'],
['Bereits im Upload-Log', 'Already in upload log'],
['Bereits in Warteschlange oder Auswahl', 'Already queued or selected'],
['Vom Dateifilter ausgeschlossen', 'Excluded by file filter'],
['Bezieht beim Start bereits vorhandene Dateien ein. Bereits hochgeladene Dateien werden weiterhin übersprungen. Regelmäßige Abgleiche prüfen den gesamten Ordner erneut.', 'Includes existing files at startup. Already uploaded files are still skipped. Periodic reconciliation checks the entire folder again.'],
['Pausiert', 'Paused'], ['Pausiert', 'Paused'],
['Queue-Limit erreicht', 'Queue limit reached'], ['Queue-Limit erreicht', 'Queue limit reached'],
['Ordner getrennt', 'Folder disconnected'], ['Ordner getrennt', 'Folder disconnected'],
@@ -273,6 +289,9 @@
['Ordner erreichbar', 'Folder reachable'], ['Ordner erreichbar', 'Folder reachable'],
['Letzte erkannte Datei', 'Last detected file'], ['Letzte erkannte Datei', 'Last detected file'],
['Heute erkannt', 'Detected today'], ['Heute erkannt', 'Detected today'],
['Dateiprüfungen heute', 'File checks today'],
['Übersprungene Prüfungen heute', 'Skipped checks today'],
['Zurückstellungen wegen Queue-Limit heute', 'Queue-limit deferrals today'],
['Heute eingereiht', 'Queued today'], ['Heute eingereiht', 'Queued today'],
['Heute übersprungen', 'Skipped today'], ['Heute übersprungen', 'Skipped today'],
['Wegen Queue-Limit zurückgestellt', 'Deferred by queue limit'], ['Wegen Queue-Limit zurückgestellt', 'Deferred by queue limit'],
+3
View File
@@ -1271,6 +1271,9 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; }
box-shadow: 0 14px 32px rgba(0, 0, 0, .14); box-shadow: 0 14px 32px rgba(0, 0, 0, .14);
} }
.automation-status-card * { min-width: 0; } .automation-status-card * { min-width: 0; }
.automation-status-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.automation-status-controls .btn { white-space: normal; font-size: 12px; }
.automation-pause-notice { padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.automation-status-header { .automation-status-header {
display: grid; display: grid;
grid-template-columns: auto minmax(240px, 1fr); grid-template-columns: auto minmax(240px, 1fr);