Python
1.49.0: Gesamtfortschritt beim Kopieren und Verschieben im Dateimanager
Claudef59e3fd59242
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 669510c..cb56c6b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -3,6 +3,16 @@Version numbers follow [SemVer](https://semver.org/): MAJOR.MINOR.PATCH(MAJOR = incompatible change, MINOR = new feature, PATCH = bug fix).+## 1.49.0 – 2026-11-23+- **Files: overall progress for copy and move.** While a transfer runs, a card above the lists shows the progress+ across all entries: percent and bar, bytes "x of y", files "x of y", speed, time left and the current entry+ ("Entry 2 of 5"). The total size is determined first, until then it says "Determining total size …". With+ several transfers there is an extra "Total" row. The tasks window shows the same details. Before, the percentage+ only counted per entry.+- API/MCP `list_file_tasks` now returns `bytes_done`, `bytes_total`, `files_done`, `files_total`, `speed`, `eta`,+ `item`, `items` and `current`; `progress` is now the overall value. Permissions unchanged (`files.view` to view,+ `files.edit` or `files.delete` for transfers). All 5 languages.+## 1.48.0 – 2026-11-23- **Test storage location: SFTP and FTP show the root folder.** "Test" now lists the folders in `/` for SFTP and FTPinstead of the user's home folder (for `root` that only showed `.local` and `.ssh`). The message names the listeddiff --git a/Dockerfile b/Dockerfileindex b68b62d..1fd6b2f 100644--- a/Dockerfile+++ b/Dockerfile@@ -23,7 +23,7 @@ RUN pip uninstall -y pip setuptools wheel >/dev/null 2>&1; \/usr/local/lib/python3*/site-packages/pip* /usr/local/bin/pip*COPY app/ .-ARG VERSION=1.48.0+ARG VERSION=1.49.0LABEL org.opencontainers.image.title="MirrorSync" org.opencontainers.image.version=$VERSIONENV TZ=Europe/Berlin CONFIG_DIR=/config LOG_DIR=/logs PORT=8080 PYTHONUNBUFFERED=1VOLUME ["/config", "/logs"]diff --git a/README.de.md b/README.de.mdindex a43de03..676f0ea 100644--- a/README.de.md+++ b/README.de.md@@ -4,7 +4,7 @@# MirrorSync – 1:1-Spiegelung mit Web-GUI und Zeitplänen-Version **1.48.0** · Änderungen siehe [CHANGELOG.md](CHANGELOG.md) (englisch) · [English version](README.md)+Version **1.49.0** · Änderungen siehe [CHANGELOG.md](CHANGELOG.md) (englisch) · [English version](README.md)Ein Docker-Container, der Ordner **einweg 1:1 spiegelt** (wie FreeFileSync „Spiegeln"):Das Ziel wird exakt wie die Quelle, inklusive Löschungen. Als Sync-Motor dient@@ -68,7 +68,7 @@ Geänderte Dateien werden komplett neu übertragen (kein Delta wie bei rsync).## InstallationDas fertige Image liegt in der GitHub Container Registry: `ghcr.io/dermilderjoghurt/mirrorsync`-(für amd64 und arm64, z. B. Raspberry Pi). Tags: `latest` (neueste Version), `1.48.0` (feste Version),+(für amd64 und arm64, z. B. Raspberry Pi). Tags: `latest` (neueste Version), `1.49.0` (feste Version),`1.40` (neuester Patch dieser Version). Das Image wird nur veröffentlicht, wenn sich die Versionsnummer ändert.Update-Prüfer wie Dockhand oder Watchtower melden deshalb nur dann ein Update, wenn es wirklich eine neue Version gibt.@@ -525,6 +525,10 @@ Speicherort (oder `/data`). Mit **„Zwei Speicherorte nebeneinander“** kommtsind (seit 1.31.0, Recht „Aufgaben ansehen“). Darunter alle Aufträge des Dateimanagers: Status, Prozent und Balken (blau = läuft, grün = fertig,rot = Fehler). Laufende lassen sich abbrechen, fertige einzeln oder mit „Alle fertigen entfernen“ entfernen.Klick daneben oder Esc schließt es. Man kann die Seite währenddessen verlassen.+- **Gesamtfortschritt auf der Seite Dateien (seit 1.49.0):** Während kopiert oder verschoben wird, steht über den+ Listen eine Karte mit dem Fortschritt über alle Einträge des Auftrags: Prozent und Balken, Bytes „x von y“,+ Dateien „x von y“, Geschwindigkeit, Restzeit und welcher Eintrag gerade dran ist. Zu Beginn wird kurz die+ Gesamtgröße ermittelt. Laufen mehrere Aufträge, kommt eine Zeile „Gesamt“ dazu. Abbrechen geht direkt dort.- **Rückfragen:** Löschen fragt immer nach. Gibt es im Ziel schon eine Datei oder einen Ordner mit dem Namen,fragt MirrorSync vor dem Überschreiben (beim Hochladen, Anlegen, Kopieren, Verschieben).- **Rechte:** „ansehen“ (durchsuchen, Größen, Berechtigungen, herunterladen), „bearbeiten“ (hochladen,@@ -822,7 +826,7 @@ MirrorSync kann sich selbst aktualisieren, wenn du den Docker-Socket in den Contsie entfernt und die bisherige läuft wieder. Ergebnis und Ablauf stehen in der GUI, im Audit-Log(„Update gestartet / abgeschlossen / fehlgeschlagen“) und in `config/selfupdate.json`.- **Voraussetzungen:** Das Image muss aus einem Registry kommen (`image: ghcr.io/dermilderjoghurt/mirrorsync:latest`).- Mit `build: .` gebaute Images kann MirrorSync nicht neu holen. Mit festem Versions-Tag (`:1.48.0`) wird nur dieser+ Mit `build: .` gebaute Images kann MirrorSync nicht neu holen. Mit festem Versions-Tag (`:1.49.0`) wird nur dieserTag neu geholt. `/config` muss als Volume oder Ordner eingebunden sein (ist es in der Beispiel-Compose).- **Recht:** `system.update` („MirrorSync aktualisieren“, Admins haben es automatisch). Automatik und Uhrzeitändern braucht `system.settings`.diff --git a/README.md b/README.mdindex b89ae7d..fa9eb0b 100644--- a/README.md+++ b/README.md@@ -4,7 +4,7 @@# MirrorSync – 1:1 mirroring with a web GUI and schedules-Version **1.48.0** · Changes: [CHANGELOG.md](CHANGELOG.md) · [Deutsche Version](README.de.md)+Version **1.49.0** · Changes: [CHANGELOG.md](CHANGELOG.md) · [Deutsche Version](README.de.md)A Docker container that **mirrors folders one-way, 1:1** (like FreeFileSync "Mirror"):the destination becomes an exact copy of the source, including deletions. The sync engine is@@ -67,7 +67,7 @@ Changed files are transferred completely (no delta transfer like rsync).## InstallationThe ready-made image is in the GitHub Container Registry: `ghcr.io/dermilderjoghurt/mirrorsync`-(for amd64 and arm64, e.g. Raspberry Pi). Tags: `latest` (newest version), `1.48.0` (fixed version),+(for amd64 and arm64, e.g. Raspberry Pi). Tags: `latest` (newest version), `1.49.0` (fixed version),`1.40` (newest patch of this version). The image is only published when the version number changes, soupdate checkers such as Dockhand or Watchtower only report an update when there really is a new version.@@ -512,6 +512,10 @@ at the top left. With **"Two storage locations side by side"** a second one is a"View jobs"). Below are all file manager tasks: status, percentage and bar (blue = running, green = done,red = error). Running tasks can be cancelled, finished ones removed individually or with "Remove allfinished". Clicking outside or Esc closes it. You can leave the page meanwhile.+- **Overall progress on the Files page (since 1.49.0):** while copying or moving, a card above the lists shows+ the progress across all entries of the transfer: percent and bar, bytes "x of y", files "x of y", speed, time+ left and which entry is being worked on. At the start the total size is determined briefly. With several+ transfers running, a "Total" row is added. You can cancel right there.- **Confirmations:** deleting always asks. If a file or folder with that name already exists in the destination,MirrorSync asks before overwriting (when uploading, creating, copying, moving).- **Permissions:** "view" (browse, sizes, permissions, download), "edit" (upload, edit, rename, create folders,@@ -799,7 +803,7 @@ MirrorSync can update itself if you mount the Docker socket into the container:previous one runs again. Result and steps are shown in the GUI, in the audit log ("Update started / completed /failed") and in `config/selfupdate.json`.- **Requirements:** the image has to come from a registry (`image: ghcr.io/dermilderjoghurt/mirrorsync:latest`).- MirrorSync cannot pull images built with `build: .`. With a fixed version tag (`:1.48.0`) only that tag is pulled+ MirrorSync cannot pull images built with `build: .`. With a fixed version tag (`:1.49.0`) only that tag is pulledagain. `/config` has to be a volume or bind mount (it is in the example compose file).- **Permission:** `system.update` ("Update MirrorSync", admins have it automatically). Changing the automaticupdate and its time needs `system.settings`.diff --git a/app/VERSION b/app/VERSIONindex 9db5ea1..7f3a46a 100644--- a/app/VERSION+++ b/app/VERSION@@ -1 +1 @@-1.48.0+1.49.0diff --git a/app/apigui.py b/app/apigui.pyindex 76ea58b..5aa355e 100644--- a/app/apigui.py+++ b/app/apigui.py@@ -1657,7 +1657,9 @@ def a_running(a):@action("list_file_tasks", "GET", "/files/tasks", "files.view", "Dateien",- "Kopier- und Verschiebe-Aufträge mit Status (läuft, ok, fehler, abgebrochen) und Fortschritt in Prozent.", ro=True)+ "Kopier- und Verschiebe-Aufträge mit Status (läuft, ok, fehler, abgebrochen) und Gesamtfortschritt über alle "+ "Einträge: progress (Prozent), bytes_done/bytes_total, files_done/files_total (total ist null, solange noch "+ "gezählt wird), speed (Bytes/s), eta (Sekunden), item/items (aktueller Eintrag) und current.", ro=True)def a_ftasks(a):return _fop("tasks", {})diff --git a/app/files.py b/app/files.pyindex 0d28f5f..5497cd7 100644--- a/app/files.py+++ b/app/files.py@@ -401,14 +401,17 @@ def _transfer(a, move):raise FileError(400, "Ein Ordner kann nicht in sich selbst kopiert oder verschoben werden.")if _stat(dfull):conflicts.append(name)- jobs.append((sfull, sdisp, dfull, ddisp, bool(it.get("IsDir"))))+ jobs.append((sfull, sdisp, dfull, ddisp, bool(it.get("IsDir")), int(it.get("Size") or 0)))if conflicts and not _yes(a.get("overwrite")):raise FileError(409, "Im Ziel gibt es schon: {0}. Überschreiben?", exists=True, name=", ".join(conflicts))tid = secrets.token_hex(4)t = {"id": tid, "op": "move" if move else "copy", "user": g.user, "items": [(j[1], j[3]) for j in jobs],"label": (jobs[0][1] if len(jobs) == 1 else f"{len(jobs)} Einträge") + " → " + resolve(dst_loc, dst_dir)[2],"state": "läuft", "progress": 0, "stats": "", "error": "", "started": time.strftime("%Y-%m-%d %H:%M:%S"),- "ended": "", "detail": "", "proc": None, "cancel": False, "overwrite": bool(conflicts)}+ "ended": "", "detail": "", "proc": None, "cancel": False, "overwrite": bool(conflicts),+ # Gesamtfortschritt ueber alle Eintraege (Bytes und Dateien), Tempo in Bytes/s, Restzeit in Sekunden+ "phase": "", "bytes_done": 0, "bytes_total": None, "files_done": 0, "files_total": None,+ "speed": 0, "eta": None, "item": 0, "items": len(jobs), "current": ""}with _tlock:_tasks[tid] = tfor old in sorted(_tasks, key=lambda k: _tasks[k]["started"])[:-TASKS_KEEP]:@@ -422,12 +425,60 @@ def _transfer(a, move):STATS_RE = re.compile(r"(\d+)%")+def _count(jobs, t):+ """Im Hintergrund zaehlen: Groesse und Anzahl Dateien je Eintrag (Ordner per rclone size), danach die Summe.+ Das Kopieren startet sofort, die Summe kommt dazu, sobald sie feststeht."""+ sizes = []+ for sfull, _sd, _df, _dd, is_dir, size in jobs:+ if t["cancel"] or t["state"] != "läuft":+ return+ if not is_dir:+ sizes.append((size, 1))+ else:+ try:+ rc, out, _e = _rc("size", "--json", sfull, timeout=900)+ d = json.loads(out) if rc == 0 else None+ except (FileError, ValueError):+ d = None+ sizes.append((int(d.get("bytes") or 0), int(d.get("count") or 0)) if d else (None, None))+ t["_sizes"] = list(sizes)+ if all(b is not None for b, _ in sizes):+ t["bytes_total"] = sum(b for b, _ in sizes)+ t["files_total"] = sum(n for _, n in sizes)+++def _update(t, base_b, base_f, item_b, item_f, st):+ """Stand eines rclone-Laufs (stats aus --use-json-log) in den Gesamtfortschritt umrechnen."""+ b = int(st.get("bytes") or 0)+ f = int(st.get("transfers") or 0) + int(st.get("checks") or 0)+ if item_b is not None:+ b = min(b, item_b)+ if item_f is not None:+ f = min(f, item_f)+ t["bytes_done"], t["files_done"] = base_b + b, base_f + f+ t["speed"] = int(st.get("speed") or 0)+ if t["bytes_total"]:+ t["progress"] = min(99, int(t["bytes_done"] * 100 / t["bytes_total"]))+ left = t["bytes_total"] - t["bytes_done"]+ t["eta"] = int(left / t["speed"]) if t["speed"] > 0 else None+ elif st.get("totalBytes"):+ t["progress"] = min(99, int(int(st.get("bytes") or 0) * 100 / int(st["totalBytes"])))+ t["eta"] = st.get("eta")++def _run_task(t, jobs, move, ip):- for sfull, sdisp, dfull, ddisp, is_dir in jobs:+ threading.Thread(target=_count, args=(jobs, t), daemon=True).start()+ t["phase"] = "move" if move else "copy"+ base_b = base_f = 0+ for idx, (sfull, sdisp, dfull, ddisp, is_dir, _size) in enumerate(jobs):if t["cancel"]:break+ sizes = t.get("_sizes") or []+ item_b, item_f = sizes[idx] if idx < len(sizes) else ((_size, 1) if not is_dir else (None, None))+ last = {}+ t["item"], t["current"] = idx + 1, sdispverb = ("move" if move else "copy") if is_dir else ("moveto" if move else "copyto")- cmd = ["rclone", "--config", core.RCLONE_CONF, verb, sfull, dfull,+ cmd = ["rclone", "--config", core.RCLONE_CONF, verb, sfull, dfull, "--use-json-log","--stats", "1s", "--stats-one-line", "--stats-log-level", "NOTICE"]if move and is_dir:cmd.append("--delete-empty-src-dirs")@@ -435,19 +486,31 @@ def _run_task(t, jobs, move, ip):t["proc"] = ptail = []for line in p.stderr:- line = re.sub(r"^\d{4}/\d\d/\d\d \d\d:\d\d:\d\d\s+", "", line.strip())+ line = line.strip()if not line:continue- if line.startswith("NOTICE:") and "%" in line:- t["stats"] = line[7:].strip()- m = STATS_RE.search(line)- if m:- t["progress"] = int(m.group(1))- else:- tail = (tail + [line])[-5:]+ try:+ ev = json.loads(line)+ except ValueError:+ ev = {"msg": re.sub(r"^\d{4}/\d\d/\d\d \d\d:\d\d:\d\d\s+", "", line)}+ msg = str(ev.get("msg") or "").strip()+ if isinstance(ev.get("stats"), dict):+ t["stats"] = msg+ last = ev["stats"]+ _update(t, base_b, base_f, item_b, item_f, last)+ elif msg:+ tail = (tail + [msg])[-5:]rc = p.wait()if rc == 0 and move and is_dir:subprocess.run(["rclone", "--config", core.RCLONE_CONF, "rmdirs", sfull], capture_output=True, timeout=300)+ if rc == 0: # Eintrag fertig: ganz zaehlen (auch uebersprungene, schon gleiche Dateien)+ sizes = t.get("_sizes") or []+ item_b, item_f = sizes[idx] if idx < len(sizes) else (item_b, item_f)+ base_b += item_b if item_b is not None else int(last.get("bytes") or 0)+ base_f += item_f if item_f is not None else int(last.get("transfers") or 0) + int(last.get("checks") or 0)+ t["bytes_done"], t["files_done"] = max(t["bytes_done"], base_b), max(t["files_done"], base_f)+ if t["bytes_total"]:+ t["progress"] = min(99, int(t["bytes_done"] * 100 / t["bytes_total"])) if idx + 1 < len(jobs) else t["progress"]if t["cancel"]:t["state"], t["error"] = "abgebrochen", ""elif rc != 0:@@ -469,13 +532,16 @@ def _run_task(t, jobs, move, ip):if t["state"] != "läuft":breakif t["state"] == "läuft":- t["state"], t["progress"] = "ok", 100+ t["state"], t["progress"], t["eta"], t["speed"] = "ok", 100, 0, 0+ if t["bytes_total"] is not None:+ t["bytes_done"], t["files_done"] = t["bytes_total"], t["files_total"]+ t["phase"] = ""t["ended"] = time.strftime("%Y-%m-%d %H:%M:%S")t["proc"] = Nonedef _task_view(t):- return {k: v for k, v in t.items() if k not in ("proc", "cancel")}+ return {k: v for k, v in t.items() if k not in ("proc", "cancel") and not k.startswith("_")}def _mine(t):diff --git a/app/i18n/en.json b/app/i18n/en.jsonindex 87969b4..ecc568e 100644--- a/app/i18n/en.json+++ b/app/i18n/en.json@@ -916,7 +916,6 @@"Konto sperren nach so vielen Fehlversuchen": "Lock account after this many failed attempts","Konto {0}": "Account {0}","Kopier- und Verschiebe-Aufträge des Dateimanagers": "Copy and move tasks of the file manager",- "Kopier- und Verschiebe-Aufträge mit Status (läuft, ok, fehler, abgebrochen) und Fortschritt in Prozent.": "Copy and move tasks with status (läuft = running, ok, fehler = error, abgebrochen = cancelled) and progress in percent.","Kopieren": "Copy","Kopieren abgebrochen": "Copy cancelled","Kopieren fehlgeschlagen": "Copy failed",@@ -2212,5 +2211,12 @@"Jetzt prüfen": "Check now","Höher als das Stammverzeichnis geht es nicht.": "You cannot go higher than the root folder.","Verbindung eines Speicherorts testen (listet die Ordner der obersten Ebene, bei SFTP und FTP das Stammverzeichnis /).": "Test the connection of a storage location (lists the top-level folders, for SFTP and FTP the root folder /).",- "Verbindung zu '{0}' OK. Ordner in „{1}“:\n{2}": "Connection to “{0}” OK. Folders in “{1}”:\n{2}"+ "Verbindung zu '{0}' OK. Ordner in „{1}“:\n{2}": "Connection to “{0}” OK. Folders in “{1}”:\n{2}",+ "noch ca. {0}": "about {0} left",+ "Gesamtgröße wird ermittelt …": "Determining total size …",+ "Gesamt": "Total",+ "{0} Aufträge": "{0} transfers",+ "Kopier- und Verschiebe-Aufträge mit Status (läuft, ok, fehler, abgebrochen) und Gesamtfortschritt über alle Einträge: progress (Prozent), bytes_done/bytes_total, files_done/files_total (total ist null, solange noch gezählt wird), speed (Bytes/s), eta (Sekunden), item/items (aktueller Eintrag) und current.": "Copy and move transfers with status (läuft, ok, fehler, abgebrochen) and overall progress across all entries: progress (percent), bytes_done/bytes_total, files_done/files_total (total is null while still counting), speed (bytes/s), eta (seconds), item/items (current entry) and current.",+ "Eintrag {0} von {1}": "Entry {0} of {1}",+ "{0} von {1} Dateien": "{0} of {1} files"}diff --git a/app/i18n/es.json b/app/i18n/es.jsonindex fe79c10..8e1888a 100644--- a/app/i18n/es.json+++ b/app/i18n/es.json@@ -916,7 +916,6 @@"Konto sperren nach so vielen Fehlversuchen": "Bloquear la cuenta tras estos intentos fallidos","Konto {0}": "Cuenta {0}","Kopier- und Verschiebe-Aufträge des Dateimanagers": "Tareas de copia y movimiento del gestor de archivos",- "Kopier- und Verschiebe-Aufträge mit Status (läuft, ok, fehler, abgebrochen) und Fortschritt in Prozent.": "Tareas de copia y movimiento con estado (läuft = en curso, ok, fehler = error, abgebrochen = cancelada) y progreso en porcentaje.","Kopieren": "Copiar","Kopieren abgebrochen": "Copia cancelada","Kopieren fehlgeschlagen": "Copia fallida",@@ -2212,5 +2211,12 @@"Jetzt prüfen": "Comprobar ahora","Höher als das Stammverzeichnis geht es nicht.": "No se puede subir más allá de la carpeta raíz.","Verbindung eines Speicherorts testen (listet die Ordner der obersten Ebene, bei SFTP und FTP das Stammverzeichnis /).": "Probar la conexión de una ubicación (lista las carpetas del nivel superior, en SFTP y FTP la carpeta raíz /).",- "Verbindung zu '{0}' OK. Ordner in „{1}“:\n{2}": "Conexión con «{0}» correcta. Carpetas en «{1}»:\n{2}"+ "Verbindung zu '{0}' OK. Ordner in „{1}“:\n{2}": "Conexión con «{0}» correcta. Carpetas en «{1}»:\n{2}",+ "noch ca. {0}": "quedan aprox. {0}",+ "Gesamtgröße wird ermittelt …": "Calculando el tamaño total …",+ "Gesamt": "Total",+ "{0} Aufträge": "{0} trabajos",+ "Kopier- und Verschiebe-Aufträge mit Status (läuft, ok, fehler, abgebrochen) und Gesamtfortschritt über alle Einträge: progress (Prozent), bytes_done/bytes_total, files_done/files_total (total ist null, solange noch gezählt wird), speed (Bytes/s), eta (Sekunden), item/items (aktueller Eintrag) und current.": "Trabajos de copiar y mover con estado (läuft, ok, fehler, abgebrochen) y progreso total de todas las entradas: progress (porcentaje), bytes_done/bytes_total, files_done/files_total (total es null mientras se cuenta), speed (bytes/s), eta (segundos), item/items (entrada actual) y current.",+ "Eintrag {0} von {1}": "Entrada {0} de {1}",+ "{0} von {1} Dateien": "{0} de {1} archivos"}diff --git a/app/i18n/fr.json b/app/i18n/fr.jsonindex baa0605..361e91b 100644--- a/app/i18n/fr.json+++ b/app/i18n/fr.json@@ -916,7 +916,6 @@"Konto sperren nach so vielen Fehlversuchen": "Verrouiller le compte après ce nombre d’échecs","Konto {0}": "Compte {0}","Kopier- und Verschiebe-Aufträge des Dateimanagers": "Tâches de copie et de déplacement du gestionnaire de fichiers",- "Kopier- und Verschiebe-Aufträge mit Status (läuft, ok, fehler, abgebrochen) und Fortschritt in Prozent.": "Tâches de copie et de déplacement avec état (läuft = en cours, ok, fehler = erreur, abgebrochen = annulée) et progression en pourcentage.","Kopieren": "Copier","Kopieren abgebrochen": "Copie annulée","Kopieren fehlgeschlagen": "Échec de la copie",@@ -2212,5 +2211,12 @@"Jetzt prüfen": "Vérifier maintenant","Höher als das Stammverzeichnis geht es nicht.": "Impossible de remonter au-delà du dossier racine.","Verbindung eines Speicherorts testen (listet die Ordner der obersten Ebene, bei SFTP und FTP das Stammverzeichnis /).": "Tester la connexion d'un emplacement (liste les dossiers du premier niveau, pour SFTP et FTP le dossier racine /).",- "Verbindung zu '{0}' OK. Ordner in „{1}“:\n{2}": "Connexion à « {0} » OK. Dossiers dans « {1} » :\n{2}"+ "Verbindung zu '{0}' OK. Ordner in „{1}“:\n{2}": "Connexion à « {0} » OK. Dossiers dans « {1} » :\n{2}",+ "noch ca. {0}": "encore env. {0}",+ "Gesamtgröße wird ermittelt …": "Calcul de la taille totale …",+ "Gesamt": "Total",+ "{0} Aufträge": "{0} transferts",+ "Kopier- und Verschiebe-Aufträge mit Status (läuft, ok, fehler, abgebrochen) und Gesamtfortschritt über alle Einträge: progress (Prozent), bytes_done/bytes_total, files_done/files_total (total ist null, solange noch gezählt wird), speed (Bytes/s), eta (Sekunden), item/items (aktueller Eintrag) und current.": "Transferts de copie et de déplacement avec statut (läuft, ok, fehler, abgebrochen) et progression totale sur toutes les entrées : progress (pourcentage), bytes_done/bytes_total, files_done/files_total (total vaut null pendant le comptage), speed (octets/s), eta (secondes), item/items (entrée en cours) et current.",+ "Eintrag {0} von {1}": "Entrée {0} sur {1}",+ "{0} von {1} Dateien": "{0} fichiers sur {1}"}diff --git a/app/i18n/it.json b/app/i18n/it.jsonindex 313cd6a..4f70889 100644--- a/app/i18n/it.json+++ b/app/i18n/it.json@@ -916,7 +916,6 @@"Konto sperren nach so vielen Fehlversuchen": "Blocca l’account dopo questi tentativi falliti","Konto {0}": "Account {0}","Kopier- und Verschiebe-Aufträge des Dateimanagers": "Operazioni di copia e spostamento della gestione file",- "Kopier- und Verschiebe-Aufträge mit Status (läuft, ok, fehler, abgebrochen) und Fortschritt in Prozent.": "Operazioni di copia e spostamento con stato (läuft = in corso, ok, fehler = errore, abgebrochen = annullata) e avanzamento in percentuale.","Kopieren": "Copia","Kopieren abgebrochen": "Copia annullata","Kopieren fehlgeschlagen": "Copia non riuscita",@@ -2212,5 +2211,12 @@"Jetzt prüfen": "Controlla ora","Höher als das Stammverzeichnis geht es nicht.": "Non si può salire oltre la cartella radice.","Verbindung eines Speicherorts testen (listet die Ordner der obersten Ebene, bei SFTP und FTP das Stammverzeichnis /).": "Testare la connessione di una posizione (elenca le cartelle del livello superiore, per SFTP e FTP la cartella radice /).",- "Verbindung zu '{0}' OK. Ordner in „{1}“:\n{2}": "Connessione a «{0}» OK. Cartelle in «{1}»:\n{2}"+ "Verbindung zu '{0}' OK. Ordner in „{1}“:\n{2}": "Connessione a «{0}» OK. Cartelle in «{1}»:\n{2}",+ "noch ca. {0}": "ancora circa {0}",+ "Gesamtgröße wird ermittelt …": "Calcolo della dimensione totale …",+ "Gesamt": "Totale",+ "{0} Aufträge": "{0} trasferimenti",+ "Kopier- und Verschiebe-Aufträge mit Status (läuft, ok, fehler, abgebrochen) und Gesamtfortschritt über alle Einträge: progress (Prozent), bytes_done/bytes_total, files_done/files_total (total ist null, solange noch gezählt wird), speed (Bytes/s), eta (Sekunden), item/items (aktueller Eintrag) und current.": "Trasferimenti di copia e spostamento con stato (läuft, ok, fehler, abgebrochen) e avanzamento totale su tutte le voci: progress (percentuale), bytes_done/bytes_total, files_done/files_total (total è null finché si conta), speed (byte/s), eta (secondi), item/items (voce attuale) e current.",+ "Eintrag {0} von {1}": "Voce {0} di {1}",+ "{0} von {1} Dateien": "{0} di {1} file"}diff --git a/app/templates.py b/app/templates.pyindex 986b228..8adc937 100644--- a/app/templates.py+++ b/app/templates.py@@ -181,6 +181,18 @@ const esc=t=>String(t??'').replace(/[&<>"]/g,c=>({'&':'&','<':'<','>':'&gconst op=async(name,body)=>{try{const r=await fetch('/files/op/'+name,{method:'POST',headers:{'Content-Type':'application/json','Accept':'application/json'},body:JSON.stringify(body||{})});return await r.json()}catch(e){return {ok:false}}};const COL={'läuft':'var(--acc)','ok':'var(--ok)','fehler':'var(--err)','abgebrochen':'var(--mut)'};const STT={'läuft':'läuft','ok':'fertig','fehler':'Fehler','abgebrochen':'abgebrochen'};+const msF=(x,...a)=>a.reduce((y,v,i)=>y.split('{'+i+'}').join(v),x);+const msB=window.msB=n=>{const u=['B','KB','MB','GB','TB'];let i=0;n=+n||0;while(n>=1024&&i<4){n/=1024;i++}return (i?n.toFixed(n<10?1:0):n)+' '+u[i]};+const msT=s=>{s=Math.round(+s||0);return s>=3600?Math.floor(s/3600)+' h '+Math.round(s%3600/60)+' min':s>=60?Math.floor(s/60)+' min '+(s%60)+' s':s+' s'};+/* Gesamtfortschritt eines Kopier-/Verschiebe-Auftrags als Text: Dateien x von y, Bytes, Tempo, Restzeit */+window.msTaskLine=t=>{const p=[];const run=t.state==='läuft';+ if(t.items>1&&run)p.push(msF('Eintrag {0} von {1}',t.item||1,t.items));+ if(t.files_total!=null)p.push(msF('{0} von {1} Dateien',t.files_done||0,t.files_total));else if(t.files_done)p.push(msF('{0} Dateien',t.files_done));+ if(t.bytes_total!=null)p.push(msB(t.bytes_done)+' '+'von'+' '+msB(t.bytes_total));else if(t.bytes_done)p.push(msB(t.bytes_done));+ if(run&&t.speed)p.push(msB(t.speed)+'/s');+ if(run&&t.eta!=null&&t.speed)p.push(msF('noch ca. {0}',msT(t.eta)));+ if(run&&t.bytes_total==null)p.push('Gesamtgröße wird ermittelt …');+ return p.join(' · ')};async function jobsPoll(){if(!CAN_JOBS)return 0;let d;try{d=await (await fetch('/jobs/running',{headers:{'Accept':'application/json'}})).json()}catch(e){return 0}const el=document.getElementById('jobrun');if(!el||!d.ok)return 0;const L=d.jobs;el.innerHTML='<div style="display:flex;align-items:center;gap:10px;margin-bottom:6px"><b>'+'Laufende Aufgaben'+'</b><span style="flex:1"></span>'+'<button type="button" class="btn sm" onclick="msTasksToggle()" title="'+'Schließen'+'">✕</button>'+'</div>'+@@ -195,13 +207,14 @@ async function poll(){clearTimeout(TT);const jr=await jobsPoll();document.getElementById('taskbtn').classList.toggle('pri',run+jr>0);if(!CAN_FILES){TT=setTimeout(poll,jr?2000:(open?3000:10000));return}document.getElementById('tasks').innerHTML=d.tasks.length?d.tasks.map(t=>{const lab=t.op==='move'?'Verschieben':'Kopieren';const pc=t.state==='ok'?100:(t.progress||0);- return '<div class="fm-task"><div style="flex:1;min-width:0"><b>'+esc(lab)+'</b> '+esc(t.label)+'<br><small class="mut">'+esc(t.started)+(t.stats&&t.state==='läuft'?' · '+esc(t.stats):'')+'</small>'+(t.error?'<br><small style="color:var(--err)">'+esc(t.error)+'</small>':'')+'</div>'++ return '<div class="fm-task"><div style="flex:1;min-width:0"><b>'+esc(lab)+'</b> '+esc(t.label)+'<br><small class="mut">'+esc(t.started)+(msTaskLine(t)?' · '+esc(msTaskLine(t)):(t.stats&&t.state==='läuft'?' · '+esc(t.stats):''))+'</small>'+(t.error?'<br><small style="color:var(--err)">'+esc(t.error)+'</small>':'')+'</div>'+'<span class="tag" style="color:'+COL[t.state]+';white-space:nowrap">'+esc(STT[t.state]||t.state)+' · '+pc+' %</span>'+'<div class="fm-bar" title="'+pc+' %"><i style="width:'+pc+'%;background:'+COL[t.state]+'"></i></div>'+(CAN_EDIT?(t.state==='läuft'?'<button type="button" class="btn sm" data-c="'+t.id+'">'+'Abbrechen'+'</button>':'<button type="button" class="btn sm" data-r="'+t.id+'">'+'Entfernen'+'</button>'):'')+'</div>'}).join(''):'<div class="mut">'+'Keine Aufträge.'+'</div>';document.querySelectorAll('#tasks [data-c]').forEach(x=>x.onclick=async()=>{await op('cancel',{task_id:x.dataset.c});poll()});document.querySelectorAll('#tasks [data-r]').forEach(x=>x.onclick=async()=>{await op('remove_tasks',{task_id:x.dataset.r});poll()});const cb=document.getElementById('clrtasks');if(cb)cb.style.display=d.tasks.some(t=>t.state!=='läuft')?'':'none';+ if(window.onTasksUpdate)window.onTasksUpdate(d.tasks);if(wasRun&&!run&&window.onTasksDone)window.onTasksDone();wasRun=run>0;TT=setTimeout(poll,run?800:(jr?2000:(open?3000:10000)));}window.msPoll=()=>{wasRun=true;poll()};@@ -928,6 +941,10 @@ const PVUP={can:{{ can("remotes.browse")|tojson }},cache:{},.fm .nm{cursor:pointer;overflow-wrap:anywhere;min-width:140px}.fm td.nw,.fm th.nw{white-space:nowrap}.fm .nm:hover{color:var(--acc)}.fm .ico{display:inline-block;width:18px;vertical-align:-3px;margin-right:4px}.fm .ico svg{width:16px;height:16px}.fm .acts{white-space:nowrap;text-align:right;width:1%}.fmmenu{position:relative;display:inline-block}.fmmenu>summary{list-style:none;cursor:pointer;padding:2px 10px;border:1px solid var(--bd2);border-radius:6px;font-weight:700}.fmmenu>summary::-webkit-details-marker{display:none}.fmmenu>div{position:absolute;right:0;top:calc(100% + 4px);z-index:30;background:var(--card);border:1px solid var(--bd);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.18);padding:4px;min-width:170px;display:flex;flex-direction:column}.fmmenu>div>*{text-align:left;background:none;border:0;padding:7px 10px;border-radius:6px;color:var(--fg);cursor:pointer;font:inherit;text-decoration:none}.fmmenu>div>*:hover{background:var(--acc-soft)}.fmmenu>div>div.mut:hover{background:none}.fmmenu>div>hr{border:0;border-top:1px solid var(--bd);margin:4px 2px;padding:0;border-radius:0}.fm-scroll{overflow:auto;min-height:220px;border:1px solid var(--bd);border-radius:8px}+.fmprog{padding:10px 14px}.fmprow{display:flex;gap:12px;align-items:center;padding:6px 0;border-bottom:1px solid var(--bd)}.fmprow:last-child{border-bottom:0}+.fmpt{flex:1;min-width:0;overflow-wrap:anywhere}.fmpc{white-space:nowrap;min-width:56px;text-align:right}.fmpbar{flex:0 0 min(320px,30vw);height:10px;background:var(--bd);border-radius:5px;overflow:hidden}+.fmpbar i{display:block;height:100%;background:var(--acc);transition:width .4s}.fmprow.tot{border-bottom:2px solid var(--bd2)}+@media(max-width:700px){.fmprow{flex-wrap:wrap}.fmpbar{flex:1 1 100%}}.fm-dlg{border:1px solid var(--bd);border-radius:12px;background:var(--card);color:var(--fg);padding:18px;width:min(560px,94vw)}.fm-dlg.big{width:min(1100px,96vw)}.fm-dlg::backdrop{background:rgba(0,0,0,.45)}.fm-dlg textarea{width:100%;min-height:55vh;font-family:var(--mono,monospace);font-size:13px}@@ -935,6 +952,7 @@ const PVUP={can:{{ can("remotes.browse")|tojson }},cache:{},</style>{% if not locations %}<div class="card"><div class="empty">Keine Speicherorte, die du sehen darfst. Unter <a href="/remotes">Speicherorte</a> anlegen.</div></div>{% else %}<div class="card" style="padding:12px 14px"><label class="check" style="margin:0"><input type="checkbox" id="dualchk" onchange="setDual(this.checked)"> Zwei Speicherorte nebeneinander (Kopieren und Verschieben zwischen beiden)</label></div>+<div class="card fmprog" id="fmprog" hidden></div><div class="fm-wrap" id="fmwrap">{% for side in ["a", "b"] %}<div class="card fm" id="fm_{{ side }}" {{ 'style=display:none' if side == "b" }}><div class="fm-head"><b>{{ "Links" if side == "a" else "Rechts" }}</b><select class="loc" onchange="P.{{ side }}.open(this.value,'')">{% for l in locations %}<option value="{{ l.id }}">{{ l.label }} ({{ l.type }})</option>{% endfor %}</select>@@ -1136,6 +1154,20 @@ function setDual(on){DUAL=on;document.getElementById('fm_b').style.display=on?''if(on&&!P.b.entries.length)P.b.open(P.b.loc,P.b.path);P.a.tools();P.b.tools();saveState();fitPanes();}function saveState(){const q=new URLSearchParams({a:P.a.loc,ap:P.a.path});if(DUAL){q.set('b',P.b.loc);q.set('bp',P.b.path)}history.replaceState(null,'','/files?'+q)}window.onTasksDone=()=>{P.a.reload();if(DUAL)P.b.reload()};+/* Gesamtfortschritt laufender (und gerade fertiger) Kopier- und Verschiebe-Auftraege direkt auf der Seite */+const PROG_SEEN={};+window.onTasksUpdate=tasks=>{const box=document.getElementById('fmprog');const now=Date.now();+ const show=tasks.filter(t=>{if(t.state==='läuft'){PROG_SEEN[t.id]=now;return true}return PROG_SEEN[t.id]&&now-PROG_SEEN[t.id]<8000});+ if(!show.length){box.hidden=true;return}box.hidden=false;+ const run=show.filter(t=>t.state==='läuft');let h='';+ if(run.length>1){const bt=run.every(t=>t.bytes_total!=null)?run.reduce((a,t)=>a+t.bytes_total,0):null,bd=run.reduce((a,t)=>a+(t.bytes_done||0),0);+ const pc=bt?Math.min(99,Math.floor(bd*100/bt)):Math.round(run.reduce((a,t)=>a+(t.progress||0),0)/run.length);+ h+='<div class="fmprow tot"><div class="fmpt"><b>'+'Gesamt'+'</b> <span class="mut">'+fill('{0} Aufträge',run.length)+'</span><br><small class="mut">'+(bt!=null?esc(msB(bd)+' '+'von'+' '+msB(bt)):'')+'</small></div><b class="fmpc">'+pc+' %</b><div class="fmpbar"><i style="width:'+pc+'%"></i></div></div>'}+ h+=show.map(t=>{const pc=t.state==='ok'?100:(t.progress||0),col={'läuft':'var(--acc)','ok':'var(--ok)','fehler':'var(--err)','abgebrochen':'var(--mut)'}[t.state];+ return '<div class="fmprow"><div class="fmpt"><b>'+(t.op==='move'?'Verschieben':'Kopieren')+'</b> '+esc(t.label)+'<br><small class="mut">'+esc(msTaskLine(t)||t.stats||'')+'</small>'+(t.error?'<br><small style="color:var(--err)">'+esc(t.error)+'</small>':'')+'</div>'++ '<b class="fmpc" style="color:'+col+'">'+(t.state==='läuft'?pc+' %':({'ok':'fertig','fehler':'Fehler','abgebrochen':'abgebrochen'}[t.state]))+'</b><div class="fmpbar"><i style="width:'+pc+'%;background:'+col+'"></i></div>'++ (t.state==='läuft'&&CAN_EDIT?'<button type="button" class="btn sm" data-pc="'+esc(t.id)+'">'+'Abbrechen'+'</button>':'')+'</div>'}).join('');+ box.innerHTML=h;box.querySelectorAll('[data-pc]').forEach(x=>x.onclick=async()=>{await op('cancel',{task_id:x.dataset.pc});window.msPoll&&window.msPoll()})};function fitPanes(){document.querySelectorAll('.fm-scroll').forEach(sc=>{if(!sc.offsetParent)return;const card=sc.closest('.fm');const bottom=card.getBoundingClientRect().bottom+window.scrollY, h=sc.getBoundingClientRect().height;sc.style.height=Math.max(220,Math.round(h-(bottom-(window.innerHeight-16))))+'px'})}diff --git a/docker-compose.yml b/docker-compose.ymlindex ed33fb4..28298b3 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -8,7 +8,7 @@services:mirrorsync:- image: ghcr.io/dermilderjoghurt/mirrorsync:latest # or a fixed version, e.g. :1.48.0+ image: ghcr.io/dermilderjoghurt/mirrorsync:latest # or a fixed version, e.g. :1.49.0# Build it yourself instead of pulling (Dockerfile and app/ in the same folder):# build: .container_name: mirrorsync