Set and get custom styling for web interface. For #718

This commit is contained in:
Gabe Kangas
2021-04-11 17:40:22 -07:00
parent 36be7b76c2
commit df7dff081f
5 changed files with 34 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ const videoLatencyLevel = "video_latency_level"
const videoStreamOutputVariantsKey = "video_stream_output_variants"
const chatDisabledKey = "chat_disabled"
const externalActionsKey = "external_actions"
const customStylesKey = "custom_styles"
// GetExtraPageBodyContent will return the user-supplied body content.
func GetExtraPageBodyContent() string {
@@ -465,6 +466,21 @@ func SetExternalActions(actions []models.ExternalAction) error {
return _datastore.Save(configEntry)
}
// SetCustomStyles will save a string with CSS to insert into the page.
func SetCustomStyles(styles string) error {
return _datastore.SetString(customStylesKey, styles)
}
// GetCustomStyles will return a string with CSS to insert into the page.
func GetCustomStyles() string {
style, err := _datastore.GetString(customStylesKey)
if err != nil {
return ""
}
return style
}
// VerifySettings will perform a sanity check for specific settings values.
func VerifySettings() error {
if GetStreamKey() == "" {