mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 01:39:34 +08:00
embed site files / form tweaks
This commit is contained in:
7
main.go
7
main.go
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
_ "beszel/migrations"
|
||||
"beszel/site"
|
||||
"bytes"
|
||||
"crypto/ed25519"
|
||||
"encoding/json"
|
||||
@@ -83,8 +84,10 @@ func main() {
|
||||
e.Router.Any("/*", echo.WrapHandler(proxy))
|
||||
e.Router.Any("/", echo.WrapHandler(proxy))
|
||||
default:
|
||||
e.Router.GET("/icons/*", apis.StaticDirectoryHandler(os.DirFS("./site/dist/icons"), false))
|
||||
e.Router.Any("/*", apis.StaticDirectoryHandler(os.DirFS("./site/dist"), true))
|
||||
assets, _ := site.Assets()
|
||||
icons, _ := site.Icons()
|
||||
e.Router.GET("/icons/*", apis.StaticDirectoryHandler(icons, false))
|
||||
e.Router.Any("/*", apis.StaticDirectoryHandler(assets, true))
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
17
site/embed.go
Normal file
17
site/embed.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package site
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
)
|
||||
|
||||
//go:embed all:dist
|
||||
var assets embed.FS
|
||||
|
||||
func Assets() (fs.FS, error) {
|
||||
return fs.Sub(assets, "dist")
|
||||
}
|
||||
|
||||
func Icons() (fs.FS, error) {
|
||||
return fs.Sub(assets, "dist/icons")
|
||||
}
|
@@ -306,7 +306,7 @@ export function UserAuthForm({
|
||||
</Dialog>
|
||||
)}
|
||||
|
||||
{authMethods.emailPassword && (
|
||||
{authMethods.emailPassword && !isFirstRun && (
|
||||
<Link
|
||||
href="/forgot-password"
|
||||
className="text-sm mx-auto hover:text-brand underline underline-offset-4 opacity-70 hover:opacity-100 transition-opacity"
|
||||
|
@@ -87,7 +87,7 @@ export default function ForgotPassword() {
|
||||
<DialogTitle>Command line instructions</DialogTitle>
|
||||
</DialogHeader>
|
||||
<p className="text-primary/70 text-[0.95em]">
|
||||
If you don't have an SMTP server configured, you can use the following command to reset
|
||||
Use the following command to reset
|
||||
your password:
|
||||
</p>
|
||||
<code className="bg-muted rounded-sm py-0.5 px-2.5 mr-auto text-sm">
|
||||
|
Reference in New Issue
Block a user