web

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VersionTag string

Functions

func ConfigGinRouter

func ConfigGinRouter(router *gin.Engine)

func HandleValidLogin

func HandleValidLogin(c *gin.Context, data *tools.SessionData)

HandleValidLogin starts a session and redirects the user to the page they were trying to access.

func IsFreshInstallation

func IsFreshInstallation(c *gin.Context, usersDao dao.UsersDao) (bool, error)

IsFreshInstallation Checks whether there are users in the database and returns true if so, false if not.

func SetLoginRedirectCookie added in v1.7.10

func SetLoginRedirectCookie(c *gin.Context)

SetLoginRedirectCookie stores where to send the user once they have logged in.

It has to happen while serving the login page, before the user picks between the internal form and an external identity provider, because an external login leaves the site entirely and comes back without the original query string. It is exported so that the route serving the SPA login page keeps the same behaviour.

Types

type CacheMetrics

type CacheMetrics struct {
	Hits      uint64 `json:"hits"`
	Misses    uint64 `json:"misses"`
	KeysAdded uint64 `json:"keysAdded"`
}

type ChatData

type ChatData struct {
	IsAdminOfCourse bool // is current user admin or lecturer who created the course associated with the chat
	IndexData       IndexData
}

type HealthCheckData

type HealthCheckData struct {
	Version      string       `json:"version"`
	CacheMetrics CacheMetrics `json:"cacheMetrics"`
}

type IndexData

type IndexData struct {
	VersionTag     string
	TUMLiveContext tools.TUMLiveContext
	CanonicalURL   tools.CanonicalURL
	Branding       tools.Branding
	WikiURL        string
	// Only the course editor still sets these, to mark a course as being of a past
	// semester. EditCoursePage fills them; nothing else does.
	CurrentYear int
	CurrentTerm string
}

IndexData is what every server-rendered page needs: who is asking, and how the installation presents itself. The course and semester listings it used to carry went with the start page, which the SPA serves.

func NewIndexData

func NewIndexData() IndexData

func NewIndexDataWithContext

func NewIndexDataWithContext(c *gin.Context) IndexData

type LectureUnitsPageData

type LectureUnitsPageData struct {
	IndexData IndexData
	Lecture   model.Stream
	Units     []model.StreamUnit
}

type LiveLectureManagementData

type LiveLectureManagementData struct {
	IndexData IndexData
	Lecture   model.Stream
	ChatData  ChatData
}

type WatchPageData

type WatchPageData struct {
	IsAdminOfCourse bool // is current user admin or lecturer who created this course
	IsHighlightPage bool
	AlertsEnabled   bool // whether the alert config is set
	Version         string
	Unit            *model.StreamUnit
	Presets         []model.CameraPreset
	Progress        model.StreamProgress
	IndexData       IndexData
	Description     template.HTML
	CutOffLength    int // The maximum length for the preview of a description.
	LectureHallName string
	ChatData        ChatData
}

WatchPageData contains all the metadata that is related to the watch page.

func (*WatchPageData) Prepare

func (d *WatchPageData) Prepare(c *gin.Context, lectureHallsDao dao.LectureHallsDao) error

Prepare populates the data for the watch page.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL