Skip to main content

UI Theme page

The UI Theme page sets the logo and favicon the Admin UI shows. Open it at /ui/ui-theme. It sits in the left nav under Settings, then UI Theme. The nav shows it to the Admin and Admin Viewer session roles, which cover proxy admins and proxy admin viewers. Org admins see the Settings group but not this item, and internal users do not see the group. The page has no role guard of its own and no license gate. The theme settings are served by a gateway route that needs no sign-in, so every visitor's browser can load the custom branding.

A real-world scenario​

A company rolls the gateway out to 2,000 employees and wants the Admin UI to carry its own logo so people know they are on the internal tool. The admin pastes the logo and favicon URLs from the company's asset server, previews them, and saves, and every user sees the new branding on their next load.

Steps​

  1. Open Settings, then UI Theme, or go to /ui/ui-theme.

  2. Paste public https URLs into Custom Logo URL, Custom Logo URL (dark mode) and Custom Favicon URL. The page previews them as you type.

  3. Click Save Changes. The page calls:

    curl -X PATCH http://localhost:4000/update/ui_theme_settings \
    -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" \
    -d '{"logo_url": "https://assets.example.com/logo.png", "favicon_url": "https://assets.example.com/favicon.ico"}'
  4. Reload the page to check the saved branding, or read it back.

    curl http://localhost:4000/get/ui_theme_settings

Expected result​

A toast reads "Theme settings updated successfully!", the sidebar shows the new logo, and the read route returns the saved URLs.

UI Theme Customization​

The page has one card under the heading UI Theme Customization, "Customize your Spanway admin dashboard with a custom logo and favicon." When it opens, the fields are filled with the saved values. A field that has no saved value shows the value from the matching environment variable when that variable holds a public http or https URL.

ControlTypeWhat it does
Custom Logo URLTextThe logo shown at the top of the sidebar, and in the top bar when the dashboard is in plugin mode, placeholder https://example.com/logo.png. Leave it empty for the default Spanway logo. Its environment variable is UI_LOGO_PATH.
Upload logo fileFileShown to proxy admins under the logo URL field. Pick a .png, .jpg, .jpeg or .svg file up to 5MB. The gateway stores the file in its database, serves it from /get/ui_logo/<name> and fills Custom Logo URL with that address, then shows "Logo uploaded. Press Save Changes to keep it."
Custom Logo URL (dark mode)TextA logo for dark backgrounds, placeholder https://example.com/logo-dark.png. Leave it empty to reuse the logo above in dark mode. Its environment variable is UI_LOGO_PATH_DARK.
Upload dark mode logo fileFileThe same upload for the dark mode logo. It fills Custom Logo URL (dark mode).
Custom Favicon URLTextThe browser tab icon, placeholder https://example.com/favicon.ico. Use a .ico, .png or .svg file, or leave it empty for the default. Its environment variable is SPANWAY_FAVICON_URL.
Save ChangesButtonSaves all three fields at once and shows "Theme settings updated successfully!".
Reset to DefaultButtonOpens Reset the UI theme to the default?, which says "The custom logo, dark-mode logo and favicon are removed for everyone who uses this dashboard, and the Spanway defaults come back. You can set new ones at any time." Reset theme clears all three fields and saves, then shows "Theme settings reset to default!". Cancel keeps the theme.

Uploading a logo file​

Use the upload when the logo is not hosted anywhere yet. Say your company has a logo.png on a designer's laptop and no CDN. Instead of publishing it somewhere first, a proxy admin uploads it here and the gateway hosts it.

  1. Open /ui/ui-theme as a proxy admin.
  2. Under Custom Logo URL, use Upload logo file and pick the PNG, JPG or SVG file.
  3. Wait for "Logo uploaded. Press Save Changes to keep it." The Custom Logo URL field now holds the gateway address of the file, for example https://gateway.example.com/get/ui_logo/logo_3f2a...c9.png, and the sidebar previews it.
  4. Repeat with Upload dark mode logo file if you want a different logo on dark backgrounds.
  5. Press Save Changes.

Expected result: "Theme settings updated successfully!" appears, and every dashboard shows the uploaded logo the next time it loads. The uploaded file is served without sign-in, like the default logo, because the browser shows it on the login page too. The gateway serves only the files its own upload created, under names it generated, and never any other file on the host.

The same two steps from the command line, with an admin key in SPANWAY_API_KEY:

curl -sS -X POST "http://localhost:4000/upload/logo" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-F "file=@logo.png"
{
"message": "Logo uploaded successfully",
"status": "success",
"filename": "logo_3f2a9c1e5b7d4a0f8e6c2b1d9a7f5e3c.png",
"file_size": 18422,
"url": "/get/ui_logo/logo_3f2a9c1e5b7d4a0f8e6c2b1d9a7f5e3c.png"
}
curl -sS -X PATCH "http://localhost:4000/update/ui_theme_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"logo_url": "http://localhost:4000/get/ui_logo/logo_3f2a9c1e5b7d4a0f8e6c2b1d9a7f5e3c.png"}'

