mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
feat(frontend): dark and high contrast theme supported EE-909 (#5353)
* feat dark theme & high contrast theme supported
This commit is contained in:
parent
e49e90f304
commit
8d8f21368d
34 changed files with 1352 additions and 107 deletions
|
@ -17,6 +17,7 @@ import (
|
|||
type userUpdatePayload struct {
|
||||
Username string `validate:"required" example:"bob"`
|
||||
Password string `validate:"required" example:"cg9Wgky3"`
|
||||
UserTheme string `example:"dark"`
|
||||
// User role (1 for administrator account and 2 for regular account)
|
||||
Role int `validate:"required" enums:"1,2" example:"2"`
|
||||
}
|
||||
|
@ -104,6 +105,10 @@ func (handler *Handler) userUpdate(w http.ResponseWriter, r *http.Request) *http
|
|||
user.Role = portainer.UserRole(payload.Role)
|
||||
}
|
||||
|
||||
if payload.UserTheme != "" {
|
||||
user.UserTheme = payload.UserTheme
|
||||
}
|
||||
|
||||
err = handler.DataStore.User().UpdateUser(user.ID, user)
|
||||
if err != nil {
|
||||
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to persist user changes inside the database", err}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue