From fdf78dd5bf25f345cc8419cc547cdbafaf54ae86 Mon Sep 17 00:00:00 2001 From: vnugent Date: Sat, 11 Nov 2023 00:52:57 -0500 Subject: switch default api path, reduce bundle size, and swtich to async components --- ci/config/CMNext.json | 6 +++--- ci/config/Essentials.Accounts.json | 14 +++++++------- front-end/.env | 4 +--- front-end/src/components/FooterNav1.vue | 2 +- front-end/src/views/Account/[comp].vue | 7 +------ front-end/src/views/Blog/ckeditor/Editor.vue | 6 ++---- .../src/views/Blog/components/Posts/PostEdit.vue | 5 +++-- front-end/vite.config.ts | 19 +------------------ 8 files changed, 19 insertions(+), 44 deletions(-) diff --git a/ci/config/CMNext.json b/ci/config/CMNext.json index 1b3c516..d11a8f9 100644 --- a/ci/config/CMNext.json +++ b/ci/config/CMNext.json @@ -3,15 +3,15 @@ "debug": false, "post_endpoint": { - "path": "/blog/posts" + "path": "/api/blog/posts" }, "channel_endpoint": { - "path": "/blog/channels" + "path": "/api/blog/channels" }, "content_endpoint": { - "path": "/blog/content", + "path": "/api/blog/content", "max_content_length": 50000000 }, diff --git a/ci/config/Essentials.Accounts.json b/ci/config/Essentials.Accounts.json index bde9ff8..8903cc1 100644 --- a/ci/config/Essentials.Accounts.json +++ b/ci/config/Essentials.Accounts.json @@ -4,35 +4,35 @@ //endpoints "login_endpoint": { - "path": "/account/login", + "path": "/api/account/login", "max_login_attempts": 10, //10 failed attempts in 10 minutes "failed_attempt_timeout_sec": 600 //10 minutes }, "keepalive_endpoint": { - "path": "/account/keepalive", + "path": "/api/account/keepalive", //Regen token every 15 mins along with cookies "token_refresh_sec": 600 //15 minutes }, "profile_endpoint": { - "path": "/account/profile" + "path": "/api/account/profile" }, "password_endpoint": { - "path": "/account/reset" + "path": "/api/account/reset" }, "mfa_endpoint": { - "path": "/account/mfa" + "path": "/api/account/mfa" }, "logout_endpoint": { - "path": "/account/logout" + "path": "/api/account/logout" }, "pki_auth_endpoint": { - "path": "/account/pki", + "path": "/api/account/pki", "jwt_time_dif_sec": 30, "max_login_attempts": 10, "failed_attempt_timeout_sec": 600, diff --git a/front-end/.env b/front-end/.env index cae7853..3dfde77 100644 --- a/front-end/.env +++ b/front-end/.env @@ -1,5 +1,5 @@ #The base url for all api requests -VITE_API_URL="/" +VITE_API_URL="/api" VITE_CORS_ENABLED=false #The VNLib.Plugins.Essentials.Accounts plugin security header value @@ -11,8 +11,6 @@ VITE_ACCOUNTS_BASE_PATH="/account" #If true enables the PKI login method VITE_PKI_ENDPOINT="/account/pki" -#If true enables the Auth0 login method -VITE_ENABLE_AUTH0=false #The path to the blog admin api VITE_BLOG_ADMIN_URL="/blog" \ No newline at end of file diff --git a/front-end/src/components/FooterNav1.vue b/front-end/src/components/FooterNav1.vue index c02585f..721684a 100644 --- a/front-end/src/components/FooterNav1.vue +++ b/front-end/src/components/FooterNav1.vue @@ -5,7 +5,7 @@ Login - + Profile diff --git a/front-end/src/views/Account/[comp].vue b/front-end/src/views/Account/[comp].vue index 9e6343d..d854e2e 100644 --- a/front-end/src/views/Account/[comp].vue +++ b/front-end/src/views/Account/[comp].vue @@ -58,10 +58,8 @@ const comp = useRouteParams('comp') const tabId = computed(() =>{ switch (comp.value) { - case ComponentType.Oauth: - return 1 case ComponentType.Settings: - return 2 + return 1 case ComponentType.Profile: default: return 0 @@ -71,9 +69,6 @@ const tabId = computed(() =>{ const onTabChange = (tabid : number) =>{ switch (tabid) { case 1: - comp.value = ComponentType.Oauth - break - case 2: comp.value = ComponentType.Settings break case 0: diff --git a/front-end/src/views/Blog/ckeditor/Editor.vue b/front-end/src/views/Blog/ckeditor/Editor.vue index c3d637c..5bbf1cb 100644 --- a/front-end/src/views/Blog/ckeditor/Editor.vue +++ b/front-end/src/views/Blog/ckeditor/Editor.vue @@ -75,13 +75,11 @@ import { useSessionStorage } from '@vueuse/core'; import { tryOnMounted } from '@vueuse/shared'; import { apiCall } from '@vnuge/vnlib.browser'; import { Popover, PopoverButton, PopoverPanel, Switch } from '@headlessui/vue' -import { BlogState } from '../blog-api' import { Converter } from 'showdown' - -//Import the editor config +import { BlogState } from '../blog-api' import { useCkConfig } from './build.ts' -import ContentSearch from '../components/ContentSearch.vue'; import { useUploadAdapter } from './uploadAdapter'; +import ContentSearch from '../components/ContentSearch.vue'; const emit = defineEmits(['change', 'load', 'mode-change']) diff --git a/front-end/src/views/Blog/components/Posts/PostEdit.vue b/front-end/src/views/Blog/components/Posts/PostEdit.vue index 0268508..4106256 100644 --- a/front-end/src/views/Blog/components/Posts/PostEdit.vue +++ b/front-end/src/views/Blog/components/Posts/PostEdit.vue @@ -41,16 +41,17 @@