[F] Fix types

pull/131/head
Azalea 2025-03-17 14:02:50 -04:00
parent f7e5cd1a05
commit 7320f0ca7f
4 changed files with 9 additions and 14 deletions

View File

@ -189,6 +189,6 @@ export const SETTING = {
export const TRANSFER = {
check: (d: AllNetClient): Promise<TrCheckGood> =>
post('/api/v2/transfer/check', d),
post('/api/v2/transfer/check', {}, { body: JSON.stringify(d), headers: { 'Content-Type': 'application/json' } }),
}

View File

@ -14,8 +14,8 @@
let tab = 0
let src = JSON.parse(localStorage.getItem('src') ?? JSON.stringify({
dns: "",
card: "",
server: "",
keychip: ""
}))
let dst = JSON.parse(localStorage.getItem('dst') ?? `{ card: "", server: "", keychip: "" }`)

View File

@ -1,7 +1,7 @@
interface AllNetSrc {
card: string
server: string
dns: string
keychip: string
}

View File

@ -1,15 +1,10 @@
<script lang="ts">
import StatusOverlays from "../../components/StatusOverlays.svelte";
import { TRANSFER } from "../../libs/sdk";
import InputTextShort from "./InputTextShort.svelte";
export let src: {
card: string,
server: string,
keychip: string
}
export let gameInfo: {
game: string,
version: string,
}
export let src: AllNetSrc
export let gameInfo: AllNetGame
export let isSrc: boolean = true
let tested: boolean = false
@ -21,7 +16,7 @@
<!-- First input line -->
<div class="inputs">
<InputTextShort desc="Server Address" placeholder="e.g. http://aquadx.hydev.org"
bind:value={src.server} on:change validate={v => /^https?:\/\/[a-z0-9.-]+(:\d+)?$/i.test(v)} />
bind:value={src.dns} on:change validate={v => /^https?:\/\/[a-z0-9.-]+(:\d+)?$/i.test(v)} />
<InputTextShort desc="Keychip ID" placeholder="e.g. A0299792458"
bind:value={src.keychip} on:change validate={v => /^[A-Z0-9]{11}$/.test(v)} />
</div>
@ -91,4 +86,4 @@
&.buttons
margin-top: 1rem
</style>
</style>