mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-12-14 11:56:15 +08:00
[F] Fix regex
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
import TransferServer from "./TransferServer.svelte";
|
||||
import { DATA_HOST } from "../../libs/config";
|
||||
import type { ConfirmProps } from "../../libs/generalTypes";
|
||||
import ActionCard from "../../components/ActionCard.svelte";
|
||||
import StatusOverlays from "../../components/StatusOverlays.svelte";
|
||||
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
<InputTextShort desc="Server Address" placeholder="e.g. http://aquadx.hydev.org"
|
||||
bind:value={src.dns} on:change validate={v => /^https?:\/\/[a-z0-9.-]+(:\d+)?$/i.test(v)} disabled={tested} />
|
||||
<InputTextShort desc="Keychip ID" placeholder="e.g. A0299792458"
|
||||
bind:value={src.keychip} on:change validate={v => /^[A-Z0-9]{11}$/.test(v)} disabled={tested} />
|
||||
bind:value={src.keychip} on:change validate={v => /^([A-Z0-9]{11}|[A-Z0-9]{4}-[A-Z0-9]{11})$/.test(v)} disabled={tested} />
|
||||
</div>
|
||||
|
||||
<!-- Second input line -->
|
||||
|
||||
@@ -21,7 +21,7 @@ class AllNetClient(val dns: String, val keychip: String, val game: String, val v
|
||||
val keychipShort by lazy {
|
||||
// A123-45678901337 -> A1234567890
|
||||
if (keychip.length == 11) keychip
|
||||
else keychip.substring(0, 4) + keychip.substring(5, 11)
|
||||
else keychip.substring(0, 4) + keychip.substring(5, 12)
|
||||
}
|
||||
val aime by lazy { AimeDbClient(game, keychipShort, dns.substringAfter("://")) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user