mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-05-19 13:28:20 +02:00
Upgrade banner
This commit is contained in:
parent
a91da7cf2c
commit
3280c2c440
22 changed files with 114 additions and 118 deletions
server
|
@ -80,18 +80,18 @@ func (s *Server) handleAccountGet(w http.ResponseWriter, _ *http.Request, v *vis
|
|||
}
|
||||
if v.user.Plan != nil {
|
||||
response.Plan = &apiAccountPlan{
|
||||
Code: v.user.Plan.Code,
|
||||
Upgradable: v.user.Plan.Upgradable,
|
||||
Code: v.user.Plan.Code,
|
||||
Upgradeable: v.user.Plan.Upgradeable,
|
||||
}
|
||||
} else if v.user.Role == user.RoleAdmin {
|
||||
response.Plan = &apiAccountPlan{
|
||||
Code: string(user.PlanUnlimited),
|
||||
Upgradable: false,
|
||||
Code: string(user.PlanUnlimited),
|
||||
Upgradeable: false,
|
||||
}
|
||||
} else {
|
||||
response.Plan = &apiAccountPlan{
|
||||
Code: string(user.PlanDefault),
|
||||
Upgradable: true,
|
||||
Code: string(user.PlanDefault),
|
||||
Upgradeable: true,
|
||||
}
|
||||
}
|
||||
reservations, err := s.userManager.Reservations(v.user.Name)
|
||||
|
@ -111,8 +111,8 @@ func (s *Server) handleAccountGet(w http.ResponseWriter, _ *http.Request, v *vis
|
|||
response.Username = user.Everyone
|
||||
response.Role = string(user.RoleAnonymous)
|
||||
response.Plan = &apiAccountPlan{
|
||||
Code: string(user.PlanNone),
|
||||
Upgradable: true,
|
||||
Code: string(user.PlanNone),
|
||||
Upgradeable: true,
|
||||
}
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue