mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-10 05:15:35 +08:00
fix: //
in websocketpath (#651)
This commit is contained in:
parent
d148c1941e
commit
ed70948a36
@ -2,6 +2,7 @@ import { createEventSignal } from '@solid-primitives/event-listener'
|
|||||||
import { makePersisted } from '@solid-primitives/storage'
|
import { makePersisted } from '@solid-primitives/storage'
|
||||||
import { createReconnectingWS } from '@solid-primitives/websocket'
|
import { createReconnectingWS } from '@solid-primitives/websocket'
|
||||||
import ky from 'ky'
|
import ky from 'ky'
|
||||||
|
import _ from 'lodash'
|
||||||
import { createMemo, createSignal } from 'solid-js'
|
import { createMemo, createSignal } from 'solid-js'
|
||||||
|
|
||||||
export const [selectedEndpoint, setSelectedEndpoint] = makePersisted(
|
export const [selectedEndpoint, setSelectedEndpoint] = makePersisted(
|
||||||
@ -48,7 +49,7 @@ export const endpoint = () =>
|
|||||||
export const secret = () => endpoint()?.secret
|
export const secret = () => endpoint()?.secret
|
||||||
|
|
||||||
export const wsEndpointURL = () =>
|
export const wsEndpointURL = () =>
|
||||||
new URL(endpoint()?.url ?? '').href.replace('http', 'ws')
|
_.trimEnd(new URL(endpoint()?.url ?? '').href.replace('http', 'ws'), '/')
|
||||||
|
|
||||||
export const useWsRequest = <T>(
|
export const useWsRequest = <T>(
|
||||||
path: string,
|
path: string,
|
||||||
|
Loading…
Reference in New Issue
Block a user