Add how to create token
Dieser Commit ist enthalten in:
Ursprung
2286c6a3eb
Commit
ecb906e614
1
.gitignore
vendored
1
.gitignore
vendored
@ -22,3 +22,4 @@ pnpm-debug.log*
|
|||||||
/.astro-i18n/
|
/.astro-i18n/
|
||||||
/bun.lockb
|
/bun.lockb
|
||||||
/src/pages/de/
|
/src/pages/de/
|
||||||
|
/steamwar-website.zip
|
||||||
|
@ -22,6 +22,7 @@ export default defineAstroI18nConfig({
|
|||||||
stats: "statistiken",
|
stats: "statistiken",
|
||||||
announcements: "ankuendigungen",
|
announcements: "ankuendigungen",
|
||||||
"privacy-policy": "datenschutzerklaerung",
|
"privacy-policy": "datenschutzerklaerung",
|
||||||
|
"create-token": "token-erstellen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
@ -17,7 +17,9 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
compressHTML: true,
|
compressHTML: true,
|
||||||
site: "https://steamwar.de",
|
site: "https://steamwar.de",
|
||||||
integrations: [svelte(), tailwind(), configureI18n(), sitemap({
|
integrations: [svelte(), tailwind({
|
||||||
|
configFile: "./tailwind.config.cjs"
|
||||||
|
}), configureI18n(), sitemap({
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: "en",
|
defaultLocale: "en",
|
||||||
locales: {
|
locales: {
|
||||||
|
@ -11,7 +11,11 @@
|
|||||||
"i18n:extract": "astro-i18n extract",
|
"i18n:extract": "astro-i18n extract",
|
||||||
"i18n:generate:pages": "astro-i18n generate:pages --purge",
|
"i18n:generate:pages": "astro-i18n generate:pages --purge",
|
||||||
"i18n:generate:types": "astro-i18n generate:types",
|
"i18n:generate:types": "astro-i18n generate:types",
|
||||||
"i18n:sync": "npm run i18n:generate:pages && npm run i18n:generate:types"
|
"i18n:sync": "pnpm run i18n:generate:pages && pnpm run i18n:generate:types",
|
||||||
|
"package": "cd dist && zip -r steamwar-website.zip * && cd ..",
|
||||||
|
"clean:dist": "rm -rf dist",
|
||||||
|
"clean:node_modules": "rm -rf node_modules",
|
||||||
|
"ci": "pnpm run clean:dist && pnpm install && pnpm run i18n:sync && pnpm run build && pnpm run package"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@astrojs/svelte": "^5.0.0",
|
"@astrojs/svelte": "^5.0.0",
|
||||||
|
@ -44,7 +44,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const colors = ["#abfa91", "#279900", "#00ffbe", "#9297fb", "#050b9d", "#b60fff", "#8dddfc", "#0880ad", "#41ff00", "#039973", "#96fce2", "#0009ff", "#7501a4", "#e2a2fb", "#00b9ff"];
|
const colors = ["#abfa91", "#279900", "#00ffbe", "#9297fb", "#050b9d", "#b60fff", "#8dddfc", "#0880ad", "#41ff00", "#039973", "#96fce2", "#0009ff", "#7501a4", "#e2a2fb", "#00b9ff"];
|
||||||
const map = Map.groupBy(data, entry => entry.gamemode);
|
const map = new Map<string, { x: string, y: number }[]>()
|
||||||
|
for (const point of data) {
|
||||||
|
const dataset = map.get(point.gamemode) ?? []
|
||||||
|
|
||||||
|
dataset.push({
|
||||||
|
x: point.date,
|
||||||
|
y: point.count
|
||||||
|
})
|
||||||
|
|
||||||
|
map.set(point.gamemode, dataset)
|
||||||
|
}
|
||||||
|
|
||||||
chart = new Chart(
|
chart = new Chart(
|
||||||
canvas,
|
canvas,
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
<input type="password" id="token" name="token" placeholder={t("login.placeholder.token")} bind:value={token} />
|
<input type="password" id="token" name="token" placeholder={t("login.placeholder.token")} bind:value={token} />
|
||||||
</div>
|
</div>
|
||||||
<p class="mt-2">
|
<p class="mt-2">
|
||||||
<a class="text-neutral-500 hover:underline" href={l("/help/token")}>{t("login.generateToken")}</a></p>
|
<a class="text-neutral-500 hover:underline" href={l("/token-erstellen")}>{t("login.generateToken")}</a></p>
|
||||||
|
|
||||||
{#if error}
|
{#if error}
|
||||||
<p class="mt-2 text-red-500">{error}</p>
|
<p class="mt-2 text-red-500">{error}</p>
|
||||||
|
@ -68,12 +68,12 @@
|
|||||||
}).format(dayjs(info.schem.lastUpdate).utc(false).toDate())})}</p>
|
}).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>
|
<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}
|
{#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}
|
{/if}
|
||||||
<svelte:fragment slot="footer">
|
<svelte:fragment slot="footer">
|
||||||
{#if (info.schem.owner === user.id)}
|
{#if (info.schem.owner === user.id)}
|
||||||
<button class="btn !ml-auto" on:click={download}>{t("dashboard.schematic.info.btn.download")}</button>
|
<button class="btn !ml-auto" on:click={download}>{t("dashboard.schematic.info.btn.download")}</button>
|
||||||
{/if}
|
{/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>
|
</svelte:fragment>
|
||||||
</Modal>
|
</Modal>
|
@ -27,6 +27,7 @@
|
|||||||
import SchematicInfo from "./SchematicInfo.svelte";
|
import SchematicInfo from "./SchematicInfo.svelte";
|
||||||
import UploadModal from "./UploadModal.svelte";
|
import UploadModal from "./UploadModal.svelte";
|
||||||
import type {Player} from "../types/data.ts";
|
import type {Player} from "../types/data.ts";
|
||||||
|
import SWButton from "../styled/SWButton.svelte";
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
@ -63,9 +64,9 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</Breadcrumb>
|
</Breadcrumb>
|
||||||
<div class="flex flex-col justify-center">
|
<div class="flex flex-col justify-center">
|
||||||
<button class="btn" on:click={() => uploadOpen = true}>
|
<SWButton on:click={() => uploadOpen = true}>
|
||||||
{t("dashboard.schematic.upload")}
|
{t("dashboard.schematic.upload")}
|
||||||
</button>
|
</SWButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type {Player} from "../types/data.ts";
|
import type {Player} from "../types/data.ts";
|
||||||
import {statsRepo} from "../repo/repo.ts";
|
import {statsRepo} from "../repo/repo.ts";
|
||||||
import {t} from "astro-i18n"
|
import {astroI18n, t} from "astro-i18n"
|
||||||
|
|
||||||
export let user: Player;
|
export let user: Player;
|
||||||
|
|
||||||
@ -34,7 +34,10 @@
|
|||||||
{#await request}
|
{#await request}
|
||||||
<p>{t("status.loading")}</p>
|
<p>{t("status.loading")}</p>
|
||||||
{:then data}
|
{: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>
|
<p>Fights: {data.fights}</p>
|
||||||
{#if user.perms.includes("CHECK")}
|
{#if user.perms.includes("CHECK")}
|
||||||
<p>Schematics Checked: {data.acceptedSchematics}</p>
|
<p>Schematics Checked: {data.acceptedSchematics}</p>
|
||||||
|
27
src/components/styled/SWButton.svelte
Normale Datei
27
src/components/styled/SWButton.svelte
Normale Datei
@ -0,0 +1,27 @@
|
|||||||
|
<!--
|
||||||
|
- This file is a part of the SteamWar software.
|
||||||
|
-
|
||||||
|
- Copyright (C) 2023 SteamWar.de-Serverteam
|
||||||
|
-
|
||||||
|
- This program is free software: you can redistribute it and/or modify
|
||||||
|
- it under the terms of the GNU Affero General Public License as published by
|
||||||
|
- the Free Software Foundation, either version 3 of the License, or
|
||||||
|
- (at your option) any later version.
|
||||||
|
-
|
||||||
|
- This program is distributed in the hope that it will be useful,
|
||||||
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
- GNU Affero General Public License for more details.
|
||||||
|
-
|
||||||
|
- You should have received a copy of the GNU Affero General Public License
|
||||||
|
- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
|
||||||
|
export let type: "primary" | "ghost" | "gray" = "primary";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<button on:click class="btn" class:btn-gray={type === "gray"} class:btn-text={type === "ghost"}>
|
||||||
|
<slot />
|
||||||
|
</button>
|
@ -4,7 +4,6 @@ description: Über SteamWar
|
|||||||
slug: ueber-uns
|
slug: ueber-uns
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
# Sicherheit
|
# Sicherheit
|
||||||
|
|
||||||
Wir legen Wert auf Sicherheit.
|
Wir legen Wert auf Sicherheit.
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
---
|
---
|
||||||
title: Join Now!
|
title: Jetzt Spielen!
|
||||||
description: SteamWar Joinen
|
description: SteamWar Joinen
|
||||||
slug: jetzt-spielen
|
slug: jetzt-spielen
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
# Minecraft Java Edition
|
# Minecraft Java Edition
|
||||||
|
|
||||||
1. Klicke in Minecraft auf »Mehrspieler«
|
1. Klicke in Minecraft auf »Mehrspieler«
|
||||||
|
22
src/content/pages/de/token.md
Normale Datei
22
src/content/pages/de/token.md
Normale Datei
@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
title: Erstelle einen Token für die Webseite
|
||||||
|
description: Erstelle einen Token für die Webseite
|
||||||
|
slug: token-erstellen
|
||||||
|
---
|
||||||
|
|
||||||
|
Ein Token ist ein Schlüssel, mit dem du dich auf der Webseite als Spieler identifizieren kannst. Dieser wird benötigt, um z.B. deine Schematics anzuzeigen.
|
||||||
|
|
||||||
|
## Token erstellen
|
||||||
|
|
||||||
|
Um einen Token zu erstellen, musst du dich auf dem Minecraftserver einloggen und `/token create <name>` eingeben. Der Name ist frei wählbar und dient nur zur Identifikation. Du kannst auch mehrere Tokens erstellen.
|
||||||
|
Du erhältst dann eine Nachricht, auf der du mit einem Klick den Token in die Zwischenablage kopieren kannst. Dieser Token ist nur einmal sichtbar, bei Verlust musst du einen neuen erstellen.
|
||||||
|
|
||||||
|
## Token verwenden
|
||||||
|
|
||||||
|
Um den Token zu verwenden, kannst du ihn unter dem Menüpunkt `Konto` auf der Webseite eingeben um dich zu identifizieren. Dazu wird dann auch dein Minecraftname benötigt.
|
||||||
|
|
||||||
|
Wenn du erfolgreich mit dem Token eingeloggt wurdest, wirst du auf die Dashboardseite weitergeleitet. Dort kannst du dann deine Schematics und Statistiken sehen.
|
||||||
|
|
||||||
|
## Token löschen
|
||||||
|
|
||||||
|
Um einen Token zu löschen, musst du auf dem Minecraftserver `/token` eingeben. Dadurch wird eine Liste mit allen deinen Tokens angezeigt. Mit einem Klick auf den Token kannst du ihn löschen.
|
@ -4,7 +4,6 @@ description: About SteamWar
|
|||||||
slug: about
|
slug: about
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
# Security
|
# Security
|
||||||
|
|
||||||
We value security.
|
We value security.
|
||||||
|
@ -4,7 +4,6 @@ description: Code of Conduct of SteamWar.de
|
|||||||
slug: code-of-conduct
|
slug: code-of-conduct
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
# General behavior
|
# General behavior
|
||||||
|
|
||||||
It is crucial to us, that our players find themselves in a friendly environment
|
It is crucial to us, that our players find themselves in a friendly environment
|
||||||
|
@ -5,7 +5,6 @@ slug: join
|
|||||||
german: true
|
german: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
# Minecraft Java Edition
|
# Minecraft Java Edition
|
||||||
|
|
||||||
1. Klicke in Minecraft auf »Mehrspieler«
|
1. Klicke in Minecraft auf »Mehrspieler«
|
||||||
|
23
src/content/pages/en/token.md
Normale Datei
23
src/content/pages/en/token.md
Normale Datei
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
title: Erstelle einen Token für die Webseite
|
||||||
|
description: Erstelle einen Token für die Webseite
|
||||||
|
german: true
|
||||||
|
slug: create-token
|
||||||
|
---
|
||||||
|
|
||||||
|
Ein Token ist ein Schlüssel, mit dem du dich auf der Webseite als Spieler identifizieren kannst. Dieser wird benötigt, um z.B. deine Schematics anzuzeigen.
|
||||||
|
|
||||||
|
## Token erstellen
|
||||||
|
|
||||||
|
Um einen Token zu erstellen, musst du dich auf dem Minecraftserver einloggen und `/token create <name>` eingeben. Der Name ist frei wählbar und dient nur zur Identifikation. Du kannst auch mehrere Tokens erstellen.
|
||||||
|
Du erhältst dann eine Nachricht, auf der du mit einem Klick den Token in die Zwischenablage kopieren kannst. Dieser Token ist nur einmal sichtbar, bei Verlust musst du einen neuen erstellen.
|
||||||
|
|
||||||
|
## Token verwenden
|
||||||
|
|
||||||
|
Um den Token zu verwenden, kannst du ihn unter dem Menüpunkt `Konto` auf der Webseite eingeben um dich zu identifizieren. Dazu wird dann auch dein Minecraftname benötigt.
|
||||||
|
|
||||||
|
Wenn du erfolgreich mit dem Token eingeloggt wurdest, wirst du auf die Dashboardseite weitergeleitet. Dort kannst du dann deine Schematics und Statistiken sehen.
|
||||||
|
|
||||||
|
## Token löschen
|
||||||
|
|
||||||
|
Um einen Token zu löschen, musst du auf dem Minecraftserver `/token` eingeben. Dadurch wird eine Liste mit allen deinen Tokens angezeigt. Mit einem Klick auf den Token kannst du ihn löschen.
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
import '../styles/tailwind.css'
|
||||||
import icon from '../images/logo.png';
|
import icon from '../images/logo.png';
|
||||||
import {getImage} from "astro:assets";
|
import {getImage} from "astro:assets";
|
||||||
import {astroI18n} from "astro-i18n";
|
import {astroI18n} from "astro-i18n";
|
||||||
|
@ -133,7 +133,7 @@ function mapMap<T, K, J>(i: Map<T, K>, fn: (key: T, value: K) => J): J[] {
|
|||||||
<div class="bg-zinc-50 border-gray-100 py-24 px-12 border-2 m-2 transition duration-300 ease-in-out rounded-xl shadow-lg
|
<div class="bg-zinc-50 border-gray-100 py-24 px-12 border-2 m-2 transition duration-300 ease-in-out rounded-xl shadow-lg
|
||||||
hover:scale-105 hover:shadow-2xl
|
hover:scale-105 hover:shadow-2xl
|
||||||
dark:bg-neutral-900 dark:border-gray-800 dark:text-white">
|
dark:bg-neutral-900 dark:border-gray-800 dark:text-white">
|
||||||
<figure>
|
<figure class="flex flex-col items-center">
|
||||||
<figcaption class="text-center mb-4 text-2xl">{v.name}</figcaption>
|
<figcaption class="text-center mb-4 text-2xl">{v.name}</figcaption>
|
||||||
<Image src={`https://visage.surgeplay.com/bust/150/${v.uuid}`} class="transition duration-300 ease-in-out hover:scale-110 hover:drop-shadow-2xl" alt={v.name + "s bust"} width="150" height="150" />
|
<Image src={`https://visage.surgeplay.com/bust/150/${v.uuid}`} class="transition duration-300 ease-in-out hover:scale-110 hover:drop-shadow-2xl" alt={v.name + "s bust"} width="150" height="150" />
|
||||||
</figure>
|
</figure>
|
||||||
|
22
src/styles/tailwind.css
Normale Datei
22
src/styles/tailwind.css
Normale Datei
@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2023 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
@ -17,4 +17,5 @@ module.exports = {
|
|||||||
plugins: [
|
plugins: [
|
||||||
require('flowbite/plugin')
|
require('flowbite/plugin')
|
||||||
],
|
],
|
||||||
|
darkMode: 'class'
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren