package web import ( "strconv" "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" ) // MaintenanceView is the maintenance page: planned windows and the form to // add or edit one. type MaintenanceView struct { Windows []MaintenanceRow Form MaintenanceForm Monitors []TargetOption Groups []TargetOption CanWrite bool } // MaintenanceRow is one planned window. type MaintenanceRow struct { ID string Title string Schedule string Targets string Next string Active bool Description string CanWrite bool } // MaintenanceForm holds the values of the form; ID is empty for a new window. type MaintenanceForm struct { ID string Title string Description string Start string TimeZone string Duration int Recurrence string Every int Weekdays map[int]bool Until string Monitors map[string]bool Groups map[string]bool } // TargetOption is a monitor or group to choose; Depth indents groups. type TargetOption struct { ID string Name string Depth int } templ maintenanceList(items []MaintenanceItem) {
{ m.When }
if m.Description != "" {{ i18n.T(ctx, "maintenance.empty") }
} else {{ w.Schedule }
{ w.Targets }
if w.Next != "" {{ i18n.T(ctx, "maintenance.next", "Time", w.Next) }
} if w.Description != "" {