feat(manage): Schedule in ManageUI-Template-Daten
This commit is contained in:
parent
fc5587c171
commit
6cabaeca58
2 changed files with 8 additions and 1 deletions
|
|
@ -323,6 +323,7 @@ func HandleScreenOverview(screens *store.ScreenStore, notifier *mqttnotifier.Not
|
|||
func HandleManageUI(
|
||||
tenants *store.TenantStore,
|
||||
screens *store.ScreenStore,
|
||||
schedules *store.ScreenScheduleStore,
|
||||
media *store.MediaStore,
|
||||
playlists *store.PlaylistStore,
|
||||
cfg config.Config,
|
||||
|
|
@ -384,6 +385,11 @@ func HandleManageUI(
|
|||
|
||||
displayState, _ := screens.GetDisplayState(r.Context(), screen.ID)
|
||||
|
||||
schedule, _ := schedules.Get(r.Context(), screen.ID)
|
||||
if schedule == nil {
|
||||
schedule = &store.ScreenSchedule{ScreenID: screen.ID}
|
||||
}
|
||||
|
||||
// Determine back-navigation based on ?from= query parameter.
|
||||
backLink := "/admin"
|
||||
backLabel := "← Admin"
|
||||
|
|
@ -436,6 +442,7 @@ func HandleManageUI(
|
|||
"ServerTimezone": serverTimezone,
|
||||
"CSRFToken": csrfToken,
|
||||
"DisplayState": displayState,
|
||||
"Schedule": schedule,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ func registerManageRoutes(mux *http.ServeMux, d RouterDeps) {
|
|||
mux.Handle("GET /manage",
|
||||
authOnly(http.HandlerFunc(manage.HandleScreenOverview(d.ScreenStore, notifier, d.Config))))
|
||||
mux.Handle("GET /manage/{screenSlug}",
|
||||
authScreen(http.HandlerFunc(manage.HandleManageUI(d.TenantStore, d.ScreenStore, d.MediaStore, d.PlaylistStore, d.Config, notifier))))
|
||||
authScreen(http.HandlerFunc(manage.HandleManageUI(d.TenantStore, d.ScreenStore, d.ScheduleStore, d.MediaStore, d.PlaylistStore, d.Config, notifier))))
|
||||
mux.Handle("POST /manage/{screenSlug}/upload",
|
||||
authScreen(http.HandlerFunc(manage.HandleUploadMediaUI(d.MediaStore, d.ScreenStore, uploadDir))))
|
||||
mux.Handle("POST /manage/{screenSlug}/items",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue