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 CoursePageData
- type CourseStream
- type EditCourseData
- type HealthCheckData
- type IndexData
- func (d *IndexData) LoadCoursesForRole(c *gin.Context, coursesDao dao.CoursesDao)
- func (d *IndexData) LoadCurrentNotifications(serverNoticationDao dao.ServerNotificationDao)
- func (d *IndexData) LoadLivestreams(c *gin.Context, daoWrapper dao.DaoWrapper)
- func (d *IndexData) LoadPinnedCourses()
- func (d *IndexData) LoadPublicCourses(coursesDao dao.CoursesDao)
- func (d *IndexData) LoadSemesters(coursesDao dao.CoursesDao)
- func (d *IndexData) SetYearAndTerm(c *gin.Context)
- type LectureStatsPageData
- type LectureUnitsPageData
- type LiveLectureManagementData
- type LoginPageData
- type OptOutPageData
- type RunnersData
- 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
Users []model.User
Courses []model.Course
LectureHalls []model.LectureHall
Page string
Workers WorkersData
Runners RunnersData
Semesters []model.Semester
CurY int
CurT string
EditCourseData EditCourseData
ServerNotifications []model.ServerNotification
Tokens TokensData
InfoPages []model.InfoPage
Notifications []model.Notification
HasTestCourse bool
}
func (AdminPageData) UsersAsJson ¶
func (apd AdminPageData) UsersAsJson() string
type CacheMetrics ¶
type CoursePageData ¶
type CoursePageData struct {
IndexData IndexData
Course model.Course
HighlightPage bool
WatchedData string
}
CoursePageData is the data for the course page.
type CourseStream ¶
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
IsUser bool
IsAdmin bool
IsStudent bool
LiveStreams []CourseStream
Courses []model.Course
PinnedCourses []model.Course
PublicCourses []model.Course
Semesters []model.Semester
CurrentYear int
CurrentTerm string
UserName string
ServerNotifications []model.ServerNotification
CanonicalURL tools.CanonicalURL
Branding tools.Branding
WikiURL string
}
func NewIndexData ¶
func NewIndexData() IndexData
func NewIndexDataWithContext ¶
func (*IndexData) LoadCoursesForRole ¶
func (d *IndexData) LoadCoursesForRole(c *gin.Context, coursesDao dao.CoursesDao)
LoadCoursesForRole Load all courses of user. Distinguishes between admin, lecturer, and normal users.
func (*IndexData) LoadCurrentNotifications ¶
func (d *IndexData) LoadCurrentNotifications(serverNoticationDao dao.ServerNotificationDao)
LoadCurrentNotifications Loads notifications from the database into the IndexData object
func (*IndexData) LoadLivestreams ¶
func (d *IndexData) LoadLivestreams(c *gin.Context, daoWrapper dao.DaoWrapper)
LoadLivestreams Load non-hidden, currently live streams into the IndexData object. LoggedIn streams can only be seen by logged-in users. Enrolled streams can only be seen by users which are allowed to.
func (*IndexData) LoadPinnedCourses ¶
func (d *IndexData) LoadPinnedCourses()
func (*IndexData) LoadPublicCourses ¶
func (d *IndexData) LoadPublicCourses(coursesDao dao.CoursesDao)
LoadPublicCourses Load public courses of user. Filter courses which are already in IndexData.Courses
func (*IndexData) LoadSemesters ¶
func (d *IndexData) LoadSemesters(coursesDao dao.CoursesDao)
LoadSemesters Load available Semesters from the database into the IndexData object
func (*IndexData) SetYearAndTerm ¶
SetYearAndTerm Sets year and term on the IndexData object from the URL. Aborts with 404 if invalid
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 RunnersData ¶
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.