Improved admin panel

This commit is contained in:
2017-10-02 14:56:51 +02:00
parent b0de2045d7
commit cc2418cd96
12 changed files with 37 additions and 42 deletions

View File

@ -17,7 +17,7 @@ import (
func Get(ctx *aero.Context) string {
user := utils.GetUser(ctx)
if user == nil || user.Role != "admin" {
if user == nil || (user.Role != "admin" && user.Role != "editor") {
return ctx.Redirect("/")
}

View File

@ -1,6 +1,14 @@
component AdminTabs
.tabs
Tab("Server", "server", "/admin")
Tab("AniList", "list", "/admin/anilist")
Tab("WebDev", "html5", "/admin/webdev")
component Admin(user *arn.User, cpuUsage, memUsage, diskUsage float64, platform, family, platformVersion, kernelVersion string)
h1.page-title Admin Panel
AdminTabs
.widgets
.widget.mountable
h3.widget-title Usage

View File

@ -1,4 +1,4 @@
package editor
package admin
import (
"net/http"
@ -9,8 +9,8 @@ import (
"github.com/animenotifier/notify.moe/components"
)
// Get ...
func Get(ctx *aero.Context) string {
// AniList ...
func AniList(ctx *aero.Context) string {
missing, err := arn.FilterAnime(func(anime *arn.Anime) bool {
return anime.GetMapping("anilist/anime") == ""
})

View File

@ -1,5 +1,7 @@
component AniListMissingMapping(missing []*arn.Anime)
h1 Anime without Anilist links
h1.page-title Anime without Anilist links
AdminTabs
table
tbody

View File

@ -1,9 +1,9 @@
package webdev
package admin
import "github.com/aerogo/aero"
import "github.com/animenotifier/notify.moe/components"
// Get ...
func Get(ctx *aero.Context) string {
// WebDev ...
func WebDev(ctx *aero.Context) string {
return ctx.HTML(components.WebDev())
}

View File

@ -1,6 +1,8 @@
component WebDev
h1.page-title WebDev
AdminTabs
.light-button-group
a.light-button(href="https://developers.google.com/speed/pagespeed/insights/?url=https://notify.moe/&tab=desktop", target="_blank", rel="noopener")
Icon("external-link")

View File

@ -13,18 +13,4 @@
transition filter transition-speed ease, opacity transition-speed ease
:hover
filter saturate(1.3)
.status-tabs
// margin-top 2px
// position fixed
// top 4.6rem
// right 1.6rem
// flex-direction column
// .status-tab
// font-size 0.9rem
// < 380px
// .profile-watching-list
// justify-content center
filter saturate(1.3)