Documentation
¶
Index ¶
- Variables
- func ConfigGinRouter(router *gin.Engine)
- func GetPageString(s string) string
- func HandleValidLogin(c *gin.Context, data *tools.SessionData)
- func IsFreshInstallation(c *gin.Context, usersDao dao.UsersDao) (bool, error)
- func SetLoginRedirectCookie(c *gin.Context)
- type AdminPageData
- type CacheMetrics
- type ChatData
- type EditCourseData
- type HealthCheckData
- type IndexData
- type LectureStatsPageData
- type LectureUnitsPageData
- type LiveLectureManagementData
- type LoginPageData
- type OptOutPageData
- type TokensData
- type WatchPageData
- type WorkersData
Constants ¶
This section is empty.
Variables ¶
var VersionTag string
Functions ¶
func ConfigGinRouter ¶
func GetPageString ¶
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 ¶
IsFreshInstallation Checks whether there are users in the database and returns true if so, false if not.
func SetLoginRedirectCookie ¶ added in v1.7.10
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 AdminPageData ¶
type AdminPageData struct {
IndexData IndexData
Courses []model.Course
LectureHalls []model.LectureHall
Page string
Workers WorkersData
Semesters []model.Semester
CurY int
CurT string
EditCourseData EditCourseData
ServerNotifications []model.ServerNotification
Tokens TokensData
Notifications []model.Notification
HasTestCourse bool
}
type CacheMetrics ¶
type EditCourseData ¶
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 ¶
type LectureStatsPageData ¶
type LectureUnitsPageData ¶
type LectureUnitsPageData struct {
IndexData IndexData
Lecture model.Stream
Units []model.StreamUnit
}
type LoginPageData ¶
type LoginPageData struct {
VersionTag string
Error bool
UseSAML bool
IDPName string
IDPColor string
Branding tools.Branding
CanonicalURL tools.CanonicalURL
}
LoginPageData contains the data for login page templates
func NewLoginPageData ¶
func NewLoginPageData(err bool) LoginPageData
NewLoginPageData returns a new struct LoginPageData with the Error value err
type OptOutPageData ¶
type TokensData ¶
type TokensData struct {
Tokens []dao.AllTokensDto
RtmpProxyURL string
User *model.User
}
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.