diff --git a/AquaNet/bun.lockb b/AquaNet/bun.lockb
index 79a22916..8cd8a7e8 100755
Binary files a/AquaNet/bun.lockb and b/AquaNet/bun.lockb differ
diff --git a/AquaNet/src/App.svelte b/AquaNet/src/App.svelte
index 64268330..05d62511 100644
--- a/AquaNet/src/App.svelte
+++ b/AquaNet/src/App.svelte
@@ -13,6 +13,9 @@
import { t } from "./libs/i18n";
import Transfer from "./pages/Transfer/Transfer.svelte";
import { link } from "d3";
+ import Communities from "./pages/Home/Communities.svelte";
+ import LinkCard from "./pages/Home/LinkCard.svelte";
+ import SetupInstructions from "./pages/Home/SetupInstructions.svelte";
console.log(`%c
┏━┓ ┳━┓━┓┏━
@@ -82,7 +85,9 @@
-
+
+
+
diff --git a/AquaNet/src/app.sass b/AquaNet/src/app.sass
index 0301b28f..986f37dd 100644
--- a/AquaNet/src/app.sass
+++ b/AquaNet/src/app.sass
@@ -55,6 +55,29 @@ blockquote
border-left: solid #ff7c7c 3px
border-radius: vars.$border-radius
+ &::before
+ content: "⚠"
+ margin-right: 1em
+
+ &.success
+ $c1: rgba(156, 255, 149, 0.05)
+ $c2: rgba(152, 255, 174, 0.02)
+ background: repeating-linear-gradient(45deg, $c1, $c1 10px, $c2 10px, $c2 20px)
+ border-left: solid #97fa8c 3px
+
+ &::before
+ content: "✓"
+ margin-right: 1em
+
+ &.info
+ $c1: rgba(149, 183, 255, 0.05)
+ $c2: rgba(152, 186, 255, 0.02)
+ background: repeating-linear-gradient(45deg, $c1, $c1 10px, $c2 10px, $c2 20px)
+ border-left: solid #6e8bff 3px
+
+ &::before
+ content: "♢"
+ margin-right: 1em
#app
width: 100%
diff --git a/AquaNet/src/components/ActionCard.svelte b/AquaNet/src/components/ActionCard.svelte
index 036699ae..43e5b653 100644
--- a/AquaNet/src/components/ActionCard.svelte
+++ b/AquaNet/src/components/ActionCard.svelte
@@ -5,6 +5,8 @@
export let color: string = '179, 198, 255'
export let icon: string
+ export let href: string | undefined
+ export let isSmall: boolean = false
// Manually positioned icons
const iconPos = [
@@ -19,7 +21,7 @@
]
-
+
diff --git a/AquaNet/src/pages/Home/Communities.svelte b/AquaNet/src/pages/Home/Communities.svelte
index 6c117d2f..7abaf3b6 100644
--- a/AquaNet/src/pages/Home/Communities.svelte
+++ b/AquaNet/src/pages/Home/Communities.svelte
@@ -4,30 +4,34 @@
import { t } from "../../libs/i18n";
import CommunityCard from "../../components/CommunityCard.svelte";
import { DISCORD_INVITE, QQ_INVITE, TELEGRAM_INVITE } from "../../libs/config";
+ import DashboardTabs from "./DashboardTabs.svelte";
-
-
{t('home.join-community')}
-
- {#if DISCORD_INVITE}
-
window.location.href = DISCORD_INVITE}>
- {t('home.community.discord')}
-
- {/if}
+
+
+
+
{t('home.join-community')}
+
+ {#if DISCORD_INVITE}
+
+ {t('home.community.discord')}
+
+ {/if}
- {#if TELEGRAM_INVITE}
- window.location.href = TELEGRAM_INVITE}>
- {t('home.community.telegram')}
-
- {/if}
+ {#if TELEGRAM_INVITE}
+
+ {t('home.community.telegram')}
+
+ {/if}
- {#if QQ_INVITE}
- window.location.href = QQ_INVITE}>
- {t('home.community.qq')}
-
- {/if}
+ {#if QQ_INVITE}
+
+ {t('home.community.qq')}
+
+ {/if}
+
-
+
\ No newline at end of file
diff --git a/AquaNet/src/pages/Home/LinkCard.svelte b/AquaNet/src/pages/Home/LinkCard.svelte
index 4667caff..47923bf5 100644
--- a/AquaNet/src/pages/Home/LinkCard.svelte
+++ b/AquaNet/src/pages/Home/LinkCard.svelte
@@ -8,6 +8,7 @@
import Icon from "@iconify/svelte"
import StatusOverlays from "../../components/StatusOverlays.svelte"
import { t } from "../../libs/i18n"
+ import DashboardTabs from "./DashboardTabs.svelte";
// State
let state: 'ready' | 'linking-AC' | 'linking-SN' | 'loading' = "loading"
@@ -262,125 +263,147 @@
break
}
}
+
+ function generateRandom() {
+ inputAC = "";
+ while (inputAC.length < 20) {
+ let digit = Math.floor(Math.random() * 10);
+ if (!((digit == 5 || digit == 3) && inputAC.length == 0))
+ inputAC += digit;
+ };
+ inputACChange();
+ }
-
-
e.preventDefault()}>
-
{t('home.linkcard.cards')}
-
{t('home.linkcard.description')}:
+
+
+
+ e.preventDefault()}>
- {#if me}
-
- {#each me.cards as card (card.luid)}
-
-
{card.isGhost ? t('home.linkcard.account-card') : cardType(card.luid)}
-
{t('home.linkcard.registered')}: {moment(card.registerTime).format("YYYY MMM DD")}
-
{t('home.linkcard.lastused')}: {moment(card.accessTime).format("YYYY MMM DD")}
-
-
{formatLUID(card.luid, card.isGhost)}
+ {#if me && me.cards && me.cards.find(card => !card.isGhost)}
+
{t('home.linkcard.cards')}
+
{t('home.linkcard.description')}:
+
+
+ {#each me.cards as card (card.luid)}
+
{#if !card.isGhost}
-
+
+
{card.isGhost ? t('home.linkcard.account-card') : cardType(card.luid)}
+
{t('home.linkcard.registered')}: {moment(card.registerTime).format("YYYY MMM DD")}
+
{t('home.linkcard.lastused')}: {moment(card.accessTime).format("YYYY MMM DD")}
+
+
+
{@html formatLUID(card.luid, card.isGhost)
+ .split(" ").map(v => `${v}`).join("")
+ .split(":").map((v, i, a) => `${v}${i < a.length - 1 ? ":" : ""}`).join("")}
+ {#if !card.isGhost}
+
+ {/if}
+
{/if}
-
- {/each}
-
- {/if}
-
-
{t('home.link-card')}
-
{t('home.linkcard.enter-info')}:
- {#if !inputSN}
-
-
{t('home.linkcard.access-code')}
-
-
{t('home.linkcard.kdx-notice')}
- {#if errorAC}
-
{errorAC}
- {/if}
- {#if warningAC}
-
-
- {#each warningAC.trim().split("\n") as paragraph}
-
{paragraph}
- {/each}
-
- {/if}
-
- {/if}
-
- {#if !inputAC}
-
-
{t('home.linkcard.enter-sn1')}
- (Android /
- Apple)
- {t('home.linkcard.enter-sn2')}
-
-
- {#if errorSN}
-
{errorSN}
- {/if}
-
- {/if}
-
- {#if conflictOld && conflictNew && me}
-
-
-
{t('home.linkcard.data-conflict')}
-
-
-
linkConflictContinue('old')}
- role="button" tabindex="0" on:keydown={e => e.key === "Enter" && linkConflictContinue('old')}>
- {t('home.linkcard.account-card')}
- {t('home.linkcard.name')}: {conflictOld.name}
- {t('home.linkcard.rating')}: {conflictOld.rating}
- {t('home.linkcard.last-login')}: {moment(conflictOld.lastLogin).format("YYYY MMM DD")}
- {formatLUID(me.ghostCard.luid, true)}
-
-
linkConflictContinue('new')}
- role="button" tabindex="0" on:keydown={e => e.key === "Enter" && linkConflictContinue('new')}>
- {cardType(conflictCardID)}
- {t('home.linkcard.name')}: {conflictNew.name}
- {t('home.linkcard.rating')}: {conflictNew.rating}
- {t('home.linkcard.last-login')}: {moment(conflictNew.lastLogin).format("YYYY MMM DD")}
- {conflictCardID}
-
-
-
+ {/each}
-
- {/if}
+
+ {t('home.linkcard.card-security-warning')}
+
+ {/if}
-
-
+
{t('home.link-card')}
+
{t('home.linkcard.enter-info')}
+ {#if !inputSN}
+
+
{t('home.linkcard.access-code')}
+
+
+ {#if errorAC}
+
{errorAC}
+ {/if}
+ {#if warningAC}
+
+
+ {#each warningAC.trim().split("\n") as paragraph}
+
{paragraph}
+ {/each}
+
+ {/if}
+
+ {/if}
+
+ {#if !inputAC}
+
+
{@html t('home.linkcard.enter-sn')}
+
+
+ {#if errorSN}
+
{errorSN}
+ {/if}
+
+ {/if}
+
+ {#if conflictOld && conflictNew && me}
+
+
+
{t('home.linkcard.data-conflict')}
+
+
+
linkConflictContinue('old')}
+ role="button" tabindex="0" on:keydown={e => e.key === "Enter" && linkConflictContinue('old')}>
+ {t('home.linkcard.account-card')}
+ {t('home.linkcard.name')}: {conflictOld.name}
+ {t('home.linkcard.rating')}: {conflictOld.rating}
+ {t('home.linkcard.last-login')}: {moment(conflictOld.lastLogin).format("YYYY MMM DD")}
+ {formatLUID(me.ghostCard.luid, true)}
+
+
linkConflictContinue('new')}
+ role="button" tabindex="0" on:keydown={e => e.key === "Enter" && linkConflictContinue('new')}>
+ {cardType(conflictCardID)}
+ {t('home.linkcard.name')}: {conflictNew.name}
+ {t('home.linkcard.rating')}: {conflictNew.rating}
+ {t('home.linkcard.last-login')}: {moment(conflictNew.lastLogin).format("YYYY MMM DD")}
+ {conflictCardID}
+
+
+
+
+
+ {/if}
+
+
+
+
diff --git a/AquaNet/src/pages/Home/SetupInstructions.svelte b/AquaNet/src/pages/Home/SetupInstructions.svelte
index 1a929ecc..ffe5ea41 100644
--- a/AquaNet/src/pages/Home/SetupInstructions.svelte
+++ b/AquaNet/src/pages/Home/SetupInstructions.svelte
@@ -7,80 +7,105 @@
import { codeToHtml } from 'shiki'
import { AQUA_CONNECTION, DISCORD_INVITE, FADE_IN, FADE_OUT } from "../../libs/config";
import { t } from "../../libs/i18n";
+ import DashboardTabs from "./DashboardTabs.svelte";
+ import { patchUserSegatools } from "../../libs/setup";
let user: AquaNetUser
let keychip: string;
let keychipCode: string;
- let getStartedRequesting = false;
+
+ let exposeKeychip = false;
+ let automaticSetupStatus: "none" | "success" | "failure" = "none";
USER.me().then((u) => {
user = u;
- });
-
- function getStarted() {
- if (getStartedRequesting) return;
-
- getStartedRequesting = true;
USER.keychip().then(k => {
- getStartedRequesting = false;
- keychip = k;
+ keychip = `${k.slice(0, 4)}-${k.slice(4)}1337`;
codeToHtml(`
[dns]
default=${AQUA_CONNECTION}
[keychip]
enable=1
-; ${t('home.setup.keychip-tips')}
-id=${keychip.slice(0, 4)}-${keychip.slice(4)}1337`.trim(), {
+id=${keychip}`.trim(), {
lang: 'ini',
theme: 'rose-pine',
+ transformers: []
}).then((html) => {
keychipCode = html;
});
});
+ });
+
+ async function patchSegatools() {
+ automaticSetupStatus = await patchUserSegatools({ keychip, dns: AQUA_CONNECTION }) ? "success" : "failure";
}
-
-
{t('home.setup')}
-
- {t('home.setup.welcome')}
-
-
- {t('home.setup.blockquote')}
-
+
+
+
+
{t('home.setup')}
- {#if user}
-
- {#if !keychip && !keychipCode}
-
-
+ {#if keychip}
+
+ 1.
{@html t('setup.steps.one')}
+
+
+
+ {t('setup.keychip-warning')}
+
+
+
+ {t('setup.type.automatic')}
+ {@html t('setup.automatic')}
+ {#if automaticSetupStatus != "none"}
+
+ {t(`setup.automatic.${automaticSetupStatus}`)}
+
+ {/if}
+
+
- {:else}
-
-
- {t('home.setup.edit')}:
-
+
-
+
+ {t('setup.type.manual')}
+ {@html t('setup.manual')}
+
+
{@html keychipCode}
-
-
- {t('home.setup.test')}
-
-
- {t('home.setup.ask')} Discord {t('home.setup.support')}.
-
+ {#if !exposeKeychip}
+
+ {/if}
- {/if}
-
- {:else}
-
Loading...
- {/if}
-
+
+
+
+
+ 2.
{@html t('setup.steps.two')}
+
+
+ 3.
{@html t('setup.steps.three')}
+
+
+ 4.
{@html t('setup.steps.four')}
+
+
+
+ {@html t('setup.support-info')}
+
+ {:else}
+
{t('loading')}
+ {/if}
+
+