remove: login card style dropdown and subtitle setting, glass effect now always active

This commit is contained in:
2026-04-09 22:20:36 +02:00
parent b4424b1e64
commit c2b96563cb
5 changed files with 3 additions and 71 deletions
+1 -3
View File
@@ -235,9 +235,7 @@ Navigate to **Admin Settings** (owner only) to configure:
### Login Page Customization
- **Background Image** — Upload a custom background image for the login page (max 5 MB, JPEG/PNG/WebP). The image is centered and fills the screen without distortion (`background-size: cover`). The text color (heading, subtitle, footer) is automatically adjusted based on the image brightness — light text for dark images, dark text for bright images.
- **Card Style** — Choose between **Default** (solid card) and **Glass** (transparent, blurred backdrop).
- **Subtitle** — Custom text shown below the application name on the login page. Leave empty for the default subtitle.
- **Background Image** — Upload a custom background image for the login page (max 5 MB, JPEG/PNG/WebP). The image is centered and fills the screen without distortion (`background-size: cover`). The text color (heading, subtitle, footer) is automatically adjusted based on the image brightness — light text for dark images, dark text for bright images. The login card always uses a glass effect (transparent, blurred backdrop).
### Application Settings
-2
View File
@@ -120,6 +120,4 @@ In addition to environment variables, the following settings are configured thro
| `lockout_attempts` | `5` | Failed login attempts before lockout (0 = disabled) |
| `lockout_duration` | `15` | Lockout duration in minutes |
| `mfa_required` | `false` | Enforce MFA for all users |
| `login_card_style` | `default` | Login card style: `default` or `glass` |
| `login_text_color` | `light` | Login text color over background image: `light` or `dark` (auto-detected on upload) |
| `login_subtitle` | _(empty)_ | Custom subtitle on the login page |
-31
View File
@@ -340,13 +340,6 @@ func (h *Handler) loadTemplates(templateFS embed.FS) {
}
return ""
},
"loginCardStyle": func() string {
style, _ := h.auth.GetSetting("login_card_style")
if style == "" {
return "default"
}
return style
},
"loginTextColor": func() string {
c, _ := h.auth.GetSetting("login_text_color")
if c == "" {
@@ -354,10 +347,6 @@ func (h *Handler) loadTemplates(templateFS embed.FS) {
}
return c
},
"loginSubtitle": func() string {
subtitle, _ := h.auth.GetSetting("login_subtitle")
return subtitle
},
// formatTime converts a time.Time to the app timezone and formats as "2006-01-02 15:04"
"formatTime": func(v interface{}) string {
switch t := v.(type) {
@@ -3364,26 +3353,6 @@ func (h *Handler) handleAdminSettings(w http.ResponseWriter, r *http.Request) {
logging.Info("Admin settings POST: form_type=%s from user_id=%d", formType, userID)
switch formType {
case "branding_settings":
batch := make(map[string]string)
cardStyle := r.FormValue("login_card_style")
if cardStyle == "glass" || cardStyle == "default" {
batch["login_card_style"] = cardStyle
changed = append(changed, "login_card_style="+cardStyle)
}
subtitle := r.FormValue("login_subtitle")
batch["login_subtitle"] = subtitle
if subtitle != "" {
changed = append(changed, "login_subtitle="+subtitle)
}
if err := h.auth.SetSettingsBatch(batch); err != nil {
logging.Error("Failed to save branding settings: %v", err)
http.Redirect(w, r, "/admin/settings?flash_type=danger&flash_msg="+url.QueryEscape("Failed to save branding settings: "+err.Error()), http.StatusSeeOther)
return
}
if len(changed) > 0 {
h.audit.Log(userID, audit.ActionBrandingChanged, fmt.Sprintf("Branding settings updated: %s", strings.Join(changed, ", ")), clientIP(r))
}
case "security_settings":
// Collect all settings to save
batch := make(map[string]string)
-31
View File
@@ -40,37 +40,6 @@
</div>
</div>
</form>
<hr class="my-4">
<!-- Login Theme Settings -->
<h4 class="mb-3"><i class="ti ti-brush"></i> Login Theme</h4>
<form action="/admin/settings" method="post">
<input type="hidden" name="form_type" value="branding_settings">
<div class="row">
<div class="col-md-3 mb-3">
<label class="form-label">Card Style</label>
<select name="login_card_style" class="form-select">
<option value="default" {{if eq (loginCardStyle) "default"}}selected{{end}}>Default (Solid)</option>
<option value="glass" {{if eq (loginCardStyle) "glass"}}selected{{end}}>Glass (Transparent)</option>
</select>
<small class="form-hint">Visual style of the login form.</small>
</div>
</div>
<div class="row">
<div class="col-md-8 mb-3">
<label class="form-label">Subtitle</label>
<input type="text" name="login_subtitle" class="form-control"
value="{{loginSubtitle}}" placeholder="Centralized SSH Key Management and Deployment">
<small class="form-hint">Text shown below the application name on the login page. Leave empty for default.</small>
</div>
</div>
<div class="form-footer">
<button type="submit" class="btn btn-primary">
<i class="ti ti-device-floppy"></i> Save Login Theme
</button>
</div>
</form>
</div>
</div>
</div>
+2 -4
View File
@@ -55,8 +55,7 @@
.login-footer.text-secondary a.text-secondary { color: rgba(255,255,255,0.90) !important; }
{{end}}
{{end}}
{{if eq (loginCardStyle) "glass"}}
/* Glass card effect */
/* Glass card effect (always active) */
.card {
background: rgba(255, 255, 255, 0.15) !important;
backdrop-filter: blur(16px) saturate(180%);
@@ -72,7 +71,6 @@
.card .form-control { background: rgba(255,255,255,0.55); }
[data-bs-theme="dark"] .card .form-control { background: rgba(0,0,0,0.3); }
.card .form-label, .card .h2, .card h2 { text-shadow: none; }
{{end}}
</style>
<!-- Tabler CSS (self-hosted to prevent FOUC) -->
<link rel="stylesheet" href="/static/css/tabler.min.css">
@@ -83,7 +81,7 @@
<div class="container container-tight py-4">
<div class="text-center mb-4">
<h1 class="login-heading"><i class="ti ti-key"></i> {{appName}}</h1>
<p class="text-secondary login-subtitle">{{if loginSubtitle}}{{loginSubtitle}}{{else}}Centralized SSH Key Management and Deployment{{end}}</p>
<p class="text-secondary login-subtitle">Centralized SSH Key Management and Deployment</p>
</div>
<div class="card card-md">
<div class="card-body">