remove: login card style dropdown and subtitle setting, glass effect now always active
This commit is contained in:
+1
-3
@@ -235,9 +235,7 @@ Navigate to **Admin Settings** (owner only) to configure:
|
|||||||
|
|
||||||
### Login Page Customization
|
### 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.
|
- **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).
|
||||||
- **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.
|
|
||||||
|
|
||||||
### Application Settings
|
### Application Settings
|
||||||
|
|
||||||
|
|||||||
@@ -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_attempts` | `5` | Failed login attempts before lockout (0 = disabled) |
|
||||||
| `lockout_duration` | `15` | Lockout duration in minutes |
|
| `lockout_duration` | `15` | Lockout duration in minutes |
|
||||||
| `mfa_required` | `false` | Enforce MFA for all users |
|
| `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_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 |
|
|
||||||
|
|||||||
@@ -340,13 +340,6 @@ func (h *Handler) loadTemplates(templateFS embed.FS) {
|
|||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
},
|
},
|
||||||
"loginCardStyle": func() string {
|
|
||||||
style, _ := h.auth.GetSetting("login_card_style")
|
|
||||||
if style == "" {
|
|
||||||
return "default"
|
|
||||||
}
|
|
||||||
return style
|
|
||||||
},
|
|
||||||
"loginTextColor": func() string {
|
"loginTextColor": func() string {
|
||||||
c, _ := h.auth.GetSetting("login_text_color")
|
c, _ := h.auth.GetSetting("login_text_color")
|
||||||
if c == "" {
|
if c == "" {
|
||||||
@@ -354,10 +347,6 @@ func (h *Handler) loadTemplates(templateFS embed.FS) {
|
|||||||
}
|
}
|
||||||
return c
|
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 converts a time.Time to the app timezone and formats as "2006-01-02 15:04"
|
||||||
"formatTime": func(v interface{}) string {
|
"formatTime": func(v interface{}) string {
|
||||||
switch t := v.(type) {
|
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)
|
logging.Info("Admin settings POST: form_type=%s from user_id=%d", formType, userID)
|
||||||
|
|
||||||
switch formType {
|
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":
|
case "security_settings":
|
||||||
// Collect all settings to save
|
// Collect all settings to save
|
||||||
batch := make(map[string]string)
|
batch := make(map[string]string)
|
||||||
|
|||||||
@@ -40,37 +40,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -55,8 +55,7 @@
|
|||||||
.login-footer.text-secondary a.text-secondary { color: rgba(255,255,255,0.90) !important; }
|
.login-footer.text-secondary a.text-secondary { color: rgba(255,255,255,0.90) !important; }
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if eq (loginCardStyle) "glass"}}
|
/* Glass card effect (always active) */
|
||||||
/* Glass card effect */
|
|
||||||
.card {
|
.card {
|
||||||
background: rgba(255, 255, 255, 0.15) !important;
|
background: rgba(255, 255, 255, 0.15) !important;
|
||||||
backdrop-filter: blur(16px) saturate(180%);
|
backdrop-filter: blur(16px) saturate(180%);
|
||||||
@@ -72,7 +71,6 @@
|
|||||||
.card .form-control { background: rgba(255,255,255,0.55); }
|
.card .form-control { background: rgba(255,255,255,0.55); }
|
||||||
[data-bs-theme="dark"] .card .form-control { background: rgba(0,0,0,0.3); }
|
[data-bs-theme="dark"] .card .form-control { background: rgba(0,0,0,0.3); }
|
||||||
.card .form-label, .card .h2, .card h2 { text-shadow: none; }
|
.card .form-label, .card .h2, .card h2 { text-shadow: none; }
|
||||||
{{end}}
|
|
||||||
</style>
|
</style>
|
||||||
<!-- Tabler CSS (self-hosted to prevent FOUC) -->
|
<!-- Tabler CSS (self-hosted to prevent FOUC) -->
|
||||||
<link rel="stylesheet" href="/static/css/tabler.min.css">
|
<link rel="stylesheet" href="/static/css/tabler.min.css">
|
||||||
@@ -83,7 +81,7 @@
|
|||||||
<div class="container container-tight py-4">
|
<div class="container container-tight py-4">
|
||||||
<div class="text-center mb-4">
|
<div class="text-center mb-4">
|
||||||
<h1 class="login-heading"><i class="ti ti-key"></i> {{appName}}</h1>
|
<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>
|
||||||
<div class="card card-md">
|
<div class="card card-md">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|||||||
Reference in New Issue
Block a user