Minor tweaks

main
Antonio De Lucreziis 2 years ago
parent 8823418daa
commit 0c2009b659

@ -17,7 +17,7 @@ export const MainContent = () => {
login: Login, login: Login,
admin: AdminPanel, admin: AdminPanel,
apiKeys: ApiKeys, apiKeys: ApiKeys,
}[route.id] || (() => <>Error</>) }[route.id] || (() => <>Still nothing here</>)
return ( return (
<div class={`main-content route-${changeCase('camel', 'dash', route.id)}`}> <div class={`main-content route-${changeCase('camel', 'dash', route.id)}`}>

@ -43,6 +43,9 @@ const App = () => {
if (id !== 'login' && user !== 'admin') { if (id !== 'login' && user !== 'admin') {
location.href = '/login' location.href = '/login'
} }
if (id === 'login' && user === 'admin') {
location.href = '/'
}
}) })
const [toasts, setToasts] = useState([]) const [toasts, setToasts] = useState([])

@ -130,7 +130,7 @@ func (db *jsonDB) store() error {
} }
enc := json.NewEncoder(f) enc := json.NewEncoder(f)
enc.SetIndent("", " ") enc.SetIndent("", " ")
if err := enc.Encode(&db); err != nil { if err := enc.Encode(&db); err != nil {
return err return err
} }

@ -5,6 +5,7 @@ go 1.18
require ( require (
github.com/gofiber/fiber/v2 v2.34.1 github.com/gofiber/fiber/v2 v2.34.1
github.com/joho/godotenv v1.4.0 github.com/joho/godotenv v1.4.0
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d
) )
require ( require (
@ -13,6 +14,5 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.37.0 // indirect github.com/valyala/fasthttp v1.37.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d // indirect
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect
) )

Loading…
Cancel
Save