feat: add backup recovery, setup wizard and user-view guards
Magent CI/CD / verify (push) Successful in 5m20s
Magent CI/CD / deploy-beta (push) Successful in 1m41s

This commit is contained in:
2026-09-18 17:23:03 +12:00
parent a6a4a9aa24
commit fd6671cf7e
44 changed files with 4650 additions and 114 deletions
+5 -3
View File
@@ -5,6 +5,7 @@ import EmailReportControl from "./EmailReportControl";
import { useCallback, useEffect, useRef, useState } from "react";
import { useRouter } from "next/navigation";
import { authFetch, getApiBase } from "../../lib/auth";
import { useEffectiveRole } from "../../lib/viewMode";
import PageHeading from "../../ui/PageHeading";
import {
type Stats,
@@ -67,6 +68,7 @@ export default function MonthlyReportsPage() {
const [monthReady, setMonthReady] = useState(false);
const [months, setMonths] = useState<string[]>([]);
const [data, setData] = useState<MonthlyReport | null>(null);
const isAdmin = useEffectiveRole(data?.is_admin ? "admin" : "user") === "admin";
const [busy, setBusy] = useState(true);
const [error, setError] = useState("");
const [revision, setRevision] = useState(0);
@@ -267,11 +269,11 @@ export default function MonthlyReportsPage() {
<section className="stats-state">
<h2>Your monthly story starts here</h2>
<p>
{data.is_admin
{isAdmin
? "Connect Jellystat to bring your monthly viewing reports into Magent."
: "Monthly reports will appear once your administrator connects Jellystat."}
</p>
{data.is_admin && (
{isAdmin && (
<a className="stats-action" href="/admin/jellystat">
Connect Jellystat
</a>
@@ -285,7 +287,7 @@ export default function MonthlyReportsPage() {
Your report needs your Jellyfin account link. Sign in using Jellyfin, or ask your administrator to review
your user identities.
</p>
{data.is_admin && (
{isAdmin && (
<a className="stats-action" href="/admin/identities">
Review user identities
</a>