From 0a3611b94a2c4ecc6167a891b8857b539fb28b54 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 25 Sep 2024 16:45:11 +0200 Subject: [PATCH] use HTML 5 history mode for vue frontend --- cookbook/urls.py | 5 +++-- vue3/src/apps/tandoor/main.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cookbook/urls.py b/cookbook/urls.py index 2e00935ae0..af114c479a 100644 --- a/cookbook/urls.py +++ b/cookbook/urls.py @@ -1,6 +1,6 @@ from pydoc import locate -from django.urls import include, path +from django.urls import include, path, re_path from django.views.generic import TemplateView from drf_spectacular.views import SpectacularAPIView from rest_framework import routers @@ -76,7 +76,8 @@ def extend(self, r): urlpatterns = [ path('', views.index, name='index'), - path('v3/', views.vue3, name='vue3'), + re_path(r'^v3/.*', views.vue3, name='vue3'), + #path('v3/', views.vue3, name='vue3'), path('setup/', views.setup, name='view_setup'), path('no-group', views.no_groups, name='view_no_group'), path('space-overview', views.space_overview, name='view_space_overview'), diff --git a/vue3/src/apps/tandoor/main.ts b/vue3/src/apps/tandoor/main.ts index c434eb97a9..3e7b6a2bc5 100644 --- a/vue3/src/apps/tandoor/main.ts +++ b/vue3/src/apps/tandoor/main.ts @@ -1,5 +1,5 @@ import {createApp} from "vue"; -import {createRouter, createWebHashHistory} from 'vue-router' +import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router' import {createPinia} from 'pinia' // @ts-ignore import App from './Tandoor.vue' @@ -56,7 +56,7 @@ const routes = [ const router = createRouter({ // TODO configure proper history mode - history: createWebHashHistory(), + history: createWebHistory('v3/'), routes, })