Add a power history to each game server

Each change a read of a Fragnet account sees, and each power signal sent from
here with who sent it, is written down (180 days). A server's details show the
share of the last 30 days it was on, starts and stops, a seven-day bar and the
latest changes, with who asked for them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-10 19:30:27 +01:00
1 parent 9126200295
commit a2b43bcd5d
14 files changed
+9773 -4

No files matched your search

+19
View File
@@ -1662,6 +1662,25 @@ export const jellyfinReadings = sqliteTable(
// ─── Duplicati ──────────────────────────────────────────────────────────────
// A game server's power history (services/fragnetPower.ts): each change a read of a Fragnet account saw (on or off), the starting point of a server when it was first read, and each power signal somebody sent
// from here — with who, so a change can say who did it. Kept 180 days.
export const fragnetPowerLog = sqliteTable(
"fragnet_power_log",
{
id: integer("id").primaryKey({ autoIncrement: true }),
integrationId: integer("integration_id")
.notNull()
.references(() => integrations.id, { onDelete: "cascade" }),
serverId: text("server_id").notNull(), // the panel's short id for the server
serverName: text("server_name").notNull(),
at: text("at").notNull(), // ISO
kind: text("kind").notNull(), // on | off | start_on | start_off | signal
detail: text("detail"), // the signal (start, stop, restart, kill)
by: text("by"), // who sent the signal
},
(t) => [index("fragnet_power_log_idx").on(t.integrationId, t.serverId, t.at)],
);
// What was sent: one row for each notification, with how it went through each channel, so "why did I not get it?" has an answer. Kept 30 days and at most 1000 rows (services/notificationLog.ts).
export const notificationLog = sqliteTable(
"notification_log",