Add new v2.5 UI (#357)

This commit is contained in:
WithoutPants
2020-03-05 10:15:02 +11:00
committed by GitHub
153 changed files with 29845 additions and 0 deletions

View File

@@ -106,6 +106,10 @@ func (r *mutationResolver) ConfigureInterface(ctx context.Context, input models.
config.Set(config.ShowStudioAsText, *input.ShowStudioAsText)
}
if input.Language != nil {
config.Set(config.Language, *input.Language)
}
css := ""
if input.CSS != nil {

View File

@@ -57,6 +57,8 @@ func makeConfigInterfaceResult() *models.ConfigInterfaceResult {
showStudioAsText := config.GetShowStudioAsText()
css := config.GetCSS()
cssEnabled := config.GetCSSEnabled()
language := config.GetLanguage()
return &models.ConfigInterfaceResult{
SoundOnPreview: &soundOnPreview,
@@ -66,5 +68,6 @@ func makeConfigInterfaceResult() *models.ConfigInterfaceResult {
ShowStudioAsText: &showStudioAsText,
CSS: &css,
CSSEnabled: &cssEnabled,
Language: &language,
}
}

View File

@@ -32,6 +32,9 @@ const Host = "host"
const Port = "port"
const ExternalHost = "external_host"
// i18n
const Language = "language"
// Interface options
const SoundOnPreview = "sound_on_preview"
const WallShowTitle = "wall_show_title"
@@ -97,6 +100,17 @@ func GetExcludes() []string {
return viper.GetStringSlice(Exclude)
}
func GetLanguage() string {
ret := viper.GetString(Language)
// default to English
if ret == "" {
return "en-US"
}
return ret
}
func GetScrapersPath() string {
return viper.GetString(ScrapersPath)
}