The saved logo_url must be the full address of the gateway, because the theme route only accepts http or https URLs with a host. The Admin UI builds that address for you from the gateway it is talking to. Uploaded files are stored in the gateway database, not on the host's disk, so every gateway replica serves the same logo, a read-only filesystem is fine, and the logo survives restarts and redeploys. The upload therefore needs a connected database. When audit logging is on, each upload writes an audit row with object_id ui_logo:<name>, the image type and its size, so you can see who uploaded which file, and each save writes one with object_id ui_theme_config and the values before and after. Uploaded files stay in the database even after you switch to another logo, because no route removes them yet. Database tables explains how a database administrator removes old ones.

Typing in a field previews the change at once in your own browser, so you can see the logo before you save. The preview is not saved. If you leave or reload the page without pressing Save Changes, the saved branding comes back.

The gateway accepts only plain http or https URLs with a host. Local file paths and other schemes are refused, because the logo is served through a route that needs no sign-in. Saving also applies the values to the running gateway right away, so other users see the new branding the next time their dashboard loads it.

Reset to Default clears the saved values and also removes the three environment variables from the running gateway process. A logo an operator set through UI_LOGO_PATH at startup is therefore gone until the gateway restarts with that variable again.

Empty, error and disabled states​

With nothing saved and no environment variables set, all three fields are empty and the default branding shows. If loading the settings fails, the fields stay empty and no message appears. A failed upload shows "The logo was not uploaded:" followed by the gateway's reason, which is "Only proxy admins can upload a UI logo." for a key without the proxy admin role, "Invalid file type. Allowed types: .png, .jpg, .jpeg, .svg" for any other file, "File size too large. Maximum size is 5MB.", "Uploading a logo needs the gateway database. Connect one first." (HTTP 503) when the gateway runs without a database, or "The logo could not be stored. Try again." (HTTP 503) when the database write failed. The second case also writes the error line Could not store the uploaded UI logo to the gateway log. The URL field keeps its previous value. A failed save shows "Failed to update theme settings". A failed reset keeps the confirmation open with "The theme was not reset" and the HTTP status the gateway answered. The UI does not show the gateway's reason, which is usually a URL that is not a public http or https URL, or a gateway that does not store its config in the database (STORE_MODEL_IN_DB=True is needed to save). Both buttons are disabled while a request runs.

Differences by role and license​

Proxy admins can save, reset and upload. Proxy admin viewers can open the page and see the values. The upload controls are hidden for them, the UI does not hide the Save and Reset buttons, and the gateway refuses the change. Other roles have no nav entry. The page needs no license.

Errors​

What you seeWhat it meansFix
"Failed to update theme settings"The URL is not a public http or https URL with a host, or the gateway does not store its config in the database.Use a public URL, and set STORE_MODEL_IN_DB=True.
"The theme was not reset" with a statusThe reset was refused.Check the status, usually the same causes as above.
A logo set with UI_LOGO_PATH disappearedReset to Default removes the environment value from the running process.Restart the gateway with the variable, or save the URL here.

The gateway's own answers, for anyone calling the routes directly:

Status and messageRouteMeaningFix
400 Invalid logo_url: must be an http(s) URL with a host. Local filesystem paths and non-http schemes are not allowed. (or logo_url_dark, favicon_url)PATCH /update/ui_theme_settingsThe value is a local path or another scheme.Send a full https:// address.
400 Invalid file type. Allowed types: .png, .jpg, .jpeg, .svg or File size too large. Maximum size is 5MB.POST /upload/logoThe file is not an accepted image, or is too big.Upload a PNG, JPG or SVG of at most 5 MB.
401 Authentication Error, Only proxy admin can be used to generate, delete, update info for new keys/users/teams. ...bothAn internal user called the route, and the route check stops anyone who is not a proxy admin.Use a proxy admin key.
403 Only proxy admins can update UI theme settings. or Only proxy admins can upload a UI logo.bothThe key may call the route through allowed_routes or a custom role, but is not a proxy admin.Use a proxy admin key.
500 Set `'STORE_MODEL_IN_DB='True'` in your env to enable this feature.PATCH /update/ui_theme_settingsThe gateway does not store its settings in the database.Set store_model_in_db: true.
503 Uploading a logo needs the gateway database. Connect one first. or The logo could not be stored. Try again.POST /upload/logoNo database, or the write failed.Connect a database, or retry.

Logs​

LevelLineMeaning and action
ERRORCould not store the uploaded UI logo: <error>The database refused the upload and the caller got 503. Check the database connection and its free space.