mirror of
https://github.com/mentos1386/zdravko.git
synced 2024-11-25 17:05:21 +00:00
Tine
c153fe1b8f
Progress towards finalizing the building blocks: targets, monitors, triggers, notifications and worker groups.
30 lines
614 B
Go
30 lines
614 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"code.tjo.space/mentos1386/zdravko/web/templates/components"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
type Target struct{}
|
|
|
|
type SettingsTargets struct {
|
|
*Settings
|
|
Targets []*Target
|
|
}
|
|
|
|
func (h *BaseHandler) SettingsTargetsGET(c echo.Context) error {
|
|
cc := c.(AuthenticatedContext)
|
|
|
|
targets := make([]*Target, 0)
|
|
|
|
return c.Render(http.StatusOK, "settings_targets.tmpl", &SettingsTargets{
|
|
Settings: NewSettings(
|
|
cc.Principal.User,
|
|
GetPageByTitle(SettingsPages, "Targets"),
|
|
[]*components.Page{GetPageByTitle(SettingsPages, "Targets")},
|
|
),
|
|
Targets: targets,
|
|
})
|
|
}
|