Startseite, Server-Seite v2 mit Logos, Lightbox-Fix, Navbar-Ausrichtung
- Startseite (/): Hero mit CTAs (Discord-Invite + Devlogs), Live-Zahlen (Member, Server online, Spieler), Bereichs-Kacheln, neuestes Devlog als Teaser — kein Redirect mehr auf /devlogs - Server-Seite v2: Übersichtsleiste (X/Y online, Spieler gesamt), 2-Spalten-Grid, Server-Logo (neues Feld image_url, https-only, auch als Embed-Thumbnail im Discord-Status), große Spielerzahl, Uptime % + Peak aus den 24h-Samples, Adresse als Copy-Button - Lightbox: rendert jetzt per Portal in <body> (Header/Scanlines schienen durchs Overlay), Pfeile stehen neben dem Bild statt drauf, Info-Zeile unterm Bild - Navbar: Community-Dropdown-Button auf Link-Höhe ausgerichtet (line-height + align-items) - Setup Server-Tab: Logo-URL-Feld Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,7 @@ export function buildServerEmbed(r) {
|
||||
.addFields({ name: 'Status', value: r.online ? '🟢 **Online**' : '🔴 **Offline**', inline: true })
|
||||
.setFooter({ text: `${brandFooter('STATUS')}${r.ping != null ? ` • ${r.ping}ms` : ''} • alle 2 min` })
|
||||
.setTimestamp();
|
||||
if (r.image_url) embed.setThumbnail(r.image_url);
|
||||
|
||||
if (r.online && r.players != null && r.max) {
|
||||
const pct = Math.min(1, r.players / r.max);
|
||||
|
||||
@@ -531,14 +531,15 @@ db.exec(`
|
||||
if (!cols.includes('host')) db.exec(`ALTER TABLE gameservers ADD COLUMN host TEXT NOT NULL DEFAULT ''`);
|
||||
if (!cols.includes('port')) db.exec('ALTER TABLE gameservers ADD COLUMN port INTEGER');
|
||||
if (!cols.includes('connect_url')) db.exec(`ALTER TABLE gameservers ADD COLUMN connect_url TEXT NOT NULL DEFAULT ''`);
|
||||
if (!cols.includes('image_url')) db.exec(`ALTER TABLE gameservers ADD COLUMN image_url TEXT NOT NULL DEFAULT ''`);
|
||||
}
|
||||
const insertGameserver = db.prepare(`
|
||||
INSERT INTO gameservers (name, type, query_url, address, host, port, connect_url)
|
||||
VALUES (@name, @type, @query_url, @address, @host, @port, @connect_url)
|
||||
INSERT INTO gameservers (name, type, query_url, address, host, port, connect_url, image_url)
|
||||
VALUES (@name, @type, @query_url, @address, @host, @port, @connect_url, @image_url)
|
||||
`);
|
||||
const updateGameserverStmt = db.prepare(`
|
||||
UPDATE gameservers SET name = @name, type = @type, query_url = @query_url, address = @address,
|
||||
host = @host, port = @port, connect_url = @connect_url
|
||||
host = @host, port = @port, connect_url = @connect_url, image_url = @image_url
|
||||
WHERE id = @id
|
||||
`);
|
||||
const setGameserverMessageStmt = db.prepare('UPDATE gameservers SET message_id = ? WHERE id = ?');
|
||||
|
||||
@@ -134,6 +134,7 @@ export function registerApiRoutes(app, client) {
|
||||
name: s.name,
|
||||
type: s.type,
|
||||
icon: GAME_ICONS[s.type] ?? '🎮',
|
||||
image_url: s.image_url || null,
|
||||
address: s.address || null,
|
||||
connect_url: s.connect_url || null,
|
||||
online: r?.online ?? null, // null = noch nie gecheckt
|
||||
@@ -818,6 +819,9 @@ ${rssItems}
|
||||
host: host.slice(0, 120),
|
||||
port,
|
||||
connect_url: String(body.connect_url ?? '').trim().slice(0, 200),
|
||||
image_url: /^https:\/\/.+/.test(String(body.image_url ?? '').trim())
|
||||
? String(body.image_url).trim().slice(0, 300)
|
||||
: '',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user