mirror of
https://github.com/trevor1969/teatracker.git
synced 2026-08-09 10:41:59 +00:00
feat: Add Nextcloud WebDAV integration for cross-device synchronization
- Add NextcloudStorage class with WebDAV API support - Add Settings tab with Nextcloud configuration - Pre-configure with user's Nextcloud credentials (wralto.org/nextcloud3) - Auto-test and enable Nextcloud sync on app startup - Add data export/import functionality - Add backup/restore capabilities - Add clear data confirmation - Add sync status indicator - Add statistics overview in settings - Fallback to localStorage if Nextcloud unavailable - All existing features preserved (Bio checkbox, today period, recent entries) Generated by Vibe Code Co-authored-by: trevor1969 <trevor1969@users.noreply.github.com>
This commit is contained in:
103
index.html
103
index.html
@ -18,6 +18,7 @@
|
|||||||
<button class="tab-button" data-tab="teas">Tee-Sorten</button>
|
<button class="tab-button" data-tab="teas">Tee-Sorten</button>
|
||||||
<button class="tab-button" data-tab="track">Tracken</button>
|
<button class="tab-button" data-tab="track">Tracken</button>
|
||||||
<button class="tab-button" data-tab="stats">Statistiken</button>
|
<button class="tab-button" data-tab="stats">Statistiken</button>
|
||||||
|
<button class="tab-button" data-tab="settings">⚙️ Einstellungen</button>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<main class="tab-content">
|
<main class="tab-content">
|
||||||
@ -117,6 +118,90 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- Einstellungen Tab -->
|
||||||
|
<section id="settings" class="tab-pane">
|
||||||
|
<h2>⚙️ Einstellungen</h2>
|
||||||
|
|
||||||
|
<div class="settings-section">
|
||||||
|
<h3>🌐 Nextcloud-Synchronisation</h3>
|
||||||
|
<p>Verbinde TeeTracker mit deiner Nextcloud-Instanz für plattformübergreifende Synchronisation.</p>
|
||||||
|
|
||||||
|
<div class="form-group checkbox-group">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" id="nc-enabled">
|
||||||
|
<span class="checkmark"></span>
|
||||||
|
Nextcloud-Synchronisation aktivieren
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nc-config" style="display: none;">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nc-url">Nextcloud-URL *</label>
|
||||||
|
<input type="url" id="nc-url" placeholder="https://deine-nextcloud.de" value="https://wralto.org/nextcloud3">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nc-username">Benutzername *</label>
|
||||||
|
<input type="text" id="nc-username" placeholder="Dein Nextcloud-Benutzername" value="teetracker">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nc-password">App-Passwort *</label>
|
||||||
|
<input type="password" id="nc-password" placeholder="App-Passwort aus Nextcloud" value="ruebennasenhausen!2026">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nc-path">Speicherpfad</label>
|
||||||
|
<input type="text" id="nc-path" placeholder="/TeeTracker/" value="/TeeTracker/">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-actions">
|
||||||
|
<button id="test-nc-connection" class="btn btn-secondary">🔍 Verbindung testen</button>
|
||||||
|
<button id="save-nc-config" class="btn btn-primary">💾 Speichern</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nc-status" class="status-message"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="settings-section">
|
||||||
|
<h3>💾 Datenverwaltung</h3>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Synchronisationsstatus</label>
|
||||||
|
<div id="sync-status" class="status-badge">Lokaler Modus</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-actions">
|
||||||
|
<button id="export-data" class="btn btn-secondary">📤 Daten exportieren</button>
|
||||||
|
<button id="import-data" class="btn btn-secondary">📥 Daten importieren</button>
|
||||||
|
<button id="clear-data" class="btn btn-danger">🗑️ Alle Daten löschen</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="settings-section">
|
||||||
|
<h3>📊 Statistik</h3>
|
||||||
|
<div class="stats-overview">
|
||||||
|
<div class="stat-item">
|
||||||
|
<span class="stat-label">Gesamt Tassen:</span>
|
||||||
|
<span id="settings-total-cups">0</span>
|
||||||
|
</div>
|
||||||
|
<div class="stat-item">
|
||||||
|
<span class="stat-label">Tee-Sorten:</span>
|
||||||
|
<span id="settings-total-teas">0</span>
|
||||||
|
</div>
|
||||||
|
<div class="stat-item">
|
||||||
|
<span class="stat-label">Erster Eintrag:</span>
|
||||||
|
<span id="settings-first-entry">-</span>
|
||||||
|
</div>
|
||||||
|
<div class="stat-item">
|
||||||
|
<span class="stat-label">Letzter Eintrag:</span>
|
||||||
|
<span id="settings-last-entry">-</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<!-- Statistiken Tab -->
|
<!-- Statistiken Tab -->
|
||||||
<section id="stats" class="tab-pane">
|
<section id="stats" class="tab-pane">
|
||||||
<h2>Statistiken</h2>
|
<h2>Statistiken</h2>
|
||||||
@ -229,6 +314,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Import Modal -->
|
||||||
|
<div id="import-modal" class="modal">
|
||||||
|
<div class="modal-content" style="max-width: 600px;">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h2>Daten importieren</h2>
|
||||||
|
<button id="close-import-modal" class="close-btn">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>Füge deine exportierten TeeTracker-Daten hier ein:</p>
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||||
|
|||||||
121
styles.css
121
styles.css
@ -815,3 +815,124 @@ header p {
|
|||||||
.organic-badge:hover {
|
.organic-badge:hover {
|
||||||
transform: scale(1.1);
|
transform: scale(1.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Settings Section */
|
||||||
|
.settings-section {
|
||||||
|
background-color: var(--card-bg);
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
padding: 20px;
|
||||||
|
box-shadow: var(--box-shadow);
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-section h3 {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
color: var(--text-color);
|
||||||
|
border-bottom: 2px solid var(--primary-light);
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-section p {
|
||||||
|
color: var(--text-light);
|
||||||
|
margin-bottom: 20px;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Status Message */
|
||||||
|
.status-message {
|
||||||
|
margin-top: 15px;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-message.success {
|
||||||
|
background-color: rgba(40, 167, 69, 0.1);
|
||||||
|
color: var(--success-color);
|
||||||
|
border: 1px solid var(--success-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-message.error {
|
||||||
|
background-color: rgba(220, 53, 69, 0.1);
|
||||||
|
color: var(--danger-color);
|
||||||
|
border: 1px solid var(--danger-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-message.info {
|
||||||
|
background-color: rgba(78, 205, 196, 0.1);
|
||||||
|
color: var(--secondary-color);
|
||||||
|
border: 1px solid var(--secondary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Status Badge */
|
||||||
|
.status-badge {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 6px 12px;
|
||||||
|
border-radius: 20px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge.local {
|
||||||
|
background-color: #6c757d;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge.connected {
|
||||||
|
background-color: var(--success-color);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge.disconnected {
|
||||||
|
background-color: var(--danger-color);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge.syncing {
|
||||||
|
background-color: var(--warning-color);
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Stats Overview */
|
||||||
|
.stats-overview {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||||
|
gap: 15px;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-label {
|
||||||
|
color: var(--text-light);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-value {
|
||||||
|
color: var(--text-color);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Modal for Import/Export */
|
||||||
|
.modal-textarea {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 200px;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border: 2px solid #ddd;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
padding: 12px;
|
||||||
|
resize: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-textarea:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user