Files
deploy-felhom-compose/TASK.md
T

204 lines
7.4 KiB
Markdown

# TASK — Simplify Backup Page "Alkalmazás adatok" Section
## Goal
Replace the current complex app data section on the backup page (checkboxes, paths, docker volumes, save button) with a simple, read-only status list of all deployed apps.
## Current state (v0.11.9)
The backup page shows an "Alkalmazás adatok" section with:
- Checkboxes per app to toggle backup on/off
- Full HDD path listings with sizes
- Docker volume names with "(nem mentett)" labels
- DB dump status per app
- A "Mentés" (save) button
**Problems:**
- Too much detail for the customer — confusing
- Docker volume names shown as "nem mentett" can mislead users into thinking DB data isn't backed up (it is, via DB dump)
- Backup enable/disable should be configured on the app's own settings page, not here
- The section should be informational only on this page
## Desired state
A clean, read-only list of ALL deployed apps (including those without user data) showing a simple status per app:
```
┌────────────────────────────────────────────────────────┐
│ Alkalmazás adatok │
│ Az alkalmazások felhasználói adatainak mentési │
│ állapota. Beállítás az alkalmazás oldalán. │
│ │
│ Immich Külső tárhely (hdd_1) ● Aktív │
│ Paperless-ngx Külső tárhely (hdd_p.) ○ Inaktív │
│ Gokapi — N/A │
│ Mealie — N/A │
│ RoMM Külső tárhely (hdd_p.) ○ Inaktív │
└────────────────────────────────────────────────────────┘
```
Each app name links to its deploy/settings page where backup can be configured.
**Status indicators (no emoji, just styled text/dots):**
- `● Aktív` — green dot + text — backup enabled for this app (has HDD data and toggle is on)
- `○ Inaktív` — gray dot + text — has HDD data but backup not enabled
- `— N/A` — muted dash + text — no user data folder, backup not applicable (this is fine, not a warning)
**Optional:** For apps with "Aktív" status, show the data size in muted text next to the storage label (e.g., `47.9 MB`).
## Changes
### 1. `backups.html` — Replace Section 4
Replace everything from `<!-- Section 4: App data backup toggles -->` through the closing `{{end}}` (lines 16199-16247) with:
```html
<!-- Section 4: App data backup status (read-only) -->
{{if .Backup.AppDataInfo}}
<div class="backup-section-card">
<h3>Alkalmazás adatok</h3>
<p class="backup-section-desc">Az alkalmazások felhasználói adatainak mentési állapota. Beállítás az alkalmazás oldalán.</p>
<div class="app-backup-list">
{{range .Backup.AppDataInfo}}
<div class="app-backup-item">
<div class="app-backup-header">
<a href="/stacks/{{.StackName}}/deploy" class="app-backup-name-link">{{.DisplayName}}</a>
<div class="app-backup-status-row">
{{if .HasHDDData}}
{{if .StorageLabel}}<span class="meta-badge meta-badge-storage">{{.StorageLabel}}</span>{{end}}
{{if .BackupEnabled}}
<span class="app-backup-size mono">{{.HDDSizeHuman}}</span>
<span class="app-backup-status app-backup-active">Aktív</span>
{{else}}
<span class="app-backup-status app-backup-inactive">Inaktív</span>
{{end}}
{{else}}
<span class="app-backup-status app-backup-na">N/A</span>
{{end}}
</div>
</div>
</div>
{{end}}
</div>
</div>
{{end}}
```
**Key differences from current:**
- No `<form>`, no checkboxes, no submit button
- No HDD paths, no Docker volume names, no DB dump notes
- No "app-backup-notice" about Docker volumes
- App name is a link to its deploy page
- Simple status indicator per app
### 2. `style.css` — Update styles
Keep existing `.app-backup-list` and `.app-backup-item` styles. Add/modify:
```css
/* App backup status list (read-only on backup page) */
.app-backup-name-link {
font-weight: 500;
font-size: .9rem;
color: var(--text-primary);
text-decoration: none;
}
.app-backup-name-link:hover {
color: var(--accent-blue);
text-decoration: underline;
}
.app-backup-status-row {
display: flex;
align-items: center;
gap: .5rem;
}
.app-backup-status {
font-size: .8rem;
font-weight: 500;
display: inline-flex;
align-items: center;
gap: .35rem;
}
.app-backup-status::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.app-backup-active {
color: var(--green);
}
.app-backup-active::before {
background: var(--green);
box-shadow: 0 0 4px rgba(35, 134, 54, 0.4);
}
.app-backup-inactive {
color: var(--text-muted);
}
.app-backup-inactive::before {
border: 1px solid var(--text-muted);
background: transparent;
width: 6px;
height: 6px;
}
.app-backup-na {
color: var(--text-muted);
}
.app-backup-na::before {
content: '—';
width: auto;
height: auto;
border-radius: 0;
background: none;
border: none;
box-shadow: none;
font-size: .8rem;
}
```
**Remove unused CSS classes** (no longer needed — these were for the old section):
- `.app-backup-toggle`
- `.app-backup-disabled-icon`
- `.app-backup-details`
- `.app-backup-path`
- `.app-backup-volume`
- `.app-backup-dbinfo`
- `.app-backup-actions`
- `.app-backup-notice`
Only remove them if they're not used elsewhere. Search the templates first.
### 3. Handlers — keep backend as-is
The `POST /settings/app-backup` endpoint and the `DiscoverAppData()` function should remain — the per-app backup toggle still works from the app's deploy/settings page. We're only removing the UI from the centralized backup page.
The `AppDataInfo` data is still populated and still needed — we use `.HasHDDData`, `.BackupEnabled`, `.StorageLabel`, `.HDDSizeHuman`, `.StackName`, and `.DisplayName` in the new simplified template.
### 4. Ensure ALL deployed apps appear
Currently, `DiscoverAppData()` iterates `provider.ListDeployedStacks()` which should include all deployed apps. Verify that apps without HDD data (like Gokapi, Mealie) also appear in the list — they should since `.NeedsHDD` can be false and they'd still be in the output with `HasHDDData: false`.
If some apps are missing, the issue is in `ListDeployedStacks()` filtering — make sure it returns all deployed stacks, not just HDD-capable ones.
## Testing
1. Visit `/backups` page
2. All deployed apps should appear in the list (Immich, Paperless-ngx, Gokapi, Mealie, RoMM, etc.)
3. Apps with backup enabled show green dot + "Aktív" + size
4. Apps with HDD data but backup disabled show hollow dot + "Inaktív"
5. Apps without HDD data show dash + "N/A"
6. Clicking app name navigates to `/stacks/{name}/deploy`
7. No checkboxes, no paths, no volumes, no save button visible
8. The per-app backup toggle on the deploy page still works (toggle on backup page → save → return to backup page → status updated)