From 8c871bc5fa7ade0508a21f9c6c683d67412b4bd0 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Tue, 26 Jan 2021 22:57:29 +0000 Subject: [PATCH] Add ts to link setting dependance Also make store each setting as classes in a settings object, to make it easier to serialize on submitting. Also, added "substitute_jellyfin_strings", "no_username" and welcome_email. --- Makefile | 2 + api.go | 8 + html/setup2.html | 87 ++++--- lang.go | 2 + lang/setup/en-us.json | 17 +- main.go | 32 +-- setup.go | 23 ++ ts/modules/common.ts | 3 +- ts/setup.ts | 512 ++++++++++++++++++++++-------------------- 9 files changed, 380 insertions(+), 306 deletions(-) diff --git a/Makefile b/Makefile index 8f26df9..c0b98a7 100644 --- a/Makefile +++ b/Makefile @@ -18,12 +18,14 @@ typescript: -mkdir -p build/data/web/js -npx esbuild --bundle ts/admin.ts --outfile=./build/data/web/js/admin.js --minify -npx esbuild --bundle ts/form.ts --outfile=./build/data/web/js/form.js --minify + -npx esbuild --bundle ts/setup.ts --outfile=./build/data/web/js/setup.js --minify ts-debug: $(info compiling typescript w/ sourcemaps) -mkdir -p build/data/web/js -npx esbuild --bundle ts/admin.ts --sourcemap --outfile=./build/data/web/js/admin.js -npx esbuild --bundle ts/form.ts --sourcemap --outfile=./build/data/web/js/form.js + -npx esbuild --bundle ts/setup.ts --sourcemap --outfile=./build/data/web/js/setup.js -rm -r build/data/web/js/ts $(info copying typescript) cp -r ts build/data/web/js diff --git a/api.go b/api.go index 3d3f4b0..c3369be 100644 --- a/api.go +++ b/api.go @@ -1288,6 +1288,14 @@ func (app *appContext) GetLanguages(gc *gin.Context) { for key, lang := range app.storage.lang.Admin { resp[key] = lang.Meta.Name } + } else if page == "setup" { + for key, lang := range app.storage.lang.Setup { + resp[key] = lang.Meta.Name + } + } else if page == "email" { + for key, lang := range app.storage.lang.Email { + resp[key] = lang.Meta.Name + } } if len(resp) == 0 { respond(500, "Couldn't get languages", gc) diff --git a/html/setup2.html b/html/setup2.html index 5fa18ff..5f1aee2 100644 --- a/html/setup2.html +++ b/html/setup2.html @@ -66,27 +66,27 @@

{{ .lang.Login.description }}

@@ -108,13 +108,18 @@

{{ .lang.JellyfinEmby.embyNotice }}

+