mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix(sse): support sub-dir deployment
This commit is contained in:
parent
855c3375f8
commit
1396cbf096
3 changed files with 8 additions and 2 deletions
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
|
@ -6,6 +6,7 @@ on:
|
||||||
- 'weblate'
|
- 'weblate'
|
||||||
paths:
|
paths:
|
||||||
- "app/**/*.js"
|
- "app/**/*.js"
|
||||||
|
- "app/**/*.ts"
|
||||||
- "app/**/*.vue"
|
- "app/**/*.vue"
|
||||||
- "app/src/language/**/*.po"
|
- "app/src/language/**/*.po"
|
||||||
- "app/i18n.json"
|
- "app/i18n.json"
|
||||||
|
|
|
@ -62,7 +62,9 @@ export const useSelfCheckStore = defineStore('selfCheck', () => {
|
||||||
try {
|
try {
|
||||||
await selfCheck.fix(taskName)
|
await selfCheck.fix(taskName)
|
||||||
await nextTick()
|
await nextTick()
|
||||||
check()
|
setTimeout(() => {
|
||||||
|
check()
|
||||||
|
}, 1000)
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
fixing[taskName] = false
|
fixing[taskName] = false
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import type { SSEvent } from 'sse.js'
|
import type { SSEvent } from 'sse.js'
|
||||||
|
import { urlJoin } from '@/lib/helper'
|
||||||
import { useUserStore } from '@/pinia'
|
import { useUserStore } from '@/pinia'
|
||||||
import { SSE } from 'sse.js'
|
import { SSE } from 'sse.js'
|
||||||
|
|
||||||
|
@ -37,7 +38,9 @@ export function useSSE() {
|
||||||
reconnectInterval = 5000,
|
reconnectInterval = 5000,
|
||||||
} = options
|
} = options
|
||||||
|
|
||||||
const sse = new SSE(url, {
|
const fullUrl = urlJoin(window.location.pathname, url)
|
||||||
|
|
||||||
|
const sse = new SSE(fullUrl, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: token.value,
|
Authorization: token.value,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue