Add redirect index page (#39)

- Bump version to 2.1
This commit is contained in:
2023-07-28 22:07:13 -04:00
parent 42d3280f67
commit 3ef4499a90
7 changed files with 85 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ open MyWebLog
open MyWebLog.ViewModels
open NodaTime
/// ~~ DASHBOARDS ~~
/// ~~~ DASHBOARDS ~~~
module Dashboard =
// GET /admin/dashboard
@@ -75,7 +75,7 @@ module Dashboard =
let toAdminDashboard : HttpHandler = redirectToGet "admin/administration"
/// ~~ CACHES ~~
/// ~~~ CACHES ~~~
module Cache =
// POST /admin/cache/web-log/{id}/refresh
@@ -126,7 +126,7 @@ module Cache =
}
/// ~~ CATEGORIES ~~
/// ~~~ CATEGORIES ~~~
module Category =
open MyWebLog.Data
@@ -214,7 +214,20 @@ module Category =
}
/// ~~ TAG MAPPINGS ~~
/// ~~~ REDIRECT RULES ~~~
module RedirectRules =
// GET /admin/redirect-rules
let all : HttpHandler = requireAccess WebLogAdmin >=> fun next ctx -> task {
return!
hashForPage "Redirect Rules"
|> withAntiCsrf ctx
|> addToHash "redirections" ctx.WebLog.RedirectRules
|> adminView "redirect-list" next ctx
}
/// ~~~ TAG MAPPINGS ~~~
module TagMapping =
open Microsoft.AspNetCore.Http
@@ -278,7 +291,7 @@ module TagMapping =
}
/// ~~ THEMES ~~
/// ~~~ THEMES ~~~
module Theme =
open System
@@ -440,7 +453,7 @@ module Theme =
}
/// ~~ WEB LOG SETTINGS ~~
/// ~~~ WEB LOG SETTINGS ~~~
module WebLog =
open System.Collections.Generic

View File

@@ -130,6 +130,9 @@ let router : HttpHandler = choose [
routef "/%s/revision/%s/preview" Post.previewRevision
routef "/%s/revisions" Post.editRevisions
])
subRoute "/redirect-rules" (choose [
route "" >=> Admin.RedirectRules.all
])
subRoute "/settings" (choose [
route "" >=> Admin.WebLog.settings
routef "/rss/%s/edit" Feed.editCustomFeed

View File

@@ -1,5 +1,6 @@
{
"Generator": "myWebLog 2.0",
"Generator": "myWebLog 2.1",
"Logging": {
"LogLevel": {
"MyWebLog.Handlers": "Information"