Matrix-Chatfenster (read-only) im Dashboard integrieren
This commit is contained in:
@@ -69,6 +69,16 @@ func (a *App) handleDashboard(w http.ResponseWriter, r *http.Request) {
|
||||
Calendar: buildCalendar(plans, crops, products, stepMap, customTasks, doneMap, (settings.CurrentCycle*12)+(settings.CurrentMonth-1), settings.CurrentDay, settings.DaysPerMonth, 14),
|
||||
PlanningCount: len(plans),
|
||||
}
|
||||
if a.matrix != nil {
|
||||
data.MatrixEnabled = true
|
||||
data.MatrixRoomID = a.matrix.RoomID
|
||||
msgs, err := a.matrix.FetchRecentMessages(r.Context())
|
||||
if err != nil {
|
||||
data.MatrixError = err.Error()
|
||||
} else {
|
||||
data.MatrixMessages = msgs
|
||||
}
|
||||
}
|
||||
data.TodayGroups = groupTasksByField(data.TodayTasks)
|
||||
a.renderTemplate(w, "templates/dashboard.html", data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user