From 971293cacf4c57edd126b9547a171c7aef54c636 Mon Sep 17 00:00:00 2001 From: Alexander Sabino <32822107+asabino2@users.noreply.github.com> Date: Sat, 9 May 2026 11:04:42 +0100 Subject: [PATCH] =?UTF-8?q?atualiza=20vers=C3=A3o=20para=200.0.4;=20corrig?= =?UTF-8?q?e=20contador=20de=20arquivos=20no=20progresso=20do=20backup=20e?= =?UTF-8?q?=20exibi=C3=A7=C3=A3o=20da=20=C3=BAltima=20vers=C3=A3o=20na=20a?= =?UTF-8?q?ba=20Sobre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +++++++- package.json | 2 +- public/app.js | 42 +++++++++++++++--------------------------- public/index.html | 5 +++++ src/backupService.js | 2 +- src/server.js | 18 +++++++++++++++++- 6 files changed, 46 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 1dca497..1002b02 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,13 @@ Versão atual: **0.0.2** --- -## � Changelog +## � Changelog### [0.0.4] — Correções de bugs + +#### Corrigido +- **Progresso do backup:** contador de arquivos processados ultrapassava o total porque `find -type f` contava apenas arquivos regulares, enquanto o `tar -v` emite uma linha por entrada (incluindo diretórios e symlinks). Corrigido removendo `-type f` do comando `find`. +- **Aba Sobre — última versão:** a verificação da versão mais recente era feita no browser, falhando dentro do Docker por restrições de rede/CORS. A requisição foi movida para o backend, que lê o `package.json` diretamente do repositório via `raw.githubusercontent.com`. + +--- ### [0.0.3] — Settings, About, i18n e autenticação #### Adicionado diff --git a/package.json b/package.json index c6306e0..66d9f90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dockerbackup-app", - "version": "0.0.3", + "version": "0.0.4", "description": "Aplicacao web para backup e restauracao de volumes Docker", "main": "src/server.js", "scripts": { diff --git a/public/app.js b/public/app.js index 7b3f710..fb7bdb2 100644 --- a/public/app.js +++ b/public/app.js @@ -1416,42 +1416,30 @@ async function loadAboutView() { const updateStatus = document.querySelector('#aboutUpdateStatus'); const updateBtn = document.querySelector('#aboutUpdateBtn'); + if (latestVerEl) latestVerEl.textContent = t('about.checking'); + try { const about = await api('/api/about'); const current = about.currentVersion || '—'; + const latest = about.latestVersion || null; + if (currentVerEl) currentVerEl.textContent = current; + if (latestVerEl) latestVerEl.textContent = latest || '—'; - // Fetch latest from GitHub - if (latestVerEl) latestVerEl.textContent = t('about.checking'); - try { - const ghRes = await fetch('https://api.github.com/repos/asabino2/dockerbackup/tags', { - headers: { Accept: 'application/vnd.github.v3+json' }, - }); - if (ghRes.ok) { - const tags = await ghRes.json(); - const latestTag = tags[0]?.name?.replace(/^v/, '') || null; - if (latestVerEl) latestVerEl.textContent = latestTag || '—'; - - if (updateWrap) updateWrap.classList.remove('hidden'); - if (latestTag && current !== latestTag) { - if (updateStatus) updateStatus.textContent = t('about.updateAvailable'); - if (updateBtn) updateBtn.classList.remove('hidden'); - } else { - if (updateStatus) updateStatus.textContent = t('about.upToDate'); - if (updateBtn) updateBtn.classList.add('hidden'); - } - } else { - if (latestVerEl) latestVerEl.textContent = '—'; - if (updateStatus) updateStatus.textContent = t('about.checkError'); - if (updateWrap) updateWrap.classList.remove('hidden'); - } - } catch { - if (latestVerEl) latestVerEl.textContent = '—'; + if (updateWrap) updateWrap.classList.remove('hidden'); + if (latest && current !== latest) { + if (updateStatus) updateStatus.textContent = t('about.updateAvailable'); + if (updateBtn) updateBtn.classList.remove('hidden'); + } else if (latest) { + if (updateStatus) updateStatus.textContent = t('about.upToDate'); + if (updateBtn) updateBtn.classList.add('hidden'); + } else { if (updateStatus) updateStatus.textContent = t('about.checkError'); - if (updateWrap) updateWrap.classList.remove('hidden'); + if (updateBtn) updateBtn.classList.add('hidden'); } } catch (error) { if (currentVerEl) currentVerEl.textContent = '—'; + if (latestVerEl) latestVerEl.textContent = '—'; showToast(error.message, true); } } diff --git a/public/index.html b/public/index.html index a79e875..3916f60 100644 --- a/public/index.html +++ b/public/index.html @@ -282,6 +282,11 @@