Proxy update checks through the panel to avoid CORS failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-07-26 07:55:07 +03:00
co-authored by Cursor
parent b71c31605d
commit 64aa1850a0
2 changed files with 39 additions and 9 deletions
+4 -9
View File
@@ -1425,19 +1425,14 @@
downloadBtn.classList.add('hidden');
try {
const response = await fetch('https://git.evilfox.cc/api/v1/repos/test2/Amnezia-Web-Panel-main/releases/latest');
if (!response.ok) throw new Error('API Error');
const data = await response.json();
const latestVersion = data.tag_name;
const currentVersion = '{{ current_version }}';
const data = await apiCall('/api/settings/check_updates');
const latestVersion = data.latest_version || '';
statusDiv.classList.remove('hidden');
if (latestVersion !== currentVersion && latestVersion) {
if (data.update_available && latestVersion) {
statusDiv.innerHTML = `<span style="color: var(--success); font-weight: bold;">{{ _('update_available')|default('Update available') }}: ${latestVersion}</span>`;
statusDiv.style.border = '1px solid var(--success)';
downloadBtn.href = data.html_url || 'https://git.evilfox.cc/test2/Amnezia-Web-Panel-main/releases';
downloadBtn.href = data.html_url || data.releases_url || 'https://git.evilfox.cc/test2/Amnezia-Web-Panel-main/releases';
downloadBtn.classList.remove('hidden');
} else {
statusDiv.innerHTML = `<span style="color: var(--text-muted);">{{ _('up_to_date')|default('Up to date') }}</span>`;