From 32b18952e17887769da84a1a62016b54f489ac84 Mon Sep 17 00:00:00 2001 From: ash-iir <254348575+ash-iir@users.noreply.github.com> Date: Thu, 19 Nov 2026 10:37:38 +0000 Subject: [PATCH] Telegram restore: per-app list with app names Group the Telegram backups per app: one collapsed card per app with the icon, app name, package, backup count and newest date; tapping it opens one line per backup with its date, size, version and its own Pull / Delete. The actions wrap on narrow screens, the most recently backed-up app comes first, and a search box (app name or package) appears once the list is long. Uploads now pass the app label to mtproto-store in MTPROTO_STORE_LABEL, which stores it in the caption metadata that telegram-list already returns, so an app that is no longer installed still shows its name, with a small Not installed badge. The file name format is unchanged. Older mtproto-store builds ignore the variable; the list then falls back to the label of a local backup, else the package. Three new strings (ui_tg_n_backups, ui_tg_latest, ui_tg_not_installed) in every language; the search reuses search_apps and ui_job_no_match. Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com> --- module/scripts/worker.sh | 5 +- module/webroot/index.html | 3 +- module/webroot/lang/ar.json | 3 + module/webroot/lang/cs.json | 3 + module/webroot/lang/de.json | 3 + module/webroot/lang/en.js | 3 + module/webroot/lang/en.json | 3 + module/webroot/lang/es.json | 3 + module/webroot/lang/fa.json | 3 + module/webroot/lang/fr.json | 3 + module/webroot/lang/hi.json | 3 + module/webroot/lang/id.json | 3 + module/webroot/lang/it.json | 3 + module/webroot/lang/ja.json | 3 + module/webroot/lang/ko.json | 3 + module/webroot/lang/nl.json | 3 + module/webroot/lang/pl.json | 3 + module/webroot/lang/pt.json | 3 + module/webroot/lang/ru.json | 3 + module/webroot/lang/sv.json | 3 + module/webroot/lang/th.json | 3 + module/webroot/lang/tr.json | 3 + module/webroot/lang/uk.json | 3 + module/webroot/lang/vi.json | 3 + module/webroot/lang/zh.json | 3 + module/webroot/scripts.js | 125 ++++++++++++++++++++++++++++-------- module/webroot/styles.css | 29 +++++++++ 27 files changed, 204 insertions(+), 27 deletions(-) diff --git a/module/scripts/worker.sh b/module/scripts/worker.sh index cc63ee9..2f41774 100644 --- a/module/scripts/worker.sh +++ b/module/scripts/worker.sh @@ -744,7 +744,9 @@ drive_ok() { printf '%s' "$1" | "$JQ" -e '.ok==true' >/dev/null 2>&1; } # the generic store. The binary reads only $STATE/staging (root-visible) + the network. TGBIN="$(bin_or mtproto-store)" TG_STATE="$SECRETS/telegram" -tg_cmd() { MTPROTO_STORE_TAG=VDB MTPROTO_STORE_STATE="$TG_STATE" "$TGBIN" "$@" 2>/dev/null; } +# TG_LABEL (the app label, set before an upload) rides in the caption metadata as "label", so the +# Telegram list can show the app name; mtproto-store builds without it just ignore the variable. +tg_cmd() { MTPROTO_STORE_TAG=VDB MTPROTO_STORE_STATE="$TG_STATE" MTPROTO_STORE_LABEL="${TG_LABEL:-}" "$TGBIN" "$@" 2>/dev/null; } tg_ok() { printf '%s' "$1" | "$JQ" -e '.ok==true' >/dev/null 2>&1; } # check-auth returns ok:true even with no session, with a boolean .is_auth (and user/channel # only once logged in). The real auth gate is .is_auth==true, not .ok. (Verified against the @@ -920,6 +922,7 @@ transfer_full() { _tstg="$STATE/staging/tgup.$OPID"; rm -rf "$_tstg"; mkdir -p "$_tstg" exec_ns "$TAR" -C "$DEST" -c -f "$_tstg/${PKG}__${TS}_${VC}.vdb.tar" . \ || { rm -rf "$_tstg"; audit "telegram pack failed $PKG"; finish false ERR_TRANSFER; return 1; } + TG_LABEL=""; [ -n "${LABEL:-}" ] && [ "$LABEL" != "$PKG" ] && TG_LABEL="$LABEL" tg_ok "$(tg_cmd upload --dir "$_tstg" --opid "$OPID")" \ || { rm -rf "$_tstg"; audit "telegram upload failed $PKG"; finish false ERR_TRANSFER; return 1; } rm -rf "$_tstg" ;; diff --git a/module/webroot/index.html b/module/webroot/index.html index 7bea179..73b2149 100644 --- a/module/webroot/index.html +++ b/module/webroot/index.html @@ -988,7 +988,8 @@