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 @@