diff --git a/src/core/admin/templates/global.templ b/src/core/admin/templates/global.templ index ae7317c..8acfbb9 100644 --- a/src/core/admin/templates/global.templ +++ b/src/core/admin/templates/global.templ @@ -1,6 +1,6 @@ package templates -templ GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtpHost, smtpPort, smtpUser, smtpPass, imapHost, imapPort, nextwksURL, authURL, lang, tz, msg string) { +templ GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtpHost, smtpPort, smtpUser, smtpPass, imapHost, imapPort, nextwksURL, authURL, clientID, callbackURL, lang, tz, msg string) { @Layout("global") {

Global Settings

if msg != "" { @@ -92,17 +92,42 @@ templ GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smt
-

URLs

+

Workspace URL

+
+ + +
+
+ +
+

Authentication (OIDC)

+
+ + +
- - + +
- - + +
+
+ +
+ + +
+
+
diff --git a/src/core/admin/templates/global_templ.go b/src/core/admin/templates/global_templ.go index 7b26adc..be4450a 100644 --- a/src/core/admin/templates/global_templ.go +++ b/src/core/admin/templates/global_templ.go @@ -8,7 +8,7 @@ package templates import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtpHost, smtpPort, smtpUser, smtpPass, imapHost, imapPort, nextwksURL, authURL, lang, tz, msg string) templ.Component { +func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtpHost, smtpPort, smtpUser, smtpPass, imapHost, imapPort, nextwksURL, authURL, clientID, callbackURL, lang, tz, msg string) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -240,103 +240,129 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "\">

URLs

Workspace URL

Authentication (OIDC)

Localization

Localization

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, ">Paris ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/src/core/admin/ui.go b/src/core/admin/ui.go index d13bf28..e95d40f 100644 --- a/src/core/admin/ui.go +++ b/src/core/admin/ui.go @@ -51,7 +51,7 @@ func (h *Handler) adminGlobal(w http.ResponseWriter, r *http.Request) { cfg["db_user"], cfg["db_pass"], cfg["db_name"], cfg["smtp_host"], cfg["smtp_port"], cfg["smtp_user"], cfg["smtp_pass"], cfg["imap_host"], cfg["imap_port"], cfg["nextwks_url"], cfg["auth_url"], - cfg["lang"], cfg["tz"], "", + cfg["client_id"], cfg["callback_url"], cfg["lang"], cfg["tz"], "", ) component.Render(r.Context(), w) } @@ -60,6 +60,7 @@ func (h *Handler) adminGlobal(w http.ResponseWriter, r *http.Request) { func (h *Handler) adminGlobalSave(w http.ResponseWriter, r *http.Request) { r.ParseForm() msg := writeConfigRaw(h.configPath, r) + // Snip: update second call same way // Re-read to show updated values cfg := readConfigRaw(h.configPath) component := templates.GlobalSettings( @@ -67,7 +68,7 @@ func (h *Handler) adminGlobalSave(w http.ResponseWriter, r *http.Request) { cfg["db_user"], cfg["db_pass"], cfg["db_name"], cfg["smtp_host"], cfg["smtp_port"], cfg["smtp_user"], cfg["smtp_pass"], cfg["imap_host"], cfg["imap_port"], cfg["nextwks_url"], cfg["auth_url"], - cfg["lang"], cfg["tz"], msg, + cfg["client_id"], cfg["callback_url"], cfg["lang"], cfg["tz"], msg, ) component.Render(r.Context(), w) } @@ -101,6 +102,8 @@ func readConfigRaw(path string) rawConfig { cfg["nextwks_url"] = trimSuffix(cfg["nextwks_url"], "/auth/callback") } cfg["auth_url"] = getNested(m, "oidc", "issuer_url") + cfg["client_id"] = getNested(m, "oidc", "client_id") + cfg["callback_url"] = getNested(m, "oidc", "redirect_url") cfg["lang"] = getNested(m, "locale", "language") cfg["tz"] = getNested(m, "locale", "timezone") return cfg