jenkins
This commit is contained in:
@@ -112,7 +112,7 @@ router.isReady().then(() => {
|
||||
let query = router.currentRoute.value.query
|
||||
classId.value = query.id
|
||||
token.value = query.token
|
||||
}).catch((err) => {
|
||||
}).catch(() => {
|
||||
})
|
||||
|
||||
const uploadRef = ref(null)
|
||||
|
||||
@@ -326,17 +326,28 @@ const selected = computed(
|
||||
const integrationKey = (item) => `${item.kind}/${item.provider}`
|
||||
const providerMeta = (item) => TARGETS[integrationKey(item)] || TARGETS[TARGET_ORDER[0]]
|
||||
const isWebSocket = (item) => integrationKey(item) === 'websocket/melody'
|
||||
const websocketApiBase = () => String(import.meta.env.VITE_BASE_API || '').trim()
|
||||
const websocketUrlOverride = () => String(import.meta.env.VITE_WEBSOCKET_URL || '').trim()
|
||||
const websocketUrlPath = (value) => {
|
||||
try {
|
||||
return new URL(value, window.location.origin).pathname.replace(/\/+$/, '')
|
||||
} catch {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
const websocketBackendIsExplicit = () =>
|
||||
Boolean(
|
||||
String(import.meta.env.VITE_WEBSOCKET_URL || '').trim() ||
|
||||
String(import.meta.env.VITE_SERVER_PORT || '').trim()
|
||||
websocketUrlOverride() ||
|
||||
String(import.meta.env.VITE_SERVER_PORT || '').trim() ||
|
||||
/^https?:\/\//i.test(websocketApiBase())
|
||||
)
|
||||
const websocketOrigin = () => {
|
||||
if (websocketBackendIsExplicit()) {
|
||||
const configuredBase = String(
|
||||
import.meta.env.VITE_WEBSOCKET_URL ||
|
||||
import.meta.env.VITE_BASE_PATH ||
|
||||
window.location.origin
|
||||
websocketUrlOverride() ||
|
||||
(/^https?:\/\//i.test(websocketApiBase())
|
||||
? websocketApiBase()
|
||||
: import.meta.env.VITE_BASE_PATH || window.location.origin)
|
||||
)
|
||||
const backend = new URL(configuredBase, window.location.origin)
|
||||
if (
|
||||
@@ -355,9 +366,14 @@ const websocketOrigin = () => {
|
||||
return `${protocol}//${window.location.host}`
|
||||
}
|
||||
const websocketPathPrefix = () => {
|
||||
if (websocketBackendIsExplicit()) return ''
|
||||
const base = String(import.meta.env.VITE_BASE_API || '').trim()
|
||||
if (!base || /^https?:\/\//i.test(base)) return ''
|
||||
const override = websocketUrlOverride()
|
||||
if (override) return websocketUrlPath(override)
|
||||
const base = websocketApiBase()
|
||||
if (!base) return ''
|
||||
if (/^https?:\/\//i.test(base)) {
|
||||
return websocketUrlPath(base)
|
||||
}
|
||||
if (String(import.meta.env.VITE_SERVER_PORT || '').trim()) return ''
|
||||
return `/${base.replace(/^\/+|\/+$/g, '')}`
|
||||
}
|
||||
const connectionInfo = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user