fix: router
This commit is contained in:
@@ -3,9 +3,10 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --host",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"serve": "vite preview",
|
||||||
"preview": "vite preview"
|
"build": "vite build --base=/assets/lms/frontend/ && yarn copy-html-entry",
|
||||||
|
"copy-html-entry": "cp ../lms/public/frontend/index.html ../lms/www/learning.html"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@editorjs/checklist": "^1.6.0",
|
"@editorjs/checklist": "^1.6.0",
|
||||||
@@ -34,4 +35,4 @@
|
|||||||
"postcss": "^8.4.5",
|
"postcss": "^8.4.5",
|
||||||
"vite": "^5.0.11"
|
"vite": "^5.0.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,6 +71,7 @@ import { MessageSquareIcon } from 'lucide-vue-next'
|
|||||||
const showTopics = ref(true)
|
const showTopics = ref(true)
|
||||||
const currentTopic = ref(null)
|
const currentTopic = ref(null)
|
||||||
const socket = inject('$socket')
|
const socket = inject('$socket')
|
||||||
|
const user = inject('$user')
|
||||||
const showTopicModal = ref(false)
|
const showTopicModal = ref(false)
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -101,6 +102,8 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
if (user.data) topics.reload()
|
||||||
|
|
||||||
socket.on('new_discussion_topic', (data) => {
|
socket.on('new_discussion_topic', (data) => {
|
||||||
topics.refresh()
|
topics.refresh()
|
||||||
})
|
})
|
||||||
@@ -116,7 +119,6 @@ const topics = createResource({
|
|||||||
single_thread: props.singleThread,
|
single_thread: props.singleThread,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
auto: true,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const showReplies = (topic) => {
|
const showReplies = (topic) => {
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ const routes = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
let router = createRouter({
|
let router = createRouter({
|
||||||
history: createWebHistory('/'),
|
history: createWebHistory('/learning'),
|
||||||
routes,
|
routes,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
12
lms/www/learning.py
Normal file
12
lms/www/learning.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import frappe
|
||||||
|
from frappe.utils.telemetry import capture
|
||||||
|
|
||||||
|
no_cache = 1
|
||||||
|
|
||||||
|
|
||||||
|
def get_context(context):
|
||||||
|
csrf_token = frappe.sessions.get_csrf_token()
|
||||||
|
frappe.db.commit()
|
||||||
|
if frappe.session.user != "Guest":
|
||||||
|
capture("active_site", "lms")
|
||||||
|
context.csrf_token = csrf_token
|
||||||
Reference in New Issue
Block a user