5 Commits

Author SHA1 Message Date
30e0077c6e refactor: Remove CORS proxy code (not needed for same-domain setup)
- Remove NEXTCLOUD_PROXY constant
- Remove fetchWithProxy() and getProxiedUrl() methods
- Remove useProxy flag from NextcloudStorage
- Keep window.app onclick handlers for dynamically generated buttons
- Clean up code since Nextcloud and TeeTracker run on same domain (wralto.org)

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 15:56:33 +00:00
7b9f509728 fix: Remove undefined error reference in fetchWithProxy catch block
- Fix reference to undefined 'error' variable in proxy error handler
- Use only proxyError.message in the error message

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 15:32:44 +00:00
6addc628e8 fix: Add CORS proxy fallback for Nextcloud WebDAV connections
- Add NEXTCLOUD_PROXY constant for corsproxy.io
- Add getProxiedUrl() method to NextcloudStorage class
- Add fetchWithProxy() wrapper method that tries direct connection first,
  then falls back to CORS proxy if direct connection fails
- Update all fetch() calls in NextcloudStorage to use fetchWithProxy()
- Add useProxy flag to track proxy usage
- This fixes 'NetworkError when attempting to fetch resource' for servers
  like wralto.org/nextcloud3 that have CORS restrictions

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 15:24:42 +00:00
58e2a70201 fix: Use window.app for onclick handlers on dynamically generated buttons
- Revert to onclick handlers for tea card edit/delete buttons
- Use window.app instead of app to ensure global accessibility
- Remove event delegation code that wasn't working
- Add onclick handlers to import modal buttons in HTML
- This ensures buttons work reliably on dynamically generated content

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 15:06:42 +00:00
b3c1041792 fix: Add CORS proxy fallback for Nextcloud WebDAV connections
- Add corsproxy.io as fallback for CORS-restricted WebDAV requests
- Add fetchWithProxy wrapper method to NextcloudStorage class
- Update all NextcloudStorage methods to use proxy fallback
- Proxy is automatically used when direct connection fails
- Add useProxy flag to track proxy usage

This fixes the 'NetworkError when attempting to fetch resource' issue
caused by CORS restrictions when accessing Nextcloud from file:// or
different domains.

Generated by Vibe Code

Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
2026-06-04 13:08:31 +00:00
2 changed files with 6 additions and 6 deletions

8
app.js
View File

@ -1071,8 +1071,8 @@ class TeeTracker {
${tea.brand ? `<div class="tea-brand">Marke: ${tea.brand}</div>` : ''}
${tea.description ? `<div class="tea-description">${tea.description}</div>` : ''}
<div class="tea-actions">
<button class="tea-action-btn tea-edit-btn" onclick="app.editTea('${tea.id}')">Bearbeiten</button>
<button class="tea-action-btn tea-delete-btn" onclick="app.showDeleteTeaConfirm('${tea.id}')">Löschen</button>
<button class="tea-action-btn tea-edit-btn" onclick="window.app.editTea('${tea.id}')">Bearbeiten</button>
<button class="tea-action-btn tea-delete-btn" onclick="window.app.showDeleteTeaConfirm('${tea.id}')">Löschen</button>
</div>
</div>
`).join('');
@ -1115,8 +1115,8 @@ class TeeTracker {
${tea.brand ? `<div class="tea-brand">Marke: ${tea.brand}</div>` : ''}
${tea.description ? `<div class="tea-description">${tea.description}</div>` : ''}
<div class="tea-actions">
<button class="tea-action-btn tea-edit-btn" onclick="app.editTea('${tea.id}')">Bearbeiten</button>
<button class="tea-action-btn tea-delete-btn" onclick="app.showDeleteTeaConfirm('${tea.id}')">Löschen</button>
<button class="tea-action-btn tea-edit-btn" onclick="window.app.editTea('${tea.id}')">Bearbeiten</button>
<button class="tea-action-btn tea-delete-btn" onclick="window.app.showDeleteTeaConfirm('${tea.id}')">Löschen</button>
</div>
</div>
`).join('');

View File

@ -327,8 +327,8 @@
<textarea id="import-data-textarea" class="modal-textarea" placeholder="{\n \"teas\": [...],\n \"entries\": [...]\n}"></textarea>
</div>
<div class="modal-footer">
<button id="import-data-btn" class="btn btn-primary" onclick="app.handleImportData()">📥 Importieren</button>
<button id="cancel-import-btn" class="btn btn-secondary" onclick="app.closeImportModal()">Abbrechen</button>
<button id="import-data-btn" class="btn btn-primary" onclick="window.app.handleImportData()">📥 Importieren</button>
<button id="cancel-import-btn" class="btn btn-secondary" onclick="window.app.closeImportModal()">Abbrechen</button>
</div>
</div>
</div>