Made /api page
This commit is contained in:
@ -1,10 +1,7 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"sort"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
@ -17,13 +14,5 @@ func Get(ctx *aero.Context) string {
|
||||
return ctx.Redirect("/")
|
||||
}
|
||||
|
||||
types := []string{}
|
||||
|
||||
for typeName := range arn.DB.Types() {
|
||||
types = append(types, typeName)
|
||||
}
|
||||
|
||||
sort.Strings(types)
|
||||
|
||||
return ctx.HTML(components.Admin(user, types))
|
||||
return ctx.HTML(components.Admin(user))
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
component Admin(user *arn.User, types []string)
|
||||
component Admin(user *arn.User)
|
||||
h2.page-title Admin Panel
|
||||
|
||||
h3 Server
|
||||
@ -16,16 +16,4 @@ component Admin(user *arn.User, types []string)
|
||||
td= runtime.NumGoroutine()
|
||||
tr
|
||||
td Go version:
|
||||
td= runtime.Version()
|
||||
|
||||
h3 Types
|
||||
table
|
||||
//- thead
|
||||
//- tr
|
||||
//- th Table
|
||||
tbody
|
||||
each typeName in types
|
||||
tr
|
||||
td= typeName
|
||||
td
|
||||
a(href="/api/" + strings.ToLower(typeName) + "/")= "/api/" + strings.ToLower(typeName) + "/"
|
||||
td= runtime.Version()
|
Reference in New Issue
Block a user