mirror of
https://github.com/fankes/beszel.git
synced 2025-10-20 02:09:28 +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 (
|
import (
|
||||||
_ "beszel/migrations"
|
_ "beszel/migrations"
|
||||||
|
"beszel/site"
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/ed25519"
|
"crypto/ed25519"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
@@ -83,8 +84,10 @@ func main() {
|
|||||||
e.Router.Any("/*", echo.WrapHandler(proxy))
|
e.Router.Any("/*", echo.WrapHandler(proxy))
|
||||||
e.Router.Any("/", echo.WrapHandler(proxy))
|
e.Router.Any("/", echo.WrapHandler(proxy))
|
||||||
default:
|
default:
|
||||||
e.Router.GET("/icons/*", apis.StaticDirectoryHandler(os.DirFS("./site/dist/icons"), false))
|
assets, _ := site.Assets()
|
||||||
e.Router.Any("/*", apis.StaticDirectoryHandler(os.DirFS("./site/dist"), true))
|
icons, _ := site.Icons()
|
||||||
|
e.Router.GET("/icons/*", apis.StaticDirectoryHandler(icons, false))
|
||||||
|
e.Router.Any("/*", apis.StaticDirectoryHandler(assets, true))
|
||||||
}
|
}
|
||||||
return nil
|
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>
|
</Dialog>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{authMethods.emailPassword && (
|
{authMethods.emailPassword && !isFirstRun && (
|
||||||
<Link
|
<Link
|
||||||
href="/forgot-password"
|
href="/forgot-password"
|
||||||
className="text-sm mx-auto hover:text-brand underline underline-offset-4 opacity-70 hover:opacity-100 transition-opacity"
|
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>
|
<DialogTitle>Command line instructions</DialogTitle>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<p className="text-primary/70 text-[0.95em]">
|
<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:
|
your password:
|
||||||
</p>
|
</p>
|
||||||
<code className="bg-muted rounded-sm py-0.5 px-2.5 mr-auto text-sm">
|
<code className="bg-muted rounded-sm py-0.5 px-2.5 mr-auto text-sm">
|
||||||
|
Reference in New Issue
Block a user