From 75d12b4a5c857d472c1d49d40b6c521cd647cce4 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sun, 3 Jan 2021 20:58:44 +0000 Subject: [PATCH] fully implements settings load/save, add ombi user defaults all that remains is the User profiles menu. --- api.go | 8 +- css/base.css | 8 ++ html/admin.html | 18 ++-- ts/modules/settings.ts | 190 +++++++++++++++++++++++++++++++++++------ 4 files changed, 187 insertions(+), 37 deletions(-) diff --git a/api.go b/api.go index 6507c6a..b1581d9 100644 --- a/api.go +++ b/api.go @@ -1097,15 +1097,12 @@ func (app *appContext) GetConfig(gc *gin.Context) { } } s := resp.Sections["ui"].Settings["language"] - s.Options = app.lang.langOptions - s.Value = app.lang.langOptions[app.lang.chosenIndex] - resp.Sections["ui"].Settings["language"] = s for sectName, section := range resp.Sections { for settingName, setting := range section.Settings { val := app.config.Section(sectName).Key(settingName) s := resp.Sections[sectName].Settings[settingName] switch setting.Type { - case "text", "email", "select": + case "text", "email", "select", "password": s.Value = val.MustString("") case "number": s.Value = val.MustInt(0) @@ -1115,6 +1112,9 @@ func (app *appContext) GetConfig(gc *gin.Context) { resp.Sections[sectName].Settings[settingName] = s } } + s.Options = app.lang.langOptions + s.Value = app.lang.langOptions[app.lang.chosenIndex] + resp.Sections["ui"].Settings["language"] = s gc.JSON(200, resp) } diff --git a/css/base.css b/css/base.css index f76e126..d997dd4 100644 --- a/css/base.css +++ b/css/base.css @@ -68,6 +68,10 @@ margin-left: 1rem; } +.ml-half { + margin-left: 0.5rem; +} + .mr-1 { margin-right: 1rem; } @@ -96,6 +100,10 @@ align-items: top; } +.flex { + display: flex; +} + .flex-expand { display: flex; justify-content: space-between; diff --git a/html/admin.html b/html/admin.html index 5c397b6..21a8040 100644 --- a/html/admin.html +++ b/html/admin.html @@ -101,17 +101,17 @@