Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 33c65f21b6 | |||
| fd242a6a0a | |||
| 2892024969 | |||
| 27f5280bbf | |||
| 82898e34cb | |||
| 44392c2c31 | |||
| 58d94b716f | |||
| 579a0ddb75 | |||
| 0f21e8d9ca | |||
| 12f7240cd2 | |||
| 54d8d61358 | |||
| 5052dd9de6 | |||
| bf31ee2d16 | |||
| b847930500 | |||
| 756ff55b4c | |||
| df5a3265a1 | |||
| 2c6da44af8 | |||
| d6d6858002 | |||
| 0cf0bd8dec | |||
| af9826547c | |||
| 87027cf3c9 | |||
| 46f79b002b | |||
| dcc8aae650 | |||
| c9fdf41e0b | |||
| 3e26c691b1 | |||
| 6c3d62e84b |
+723
-879
File diff suppressed because it is too large
Load Diff
@@ -319,15 +319,15 @@ THUMBNAIL_FOLDER = _get(_conf, ['upload', 'thumbnail_folder'], DEFAULTS['upload'
|
|||||||
PREVIEW_FOLDER = _get(_conf, ['upload', 'preview_folder'], DEFAULTS['upload']['preview_folder'])
|
PREVIEW_FOLDER = _get(_conf, ['upload', 'preview_folder'], DEFAULTS['upload']['preview_folder'])
|
||||||
QR_CODE_FOLDER = _get(_conf, ['upload', 'qrcode_folder'], DEFAULTS['upload']['qrcode_folder'])
|
QR_CODE_FOLDER = _get(_conf, ['upload', 'qrcode_folder'], DEFAULTS['upload']['qrcode_folder'])
|
||||||
|
|
||||||
# Normalize to absolute paths to avoid cwd issues
|
# This guarantees exact matching with Docker volume mounts
|
||||||
if not os.path.isabs(UPLOAD_FOLDER):
|
if not os.path.isabs(UPLOAD_FOLDER):
|
||||||
UPLOAD_FOLDER = os.path.join(BASE_DIR, os.path.relpath(UPLOAD_FOLDER, BASE_DIR))
|
UPLOAD_FOLDER = os.path.abspath(os.path.join(BASE_DIR, "uploads"))
|
||||||
if not os.path.isabs(THUMBNAIL_FOLDER):
|
if not os.path.isabs(THUMBNAIL_FOLDER):
|
||||||
THUMBNAIL_FOLDER = os.path.join(BASE_DIR, os.path.relpath(THUMBNAIL_FOLDER, BASE_DIR))
|
THUMBNAIL_FOLDER = os.path.abspath(os.path.join(BASE_DIR, "thumbnails"))
|
||||||
if not os.path.isabs(PREVIEW_FOLDER):
|
if not os.path.isabs(PREVIEW_FOLDER):
|
||||||
PREVIEW_FOLDER = os.path.join(BASE_DIR, os.path.relpath(PREVIEW_FOLDER, BASE_DIR))
|
PREVIEW_FOLDER = os.path.abspath(os.path.join(BASE_DIR, "previews"))
|
||||||
if not os.path.isabs(QR_CODE_FOLDER):
|
if not os.path.isabs(QR_CODE_FOLDER):
|
||||||
QR_CODE_FOLDER = os.path.join(BASE_DIR, os.path.relpath(QR_CODE_FOLDER, BASE_DIR))
|
QR_CODE_FOLDER = os.path.abspath(os.path.join(BASE_DIR, "QRCodes"))
|
||||||
MAX_UPLOAD_MB = _get(_conf, ['upload', 'max_size_mb'], DEFAULTS['upload']['max_size_mb'])
|
MAX_UPLOAD_MB = _get(_conf, ['upload', 'max_size_mb'], DEFAULTS['upload']['max_size_mb'])
|
||||||
IMAGE_MAX_UPLOAD_MB = _get(_conf, ['upload', 'image_max_size_mb'], DEFAULTS['upload']['image_max_size_mb'])
|
IMAGE_MAX_UPLOAD_MB = _get(_conf, ['upload', 'image_max_size_mb'], DEFAULTS['upload']['image_max_size_mb'])
|
||||||
VIDEO_MAX_UPLOAD_MB = _get(_conf, ['upload', 'video_max_size_mb'], DEFAULTS['upload']['video_max_size_mb'])
|
VIDEO_MAX_UPLOAD_MB = _get(_conf, ['upload', 'video_max_size_mb'], DEFAULTS['upload']['video_max_size_mb'])
|
||||||
|
|||||||
@@ -481,7 +481,8 @@ def check_nm_pwd(username, password):
|
|||||||
if user_record_fallback is None:
|
if user_record_fallback is None:
|
||||||
logger.warning("Kein Benutzer für %r in DB %r gefunden.", dp.encrypt_text(username), db_name)
|
logger.warning("Kein Benutzer für %r in DB %r gefunden.", dp.encrypt_text(username), db_name)
|
||||||
return None
|
return None
|
||||||
|
else:
|
||||||
|
user_record = user_record_fallback
|
||||||
|
|
||||||
stored_password = user_record.get('Password') or user_record.get('password')
|
stored_password = user_record.get('Password') or user_record.get('password')
|
||||||
|
|
||||||
@@ -621,7 +622,7 @@ def get_user(username):
|
|||||||
def find_in_db(database_name):
|
def find_in_db(database_name):
|
||||||
db = client[database_name]
|
db = client[database_name]
|
||||||
users = db['users']
|
users = db['users']
|
||||||
return users.find_one({'Username': dp.encrypt_text(username)}) or users.find_one({'username': dp.encrypt_text(username)})
|
return users.find_one({'Username': dp.encrypt_text(username)}) or users.find_one({'username': dp.encrypt_text(username)}) or users.find_one({'username': username}) or users.find_one({'Username': username})
|
||||||
|
|
||||||
tenant_db, tenant_id = _resolve_request_tenant_db()
|
tenant_db, tenant_id = _resolve_request_tenant_db()
|
||||||
if tenant_db:
|
if tenant_db:
|
||||||
|
|||||||
@@ -17,4 +17,5 @@ cryptography>=42.0.0
|
|||||||
pywebpush
|
pywebpush
|
||||||
py-vapid>=1.9.0
|
py-vapid>=1.9.0
|
||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
pywebpush
|
pywebpush
|
||||||
|
pandas
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<div style="display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; margin-bottom:16px;">
|
<div style="display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; margin-bottom:16px;">
|
||||||
<div>
|
<div>
|
||||||
<h1 style="margin:0;">Defekte Items</h1>
|
<h1 style="margin:0;">Defekte Items</h1>
|
||||||
<p style="margin:6px 0 0; color:#64748b;">Eigenes Verwaltungsfenster fuer gemeldete Defekte mit schneller Reparatur-Funktion.</p>
|
<p style="margin:6px 0 0; color:#64748b;">Eigenes Verwaltungsfenster für gemeldete Defekte mit schneller Reparatur-Funktion.</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="display:flex; gap:8px; flex-wrap:wrap;">
|
<div style="display:flex; gap:8px; flex-wrap:wrap;">
|
||||||
<a class="btn btn-outline-secondary" href="{{ url_for('admin_borrowings') }}">Ausleihen</a>
|
<a class="btn btn-outline-secondary" href="{{ url_for('admin_borrowings') }}">Ausleihen</a>
|
||||||
@@ -42,7 +42,13 @@
|
|||||||
{% if item.isbn %}<div style="font-size:0.82rem; color:#64748b;">ISBN: {{ item.isbn }}</div>{% endif %}
|
{% if item.isbn %}<div style="font-size:0.82rem; color:#64748b;">ISBN: {{ item.isbn }}</div>{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td style="padding:11px; border-bottom:1px solid #eef2f7; vertical-align:top;">
|
<td style="padding:11px; border-bottom:1px solid #eef2f7; vertical-align:top;">
|
||||||
<div style="display:inline-block; padding:3px 9px; border-radius:999px; background:#fee2e2; color:#991b1b; font-size:0.75rem; font-weight:700;">Defekt</div>
|
|
||||||
|
<!-- HIER IST DIE ÄNDERUNG: Dynamischer Status-Badge -->
|
||||||
|
<div class="badge bg-{{ item.status_color }} rounded-pill" style="font-size:0.75rem; font-weight:700; padding:4px 10px;">
|
||||||
|
{{ item.status_text }}
|
||||||
|
</div>
|
||||||
|
<!-- ENDE DER ÄNDERUNG -->
|
||||||
|
|
||||||
<div style="font-size:0.84rem; color:#475569; margin-top:6px;">Meldungen: {{ item.damage_count }}</div>
|
<div style="font-size:0.84rem; color:#475569; margin-top:6px;">Meldungen: {{ item.damage_count }}</div>
|
||||||
<div style="font-size:0.84rem; color:#475569;">Condition: {{ item.condition or '-' }}</div>
|
<div style="font-size:0.84rem; color:#475569;">Condition: {{ item.condition or '-' }}</div>
|
||||||
<div style="font-size:0.84rem; color:#475569;">Verfuegbar: {{ 'Ja' if item.available else 'Nein' }}</div>
|
<div style="font-size:0.84rem; color:#475569;">Verfuegbar: {{ 'Ja' if item.available else 'Nein' }}</div>
|
||||||
@@ -66,7 +72,12 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td style="padding:11px; border-bottom:1px solid #eef2f7; vertical-align:top;">
|
<td style="padding:11px; border-bottom:1px solid #eef2f7; vertical-align:top;">
|
||||||
|
<!-- Button wird ausgeblendet, falls das Item bereits repariert ist -->
|
||||||
|
{% if item.condition not in ['repaired', 'fixed'] %}
|
||||||
<button class="btn btn-success btn-sm" onclick="repairDamage('{{ item.id }}', this)">Als repariert markieren</button>
|
<button class="btn btn-success btn-sm" onclick="repairDamage('{{ item.id }}', this)">Als repariert markieren</button>
|
||||||
|
{% else %}
|
||||||
|
<span class="text-success" style="font-size: 0.85rem;"><i class="bi bi-check-circle"></i> Repariert</span>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -118,4 +129,4 @@ function repairDamage(itemId, button) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -4569,12 +4569,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
|
|||||||
<div class="detail-label">Code:</div>
|
<div class="detail-label">Code:</div>
|
||||||
<div class="detail-value">${escapeHtml(item.Code_4 || '-')}</div>
|
<div class="detail-value">${escapeHtml(item.Code_4 || '-')}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="detail-group">
|
|
||||||
<div class="detail-label">Anzahl:</div>
|
|
||||||
<div class="detail-value">${escapeHtml(String(item.GroupedDisplayCount || 1))}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
${isGroupedItem ? `
|
${isGroupedItem ? `
|
||||||
<div class="detail-group">
|
<div class="detail-group">
|
||||||
<div class="detail-label">Verfügbar:</div>
|
<div class="detail-label">Verfügbar:</div>
|
||||||
|
|||||||
@@ -0,0 +1,309 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Batch Upload - CSV & Bilder</title>
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--primary-color: #4a90e2;
|
||||||
|
--background-color: #f4f7f6;
|
||||||
|
--text-color: #333;
|
||||||
|
--border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
|
background-color: var(--background-color);
|
||||||
|
color: var(--text-color);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-container {
|
||||||
|
background: white;
|
||||||
|
padding: 2rem;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
||||||
|
width: 100%;
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin-top: 0;
|
||||||
|
color: var(--primary-color);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="file"] {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0.5rem;
|
||||||
|
border: 1px dashed #ccc;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
background: #fafafa;
|
||||||
|
cursor: pointer;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-submit {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0.75rem;
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-submit:hover {
|
||||||
|
background-color: #357abd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-submit:disabled {
|
||||||
|
background-color: #a0c4e8;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fortschritts- und Log-Bereich */
|
||||||
|
#uploadProgress {
|
||||||
|
margin-top: 2rem;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#progressText {
|
||||||
|
font-size: 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
color: var(--primary-color);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
progress {
|
||||||
|
width: 100%;
|
||||||
|
height: 20px;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
#logList {
|
||||||
|
margin-top: 1rem;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: #555;
|
||||||
|
max-height: 150px;
|
||||||
|
overflow-y: auto;
|
||||||
|
background: #fafafa;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logList li {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logList li:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
margin-bottom: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="upload-container">
|
||||||
|
<h2>Inventar Batch Upload</h2>
|
||||||
|
|
||||||
|
<!-- ID auf "batchUploadForm" geändert, damit das JS es findet -->
|
||||||
|
<form id="batchUploadForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="csv_file">1. items.csv Datei auswählen</label>
|
||||||
|
<input type="file" id="csv_file" name="csv_file" accept=".csv" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="images">2. Bilder auswählen</label>
|
||||||
|
<input type="file" id="images" name="images" accept="image/*" multiple required>
|
||||||
|
<small style="color: #666; display: block; margin-top: 5px;">Du kannst mehrere Bilder markieren (Strg/Cmd gedrückt halten).</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ID auf "uploadBtn" geändert -->
|
||||||
|
<button type="submit" id="uploadBtn" class="btn-submit">Daten hochladen</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- Fehlender Container für den Fortschrittsbalken und Logs hinzugefügt -->
|
||||||
|
<div id="uploadProgress">
|
||||||
|
<div id="progressText">Starte Upload...</div>
|
||||||
|
<progress id="progressBar" value="0" max="100"></progress>
|
||||||
|
<ul id="logList"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('batchUploadForm').addEventListener('submit', async function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const csvInput = document.getElementById('csv_file');
|
||||||
|
const imageInput = document.getElementById('images');
|
||||||
|
const uploadBtn = document.getElementById('uploadBtn');
|
||||||
|
const progressContainer = document.getElementById('uploadProgress');
|
||||||
|
const progressBar = document.getElementById('progressBar');
|
||||||
|
const progressText = document.getElementById('progressText');
|
||||||
|
const logList = document.getElementById('logList');
|
||||||
|
|
||||||
|
if (!csvInput.files.length) {
|
||||||
|
alert("Bitte wähle eine CSV-Datei aus.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
uploadBtn.disabled = true;
|
||||||
|
progressContainer.style.display = 'block';
|
||||||
|
logList.innerHTML = '';
|
||||||
|
|
||||||
|
const log = (msg) => {
|
||||||
|
const li = document.createElement('li');
|
||||||
|
li.textContent = msg;
|
||||||
|
logList.appendChild(li);
|
||||||
|
logList.scrollTop = logList.scrollHeight; // Auto-scroll
|
||||||
|
};
|
||||||
|
|
||||||
|
const csvFile = csvInput.files[0];
|
||||||
|
const allImages = Array.from(imageInput.files);
|
||||||
|
const BATCH_SIZE = 50;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 1. CSV-Datei lesen
|
||||||
|
const csvText = await csvFile.text();
|
||||||
|
|
||||||
|
// 2. CSV in Zeilen aufteilen
|
||||||
|
let rows = csvText.split(/\r?\n/).filter(row => row.trim().length > 0);
|
||||||
|
|
||||||
|
if (rows.length <= 1) {
|
||||||
|
throw new Error("CSV-Datei ist leer oder enthält nur Kopfzeilen.");
|
||||||
|
}
|
||||||
|
|
||||||
|
const header = rows[0];
|
||||||
|
let dataRows = rows.slice(1);
|
||||||
|
|
||||||
|
// 3. Client-seitige Deduplizierung (Entfernt exakte Duplikat-Zeilen)
|
||||||
|
const uniqueRowsSet = new Set();
|
||||||
|
const uniqueDataRows = [];
|
||||||
|
let duplicateCount = 0;
|
||||||
|
|
||||||
|
for (const row of dataRows) {
|
||||||
|
if (uniqueRowsSet.has(row)) {
|
||||||
|
duplicateCount++;
|
||||||
|
} else {
|
||||||
|
uniqueRowsSet.add(row);
|
||||||
|
uniqueDataRows.push(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log(`${uniqueDataRows.length} einzigartige Einträge gefunden. ${duplicateCount} Duplikate entfernt.`);
|
||||||
|
|
||||||
|
// Den Index der "Images" Spalte finden
|
||||||
|
const headers = header.split(',');
|
||||||
|
const imagesColIndex = headers.findIndex(h => h.trim().replace(/['"]/g, '') === 'Images');
|
||||||
|
|
||||||
|
// 4. In Batches (Häppchen) aufteilen
|
||||||
|
const batches = [];
|
||||||
|
for (let i = 0; i < uniqueDataRows.length; i += BATCH_SIZE) {
|
||||||
|
batches.push(uniqueDataRows.slice(i, i + BATCH_SIZE));
|
||||||
|
}
|
||||||
|
|
||||||
|
progressBar.max = batches.length;
|
||||||
|
progressBar.value = 0;
|
||||||
|
|
||||||
|
// 5. Batches nacheinander hochladen
|
||||||
|
for (let b = 0; b < batches.length; b++) {
|
||||||
|
const batchRows = batches[b];
|
||||||
|
progressText.textContent = `Lade Batch ${b + 1} von ${batches.length} hoch...`;
|
||||||
|
log(`Bereite Batch ${b + 1} vor (${batchRows.length} Artikel)...`);
|
||||||
|
|
||||||
|
// CSV für diesen Batch neu zusammensetzen
|
||||||
|
const batchCsvText = [header, ...batchRows].join('\n');
|
||||||
|
const batchCsvBlob = new Blob([batchCsvText], { type: 'text/csv' });
|
||||||
|
|
||||||
|
// Benötigte Bilder für diesen Batch extrahieren
|
||||||
|
const requiredImageNames = new Set();
|
||||||
|
if (imagesColIndex !== -1) {
|
||||||
|
batchRows.forEach(row => {
|
||||||
|
const cols = row.split(',');
|
||||||
|
if (cols[imagesColIndex]) {
|
||||||
|
try {
|
||||||
|
let imgStr = cols[imagesColIndex].trim().replace(/^"|"$/g, '').replace(/'/g, '"');
|
||||||
|
if (imgStr.startsWith('[') && imgStr.endsWith(']')) {
|
||||||
|
const parsedImages = JSON.parse(imgStr);
|
||||||
|
parsedImages.forEach(img => requiredImageNames.add(img));
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.warn("Konnte Bild-Array nicht parsen in Zeile:", row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bilder auf die für diesen Batch benötigten filtern
|
||||||
|
const batchImages = allImages.filter(img => requiredImageNames.has(img.name));
|
||||||
|
|
||||||
|
// FormData zusammenbauen
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('csv_file', batchCsvBlob, `batch_${b+1}.csv`);
|
||||||
|
batchImages.forEach(img => {
|
||||||
|
formData.append('images', img);
|
||||||
|
});
|
||||||
|
|
||||||
|
// An Server senden
|
||||||
|
try {
|
||||||
|
const response = await fetch('/upload_csv_batch', {
|
||||||
|
method: 'POST',
|
||||||
|
body: formData
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
if (!response.ok || !result.success) {
|
||||||
|
throw new Error(result.message || `Server antwortete mit Status ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
log(`Batch ${b + 1} erfolgreich: ${result.message}`);
|
||||||
|
} catch (batchErr) {
|
||||||
|
log(`Fehler in Batch ${b + 1}: ${batchErr.message}`);
|
||||||
|
alert(`Upload wurde bei Batch ${b + 1} aufgrund eines Fehlers abgebrochen. Prüfe die Logs.`);
|
||||||
|
break; // Stoppt weitere Uploads, wenn einer fehlschlägt
|
||||||
|
}
|
||||||
|
|
||||||
|
progressBar.value = b + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
progressText.textContent = "Upload-Vorgang abgeschlossen!";
|
||||||
|
uploadBtn.disabled = false;
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
alert("Fehler bei der Verarbeitung des Uploads: " + error.message);
|
||||||
|
log("Fehler: " + error.message);
|
||||||
|
uploadBtn.disabled = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+2
-1
@@ -17,4 +17,5 @@ cryptography>=42.0.0
|
|||||||
pywebpush
|
pywebpush
|
||||||
py-vapid>=1.9.0
|
py-vapid>=1.9.0
|
||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
pywebpush
|
pywebpush
|
||||||
|
pandas
|
||||||
Reference in New Issue
Block a user