feat(web): show ICS subscription events in detail view

This commit is contained in:
2026-09-02 20:02:48 +02:00
parent e18c83b618
commit f34041d889
11 changed files with 908 additions and 80 deletions
+10 -3
View File
@@ -25,9 +25,16 @@ type Server struct {
icsCache *icssub.Cache
}
// NewServer constructs a web UI Server.
func NewServer(cfg *config.Config, st *store.Store, dbase *db.DB, logger *slog.Logger) *Server {
return &Server{cfg: cfg, store: st, dbase: dbase, logger: logger, icsCache: icssub.NewCache(icssub.DefaultTTL)}
// NewServer constructs a web UI Server. icsCache may be nil, in which
// case a private default-TTL cache is created — prefer sharing a single
// *icssub.Cache with the CALDAV/CardDAV backends (e.g. from
// cmd/server/main.go) so the web calendar page and the DAV protocol
// serve identical events for the same ICS subscription.
func NewServer(cfg *config.Config, st *store.Store, dbase *db.DB, logger *slog.Logger, icsCache *icssub.Cache) *Server {
if icsCache == nil {
icsCache = icssub.NewCache(icssub.DefaultTTL)
}
return &Server{cfg: cfg, store: st, dbase: dbase, logger: logger, icsCache: icsCache}
}
// Handler returns the http.Handler serving the web UI, mounted at "/web/"