mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 09:45:35 +08:00
fix(setup): use location info from router instead of browser
This commit is contained in:
parent
d0f850d7f5
commit
7ecc51c43c
@ -1,6 +1,6 @@
|
|||||||
import { createForm } from '@felte/solid'
|
import { createForm } from '@felte/solid'
|
||||||
import { validator } from '@felte/validator-zod'
|
import { validator } from '@felte/validator-zod'
|
||||||
import { useNavigate } from '@solidjs/router'
|
import { useLocation, useNavigate } from '@solidjs/router'
|
||||||
import { IconX } from '@tabler/icons-solidjs'
|
import { IconX } from '@tabler/icons-solidjs'
|
||||||
import ky from 'ky'
|
import ky from 'ky'
|
||||||
import { For, onMount } from 'solid-js'
|
import { For, onMount } from 'solid-js'
|
||||||
@ -18,12 +18,13 @@ import {
|
|||||||
} from '~/signals'
|
} from '~/signals'
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
url: z.string().nonempty(),
|
url: z.string().min(1),
|
||||||
secret: z.string(),
|
secret: z.string(),
|
||||||
})
|
})
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const [t] = useI18n()
|
const [t] = useI18n()
|
||||||
|
const location = useLocation()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const onSetupSuccess = (id: string) => {
|
const onSetupSuccess = (id: string) => {
|
||||||
@ -109,7 +110,7 @@ export default () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
const query = new URLSearchParams(window.location.search)
|
const query = new URLSearchParams(location.search)
|
||||||
|
|
||||||
if (query.has('hostname')) {
|
if (query.has('hostname')) {
|
||||||
void onSubmit({
|
void onSubmit({
|
||||||
|
Loading…
Reference in New Issue
Block a user