diff --git a/README.md b/README.md index 5ef8d4b..f97d1a1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ SvelteKit через `go:embed`, запуск через systemd. - **Backend:** Go, Gin, pgx (PostgreSQL на `pg.localnet`), AWS SDK v2 (Garage на `s3.localnet`, path-style), нативный SSE, golang-migrate, slog. -- **Frontend:** SvelteKit 2 + Svelte 5, adapter-static, TypeScript, TailwindCSS. +- **Frontend:** SvelteKit 2 + Svelte 5, adapter-static, TypeScript, TailwindCSS, + service worker с офлайн-кешем оболочки, списков и эскизов/превью фотографий. - **Обработка изображений:** `disintegration/imaging` + `gen2brain/webp` + `rwcarlsen/goexif` (всё чистый Go). diff --git a/backend/internal/app/app.go b/backend/internal/app/app.go index d30488e..ec1ca8b 100644 --- a/backend/internal/app/app.go +++ b/backend/internal/app/app.go @@ -364,6 +364,11 @@ func (s *Server) registerStatic(r *gin.Engine) { if clean != "" { if f, err := sub.Open(clean); err == nil { f.Close() + // Манифест PWA отдаём с правильным типом: в системной таблице + // mime расширения .webmanifest нет. + if strings.HasSuffix(clean, ".webmanifest") { + c.Header("Content-Type", "application/manifest+json") + } fileServer.ServeHTTP(c.Writer, c.Request) return } diff --git a/frontend/src/app.html b/frontend/src/app.html index 06cf16b..6bf0a33 100644 --- a/frontend/src/app.html +++ b/frontend/src/app.html @@ -6,6 +6,10 @@ + + + + @@ -245,6 +257,16 @@
+ {#if !online} + + {/if} {#if panel && panelVisible}