mirror of https://github.com/hykilpikonna/AquaDX
[F] Fix regex
parent
05dea088df
commit
4f3a6cba45
|
@ -4,7 +4,6 @@
|
||||||
import TransferServer from "./TransferServer.svelte";
|
import TransferServer from "./TransferServer.svelte";
|
||||||
import { DATA_HOST } from "../../libs/config";
|
import { DATA_HOST } from "../../libs/config";
|
||||||
import type { ConfirmProps } from "../../libs/generalTypes";
|
import type { ConfirmProps } from "../../libs/generalTypes";
|
||||||
import ActionCard from "../../components/ActionCard.svelte";
|
|
||||||
import StatusOverlays from "../../components/StatusOverlays.svelte";
|
import StatusOverlays from "../../components/StatusOverlays.svelte";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
<InputTextShort desc="Server Address" placeholder="e.g. http://aquadx.hydev.org"
|
<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} />
|
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"
|
<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>
|
</div>
|
||||||
|
|
||||||
<!-- Second input line -->
|
<!-- Second input line -->
|
||||||
|
|
|
@ -21,7 +21,7 @@ class AllNetClient(val dns: String, val keychip: String, val game: String, val v
|
||||||
val keychipShort by lazy {
|
val keychipShort by lazy {
|
||||||
// A123-45678901337 -> A1234567890
|
// A123-45678901337 -> A1234567890
|
||||||
if (keychip.length == 11) keychip
|
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("://")) }
|
val aime by lazy { AimeDbClient(game, keychipShort, dns.substringAfter("://")) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue