Administrator
diff --git a/templates/setup_templ.go b/templates/setup_templ.go
index fd6daec..d19dcb1 100644
--- a/templates/setup_templ.go
+++ b/templates/setup_templ.go
@@ -29,7 +29,7 @@ func Setup() templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
Setup - BookhoardWelcome to Bookhoard
Let's get your library set up.
= n ? 'bg-[var(--accent)] text-[var(--bg-primary)]' : 'bg-[var(--bg-secondary)] text-[var(--text-secondary)] border border-[var(--border)]'\"> n ? '✓' : n\">
= n ? 'color: var(--text-primary)' : 'color: var(--text-secondary)'\">
n ? 'bg-[var(--accent)]' : 'bg-[var(--border)]'\">
Create Administrator Account
This first account will have full admin privileges.
Create Libraries
Add one or more media libraries. You can always add more later.
0\" class=\"mb-6 space-y-2\">
Configure Library Folders
Add the filesystem folders where your media files are stored.
No libraries created. You can add folders later from the admin panel.
Scan & Finish
Review your configuration and start the initial scan.
Scan Progress
Initial scan complete! Your libraries are ready to use.
")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
Setup - BookhoardWelcome to Bookhoard
Let's get your library set up.
= n ? 'bg-[var(--accent)] text-[var(--bg-primary)]' : 'bg-[var(--bg-secondary)] text-[var(--text-secondary)] border border-[var(--border)]'\"> n ? '✓' : n\">
= n ? 'color: var(--text-primary)' : 'color: var(--text-secondary)'\">
n ? 'bg-[var(--accent)]' : 'bg-[var(--border)]'\">
Create Administrator Account
This first account will have full admin privileges.
Create Libraries
Add one or more media libraries. You can always add more later.
0\" class=\"mb-6 space-y-2\">
Configure Library Folders
Add the filesystem folders where your media files are stored.
No libraries created. You can add folders later from the admin panel.
Scan & Finish
Review your configuration and start the initial scan.
Scan Progress
Initial scan complete! Your libraries are ready to use.
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/web/src/setup.ts b/web/src/setup.ts
index 18aeef2..94209e0 100644
--- a/web/src/setup.ts
+++ b/web/src/setup.ts
@@ -36,14 +36,13 @@ function initSetup(): void {
if (savedTheme && savedTheme !== "tokyo-night") {
applyTheme(savedTheme);
}
-}
-
-Alpine.data("setupWizard", () => ({
+}Alpine.data("setupWizard", () => ({
currentStep: 1 as number,
loading: false as boolean,
errorMsg: "" as string,
admin: {
+ baseUrl: "",
email: "",
username: "",
password: "",
@@ -71,6 +70,7 @@ Alpine.data("setupWizard", () => ({
init() {
initSetup();
+ this.admin.baseUrl = window.location.origin;
setTimeout(() => {
initPasswordValidation();
}, 100);
@@ -128,6 +128,8 @@ Alpine.data("setupWizard", () => ({
setToken(data.token || data.access_token);
setRefreshToken(data.refresh_token);
+ await this.saveBaseUrl();
+
showToast("Admin account created successfully!", "success");
this.currentStep = 2;
} catch (err) {
@@ -137,6 +139,17 @@ Alpine.data("setupWizard", () => ({
}
},
+ async saveBaseUrl() {
+ if (!this.admin.baseUrl) return;
+ try {
+ await handleVoidResponse(
+ await apiPut("/system/config", { base_url: this.admin.baseUrl })
+ );
+ } catch {
+ showToast("Warning: could not save server URL. You can set it later in Admin Settings.", "warning");
+ }
+ },
+
async addLibrary() {
this.clearError();
this.loading = true;