Add how to create token

This commit is contained in:
2023-12-14 21:07:31 +01:00
parent 2286c6a3eb
commit ecb906e614
21 changed files with 130 additions and 18 deletions

View File

@@ -68,12 +68,12 @@
}).format(dayjs(info.schem.lastUpdate).utc(false).toDate())})}</p>
<p class="!mt-0">{t("dashboard.schematic.info.item", {item: info.schem.item ?? (info.schem.type == null ? "CHEST" : "CAULDRON_ITEM")})}</p>
{#if info.members.length !== 0}
<p class="!mt-0">{t("dashboard.schematic.info.members", {members: info.members.join(", ")})}</p>
<p class="!mt-0">{t("dashboard.schematic.info.members", {members: info.members.map(value => value.name).join(", ")})}</p>
{/if}
<svelte:fragment slot="footer">
{#if (info.schem.owner === user.id)}
<button class="btn !ml-auto" on:click={download}>{t("dashboard.schematic.info.btn.download")}</button>
{/if}
<button class="btn" on:click={() => dispatch("reset")}>{t("dashboard.schematic.info.btn.close")}</button>
<button class="btn" class:!ml-auto={info.schem.owner !== user.id} on:click={() => dispatch("reset")}>{t("dashboard.schematic.info.btn.close")}</button>
</svelte:fragment>
</Modal>

View File

@@ -27,6 +27,7 @@
import SchematicInfo from "./SchematicInfo.svelte";
import UploadModal from "./UploadModal.svelte";
import type {Player} from "../types/data.ts";
import SWButton from "../styled/SWButton.svelte";
const dispatch = createEventDispatcher();
@@ -63,9 +64,9 @@
{/each}
</Breadcrumb>
<div class="flex flex-col justify-center">
<button class="btn" on:click={() => uploadOpen = true}>
<SWButton on:click={() => uploadOpen = true}>
{t("dashboard.schematic.upload")}
</button>
</SWButton>
</div>
</div>
<table>

View File

@@ -20,7 +20,7 @@
<script lang="ts">
import type {Player} from "../types/data.ts";
import {statsRepo} from "../repo/repo.ts";
import {t} from "astro-i18n"
import {astroI18n, t} from "astro-i18n"
export let user: Player;
@@ -34,7 +34,10 @@
{#await request}
<p>{t("status.loading")}</p>
{:then data}
<p>Playtime: {data.playtime}h</p>
<p>Playtime: {new Intl.NumberFormat(astroI18n.locale, {
minimumFractionDigits: 2,
maximumFractionDigits: 2
}).format(data.playtime)}h</p>
<p>Fights: {data.fights}</p>
{#if user.perms.includes("CHECK")}
<p>Schematics Checked: {data.acceptedSchematics}</p>