[add] pwa manifest, [fix] missing koplugin import
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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{}
|
||||
|
||||
Reference in New Issue
Block a user