diff --git a/api/api.go b/api/api.go index f8716dc..ba0d93c 100644 --- a/api/api.go +++ b/api/api.go @@ -72,6 +72,7 @@ func (api *API) registerWebAppRoutes() { api.Router.HTMLRender = render + api.Router.GET("/manifest.json", api.webManifest) api.Router.GET("/login", api.createAppResourcesRoute("login")) api.Router.GET("/register", api.createAppResourcesRoute("login", gin.H{"Register": true})) api.Router.GET("/logout", api.authWebAppMiddleware, api.authLogout) diff --git a/api/app-routes.go b/api/app-routes.go index be3f4d8..002ec64 100644 --- a/api/app-routes.go +++ b/api/app-routes.go @@ -25,6 +25,11 @@ func baseResourceRoute(template string, args ...map[string]any) func(c *gin.Cont } } +func (api *API) webManifest(c *gin.Context) { + c.Header("Content-Type", "application/manifest+json") + c.File("./assets/manifest.json") +} + func (api *API) createAppResourcesRoute(routeName string, args ...map[string]any) func(*gin.Context) { // Merge Optional Template Data var templateVarsBase = gin.H{} diff --git a/assets/manifest.json b/assets/manifest.json new file mode 100644 index 0000000..1008563 --- /dev/null +++ b/assets/manifest.json @@ -0,0 +1,7 @@ +{ + "short_name": "Book Manager", + "name": "Book Manager", + "theme_color": "#1F2937", + "background_color": "#1F2937", + "display": "standalone" +} diff --git a/client/syncninja.koplugin/main.lua b/client/syncninja.koplugin/main.lua index 0eb1a60..1fcab27 100644 --- a/client/syncninja.koplugin/main.lua +++ b/client/syncninja.koplugin/main.lua @@ -13,6 +13,7 @@ local WidgetContainer = require("ui/widget/container/widgetcontainer") local _ = require("gettext") local logger = require("logger") local md5 = require("ffi/sha2").md5 +local random = require("random") ------------------------------------------ ------------ Helper Functions ------------ diff --git a/templates/base.html b/templates/base.html index 93dcbb4..40e5e78 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,7 @@
+ diff --git a/templates/login.html b/templates/login.html index 34c2cae..045df2e 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,6 +1,7 @@ +