From 0f9b128c792e70572094a619a472311b6e27ce2c Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Wed, 29 Sep 2021 21:13:04 -0400 Subject: [PATCH] htmx experiment in progress... --- src/MyPrayerJournal/App/package.json | 2 +- src/MyPrayerJournal/App/src/api/index.ts | 5 +- .../App/src/components/NavigationBar.vue | 31 ++- src/MyPrayerJournal/App/src/main.ts | 6 +- src/MyPrayerJournal/App/src/plugins/auth.ts | 13 +- src/MyPrayerJournal/App/src/router/index.ts | 24 +- src/MyPrayerJournal/App/src/store/index.ts | 40 +-- src/MyPrayerJournal/App/src/views/Journal.vue | 41 +++ .../App/src/views/request/EditRequest.vue | 11 + src/MyPrayerJournal/Server/Handlers.fs | 60 ++++- src/MyPrayerJournal/Server/Htmx.fs | 102 +++++++ .../Server/MyPrayerJournal.Server.fsproj | 3 + src/MyPrayerJournal/Server/Program.fs | 4 +- src/MyPrayerJournal/Server/ViewEngine.Htmx.fs | 136 ++++++++++ src/MyPrayerJournal/Server/Views.fs | 249 ++++++++++++++++++ 15 files changed, 683 insertions(+), 44 deletions(-) create mode 100644 src/MyPrayerJournal/App/src/views/Journal.vue create mode 100644 src/MyPrayerJournal/App/src/views/request/EditRequest.vue create mode 100644 src/MyPrayerJournal/Server/Htmx.fs create mode 100644 src/MyPrayerJournal/Server/ViewEngine.Htmx.fs create mode 100644 src/MyPrayerJournal/Server/Views.fs diff --git a/src/MyPrayerJournal/App/package.json b/src/MyPrayerJournal/App/package.json index ea9c7d1..0fa2045 100644 --- a/src/MyPrayerJournal/App/package.json +++ b/src/MyPrayerJournal/App/package.json @@ -10,7 +10,7 @@ "lint": "vue-cli-service lint", "apistart": "cd ../Server && dotnet run", "publish": "vue-cli-service build --modern && cd ../Server && dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=true --self-contained false", - "vue": "vue-cli-service build --development && cd ../Server && dotnet run" + "vue": "vue-cli-service build --mode development && cd ../Server && dotnet run" }, "dependencies": { "@vueuse/core": "^6.4.1", diff --git a/src/MyPrayerJournal/App/src/api/index.ts b/src/MyPrayerJournal/App/src/api/index.ts index f8205c7..f3357f5 100644 --- a/src/MyPrayerJournal/App/src/api/index.ts +++ b/src/MyPrayerJournal/App/src/api/index.ts @@ -70,7 +70,10 @@ export default { * Set the bearer token for all future requests * @param token The token to use to identify the user to the server */ - setBearer: (token: string) => { bearer = `Bearer ${token}` }, + setBearer: (token: string) => { + console.info(`Setting bearer token to ${token}`) + bearer = `Bearer ${token}` + }, /** * Remove the bearer token diff --git a/src/MyPrayerJournal/App/src/components/NavigationBar.vue b/src/MyPrayerJournal/App/src/components/NavigationBar.vue index cf9aa3e..adf7e3f 100644 --- a/src/MyPrayerJournal/App/src/components/NavigationBar.vue +++ b/src/MyPrayerJournal/App/src/components/NavigationBar.vue @@ -1,7 +1,10 @@