Upgraded to latest aero version

This commit is contained in:
2019-06-01 13:55:49 +09:00
parent ae591e5e7e
commit 28db818c37
196 changed files with 645 additions and 593 deletions

View File

@ -1,6 +1,7 @@
package admin
import (
"net/http"
"runtime"
"strings"
@ -14,11 +15,11 @@ import (
)
// Get admin page.
func Get(ctx *aero.Context) string {
func Get(ctx aero.Context) error {
user := utils.GetUser(ctx)
if user == nil || (user.Role != "admin" && user.Role != "editor") {
return ctx.Redirect("/")
return ctx.Redirect(http.StatusFound, "/")
}
// // CPU

View File

@ -11,7 +11,7 @@ import (
const maxReports = 80
// ClientErrors shows client-side errors.
func ClientErrors(ctx *aero.Context) string {
func ClientErrors(ctx aero.Context) error {
reports := arn.AllClientErrorReports()
sort.Slice(reports, func(i, j int) bool {

View File

@ -11,7 +11,7 @@ import (
)
// PaymentHistory ...
func PaymentHistory(ctx *aero.Context) string {
func PaymentHistory(ctx aero.Context) error {
user := utils.GetUser(ctx)
if user == nil {

View File

@ -11,7 +11,7 @@ import (
)
// PurchaseHistory ...
func PurchaseHistory(ctx *aero.Context) string {
func PurchaseHistory(ctx aero.Context) error {
user := utils.GetUser(ctx)
if user == nil {

View File

@ -12,7 +12,7 @@ import (
)
// UserRegistrations ...
func UserRegistrations(ctx *aero.Context) string {
func UserRegistrations(ctx aero.Context) error {
user := utils.GetUser(ctx)
if user == nil {

View File

@ -4,6 +4,6 @@ import "github.com/aerogo/aero"
import "github.com/animenotifier/notify.moe/components"
// WebDev ...
func WebDev(ctx *aero.Context) string {
func WebDev(ctx aero.Context) error {
return ctx.HTML(components.WebDev())
}