⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.
TypeScript honoissue-managementissue-trackerjira-alternativekanbanlinear-alternativemcpproject-managementreactself-hostedtypescript
feat(admin): add instance overview dashboard
Tin976d06098a12
diff --git a/apps/api/src/admin/controllers/get-overview.ts b/apps/api/src/admin/controllers/get-overview.tsnew file mode 100644index 000000000..45f646d3e--- /dev/null+++ b/apps/api/src/admin/controllers/get-overview.ts@@ -0,0 +1,122 @@+import { and, count, desc, eq, exists, gte, sql } from "drizzle-orm";+import db, { schema } from "../../database";+import { instanceAdminRoleSql } from "../../utils/instance-admin-role";+import { notBannedCondition } from "../../utils/user-ban";+import { configurationWarnings } from "../overview/configuration-warnings";+import { getServiceStatus } from "../system/get-service-status";++export default async function getOverview() {+ const {+ userTable: user,+ sessionTable: session,+ workspaceTable: workspace,+ adminAuditLogTable: audit,+ } = schema;+ const cutoff = new Date(Date.now() - 30 * 24 * 60 * 60 * 1_000);+ const enabled = notBannedCondition();+ const recentlyActive = exists(+ db+ .select({ id: session.id })+ .from(session)+ .where(and(eq(session.userId, user.id), gte(session.updatedAt, cutoff))),+ );+ const [+ [+ users = {+ total: 0,+ activeLast30Days: 0,+ deactivated: 0,+ enabledAdmins: 0,+ },+ ],+ [workspaces = { total: 0, archived: 0 }],+ recentUsers,+ recentActions,+ services,+ ] = await Promise.all([+ db+ .select({+ total: count(),+ activeLast30Days:+ sql`count(*) filter (where ${enabled} and ${recentlyActive})`.mapWith(+ Number,+ ),+ deactivated: sql`count(*) filter (where not (${enabled}))`.mapWith(+ Number,+ ),+ enabledAdmins:+ sql`count(*) filter (where ${enabled} and ${instanceAdminRoleSql(user.role)})`.mapWith(+ Number,+ ),+ })+ .from(user),+ db+ .select({+ total: count(),+ archived:+ sql`count(*) filter (where ${workspace.archivedAt} is not null)`.mapWith(+ Number,+ ),+ })+ .from(workspace),+ db+ .select({+ id: user.id,+ name: user.name,+ email: user.email,+ image: user.image,+ createdAt: user.createdAt,+ })+ .from(user)+ .orderBy(desc(user.createdAt), desc(user.id))+ .limit(5),+ db+ .select({+ id: audit.id,+ createdAt: audit.createdAt,+ action: audit.action,+ actor: {+ id: audit.actorUserId,+ name: audit.actorName,+ email: audit.actorEmail,+ },+ targetType: audit.targetType,+ targetId: audit.targetId,+ targetLabel: audit.targetLabel,+ })+ .from(audit)+ .orderBy(desc(audit.createdAt), desc(audit.id))+ .limit(5),+ getServiceStatus(),+ ]);+ return {+ users: {+ total: users.total,+ activeLast30Days: users.activeLast30Days,+ deactivated: users.deactivated,+ },+ workspaces,+ recentUsers: recentUsers.map((row) => ({+ ...row,+ createdAt: row.createdAt.toISOString(),+ })),+ recentActions: recentActions.map((row) => ({+ ...row,+ createdAt: row.createdAt.toISOString(),+ })),+ services: {+ checkedAt: services.checkedAt,+ api: services.api.status,+ database: services.database.status,+ realtime: services.realtime.status,+ redis: services.redis.status,+ email: services.email.status,+ storage: services.storage.status,+ },+ warnings: configurationWarnings(+ services,+ process.env.DISABLE_REGISTRATION !== "true",+ users.enabledAdmins,+ ),+ };+}diff --git a/apps/api/src/admin/controllers/get-system-status.ts b/apps/api/src/admin/controllers/get-system-status.tsindex 53b92fddb..febb4f077 100644--- a/apps/api/src/admin/controllers/get-system-status.ts+++ b/apps/api/src/admin/controllers/get-system-status.ts@@ -1,44 +1,16 @@import { readAppVersion } from "../../app-version";-import { getLocalRealtimeStats } from "../../ws";import { describeAuth } from "../system/describe-auth";+import { getServiceStatus } from "../system/get-service-status";import { listIntegrationProviders } from "../system/list-integration-providers";-import { probeDatabase } from "../system/probe-database";-import { probeEmail } from "../system/probe-email";-import { probeRedis } from "../system/probe-redis";-import { probeStorage } from "../system/probe-storage";-import { realtimeStatus } from "../system/realtime-status";--const PROBE_TIMEOUT_MS = 3_000;async function getSystemStatus() {- const [database, redis, email, storage, integrations] = await Promise.all([- probeDatabase(PROBE_TIMEOUT_MS),- probeRedis(PROBE_TIMEOUT_MS),- probeEmail(PROBE_TIMEOUT_MS),- probeStorage(PROBE_TIMEOUT_MS),- listIntegrationProviders(PROBE_TIMEOUT_MS),+ const [services, integrations] = await Promise.all([+ getServiceStatus(),+ listIntegrationProviders(3_000),]);- const realtime = getLocalRealtimeStats();-return {- checkedAt: new Date().toISOString(),+ ...services,version: readAppVersion(),- api: {- status: "ok" as const,- uptimeSeconds: Math.floor(process.uptime()),- nodeVersion: process.version,- },- database,- realtime: {- status: realtimeStatus({- adapter: realtime.adapter,- redisStatus: redis.status,- }),- ...realtime,- },- redis,- email,- storage,auth: describeAuth(),integrations,};diff --git a/apps/api/src/admin/index.ts b/apps/api/src/admin/index.tsindex e3b458d32..0b5d80c43 100644--- a/apps/api/src/admin/index.ts+++ b/apps/api/src/admin/index.ts@@ -10,6 +10,8 @@ import { adminAuditRequest } from "./audit/admin-audit-request";import addWorkspaceMember from "./controllers/add-workspace-member";import archiveWorkspace from "./controllers/archive-workspace";import deleteWorkspace from "./controllers/delete-workspace";+import getOverview from "./controllers/get-overview";+import { adminOverviewSchema } from "./overview/response";import listAuditLog from "./controllers/list-audit-log";import getSystemStatus from "./controllers/get-system-status";import listUsers from "./controllers/list-users";@@ -349,7 +351,24 @@ const sendTestEmailRoute = createRoute({},});+const getOverviewRoute = createRoute({+ method: "get",+ operationId: "getAdminOverview",+ path: "/overview",+ tags: ["Admin"],+ summary: "Get the administration overview",+ description:+ "User and workspace counts, the five newest users and administrative actions, compact service checks, and configuration warnings. Activity is based on session refreshes within 30 days and excludes deactivated accounts. Requires an instance administrator session; API keys are rejected. No credentials or audit metadata are returned.",+ middleware: [requireUserSession, requireInstanceAdmin] as const,+ responses: {+ 200: jsonResponse("Instance overview", adminOverviewSchema),+ 401: errorResponse("Authentication required"),+ 403: forbidden,+ },+});+const admin = apiRouter()+ .openapi(getOverviewRoute, async (c) => c.json(await getOverview(), 200)).openapi(listUsersRoute, async (c) =>c.json(await listUsers(c.req.valid("query")), 200),)diff --git a/apps/api/src/admin/overview/configuration-warnings.ts b/apps/api/src/admin/overview/configuration-warnings.tsnew file mode 100644index 000000000..fff397701--- /dev/null+++ b/apps/api/src/admin/overview/configuration-warnings.ts@@ -0,0 +1,30 @@+import type { z } from "../../openapi";+import type { getServiceStatus } from "../system/get-service-status";+import type { overviewWarningSchema } from "./response";++type Warning = z.infer<typeof overviewWarningSchema>;++export function configurationWarnings(+ services: Awaited<ReturnType<typeof getServiceStatus>>,+ registration: boolean,+ enabledAdmins: number,+): Warning[] {+ const warnings: Warning[] = [];+ if (!services.email.configured) warnings.push("smtp_not_configured");+ else if (services.email.status === "down") warnings.push("smtp_unreachable");+ if (services.redis.status === "down" || services.redis.status === "warning") {+ warnings.push("redis_unreachable");+ }+ if (services.storage.errorCode === "INCOMPLETE_CONFIG")+ warnings.push("storage_incomplete");+ else if (+ services.storage.status === "down" ||+ services.storage.status === "warning"+ ) {+ warnings.push("storage_unreachable");+ }+ if (registration && !services.email.configured)+ warnings.push("registration_without_email");+ if (enabledAdmins < 2) warnings.push("no_second_admin");+ return warnings;+}diff --git a/apps/api/src/admin/overview/response.ts b/apps/api/src/admin/overview/response.tsnew file mode 100644index 000000000..2321977d5--- /dev/null+++ b/apps/api/src/admin/overview/response.ts@@ -0,0 +1,64 @@+import { z } from "../../openapi";+import { adminAuditLogEntrySchema, adminUserSchema } from "../response";+import { serviceStatusSchema } from "../system/service-status";++export const overviewWarningSchema = z.enum([+ "smtp_not_configured",+ "smtp_unreachable",+ "redis_unreachable",+ "storage_incomplete",+ "storage_unreachable",+ "registration_without_email",+ "no_second_admin",+]);++export const adminOverviewSchema = z+ .object({+ users: z.object({+ total: z.number().int(),+ activeLast30Days: z.number().int().openapi({+ description:+ "Non-deactivated users with a session refreshed in the last 30 days, counted once per user. Expired bans do not deactivate an account. Revoked or removed sessions do not contribute.",+ }),+ deactivated: z.number().int(),+ }),+ workspaces: z.object({+ total: z.number().int(),+ archived: z.number().int(),+ }),+ recentUsers: z+ .array(+ adminUserSchema.pick({+ id: true,+ name: true,+ email: true,+ image: true,+ createdAt: true,+ }),+ )+ .max(5),+ recentActions: z+ .array(+ adminAuditLogEntrySchema.pick({+ id: true,+ createdAt: true,+ action: true,+ actor: true,+ targetType: true,+ targetId: true,+ targetLabel: true,+ }),+ )+ .max(5),+ services: z.object({+ checkedAt: z.string().openapi({ format: "date-time" }),+ api: serviceStatusSchema,+ database: serviceStatusSchema,+ realtime: serviceStatusSchema,+ redis: serviceStatusSchema,+ email: serviceStatusSchema,+ storage: serviceStatusSchema,+ }),+ warnings: z.array(overviewWarningSchema),+ })+ .openapi("AdminOverview");diff --git a/apps/api/src/admin/system/get-service-status.ts b/apps/api/src/admin/system/get-service-status.tsnew file mode 100644index 000000000..2393df6f3--- /dev/null+++ b/apps/api/src/admin/system/get-service-status.ts@@ -0,0 +1,37 @@+import { getLocalRealtimeStats } from "../../ws";+import { probeDatabase } from "./probe-database";+import { probeEmail } from "./probe-email";+import { probeRedis } from "./probe-redis";+import { probeStorage } from "./probe-storage";+import { realtimeStatus } from "./realtime-status";++const PROBE_TIMEOUT_MS = 3_000;++export async function getServiceStatus() {+ const [database, redis, email, storage] = await Promise.all([+ probeDatabase(PROBE_TIMEOUT_MS),+ probeRedis(PROBE_TIMEOUT_MS),+ probeEmail(PROBE_TIMEOUT_MS),+ probeStorage(PROBE_TIMEOUT_MS),+ ]);+ const realtime = getLocalRealtimeStats();+ return {+ checkedAt: new Date().toISOString(),+ api: {+ status: "ok" as const,+ uptimeSeconds: Math.floor(process.uptime()),+ nodeVersion: process.version,+ },+ database,+ realtime: {+ status: realtimeStatus({+ adapter: realtime.adapter,+ redisStatus: redis.status,+ }),+ ...realtime,+ },+ redis,+ email,+ storage,+ };+}diff --git a/apps/docs/core/operations/administration.mdx b/apps/docs/core/operations/administration.mdxindex d79307939..dca66e78e 100644--- a/apps/docs/core/operations/administration.mdx+++ b/apps/docs/core/operations/administration.mdx@@ -7,6 +7,14 @@ Instance administrators manage the whole Kaneo instance, not just the workspacesThese pages live under **Settings → Administration** and are only visible to instance administrators.+## Overview++**Settings → Administration → Overview** is the administration landing page. It shows total users, users active in the last 30 days, disabled users, and total and archived workspaces. Active users are counted once if one of their stored sessions was refreshed in the last 30 days; disabled accounts are excluded, and expired bans no longer disable an account. Session refreshes can lag by up to a day; removed or revoked sessions no longer contribute.++The page lists the five newest users and administrative actions, with links to their directories, and checks the same services as **System**. Configuration warnings point out missing email setup, unavailable configured services, incomplete storage settings, open registration without email, or fewer than two enabled instance administrators. Optional Redis and storage do not trigger warnings when switched off. Choose **Refresh** to update the counts and checks.++The same read-only overview is available at `GET /api/admin/overview` to instance administrator sessions. API keys are rejected. It returns service statuses and warning codes without credentials, session tokens, or audit metadata.+## Manage usersOpen **Settings → Administration → User management** to search every account on the instance. Filter by status (active or deactivated), role (admin or user), and email verification. Each row shows the user's role, status, when they were last active, and when they joined. **Last active** is the most recent activity of one of their current sessions, so it can lag by up to a day and is empty for someone who has never signed in or has no session left.diff --git a/apps/docs/openapi.json b/apps/docs/openapi.jsonindex f1dd13f09..2f067ece8 100644--- a/apps/docs/openapi.json+++ b/apps/docs/openapi.json@@ -5404,6 +5404,256 @@"revoked"]},+ "AdminOverview": {+ "type": "object",+ "properties": {+ "users": {+ "type": "object",+ "properties": {+ "total": {+ "type": "integer"+ },+ "activeLast30Days": {+ "type": "integer",+ "description": "Non-deactivated users with a session refreshed in the last 30 days, counted once per user. Expired bans do not deactivate an account. Revoked or removed sessions do not contribute."+ },+ "deactivated": {+ "type": "integer"+ }+ },+ "required": [+ "total",+ "activeLast30Days",+ "deactivated"+ ]+ },+ "workspaces": {+ "type": "object",+ "properties": {+ "total": {+ "type": "integer"+ },+ "archived": {+ "type": "integer"+ }+ },+ "required": [+ "total",+ "archived"+ ]+ },+ "recentUsers": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "email": {+ "type": "string"+ },+ "image": {+ "type": [+ "string",+ "null"+ ]+ },+ "createdAt": {+ "type": "string",+ "format": "date-time"+ }+ },+ "required": [+ "id",+ "name",+ "email",+ "image",+ "createdAt"+ ]+ },+ "maxItems": 5+ },+ "recentActions": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "createdAt": {+ "type": "string",+ "format": "date-time"+ },+ "action": {+ "type": "string",+ "description": "Dotted action name, for example `user.role_changed`."+ },+ "actor": {+ "type": "object",+ "properties": {+ "id": {+ "type": [+ "string",+ "null"+ ],+ "description": "Null when the administrator's account was deleted."+ },+ "name": {+ "type": [+ "string",+ "null"+ ]+ },+ "email": {+ "type": [+ "string",+ "null"+ ]+ }+ },+ "required": [+ "id",+ "name",+ "email"+ ]+ },+ "targetType": {+ "type": "string"+ },+ "targetId": {+ "type": [+ "string",+ "null"+ ]+ },+ "targetLabel": {+ "type": [+ "string",+ "null"+ ],+ "description": "The target's name or email when the action happened."+ }+ },+ "required": [+ "id",+ "createdAt",+ "action",+ "actor",+ "targetType",+ "targetId",+ "targetLabel"+ ]+ },+ "maxItems": 5+ },+ "services": {+ "type": "object",+ "properties": {+ "checkedAt": {+ "type": "string",+ "format": "date-time"+ },+ "api": {+ "type": "string",+ "enum": [+ "ok",+ "warning",+ "not_configured",+ "down"+ ],+ "description": "ok: working. warning: works with a problem, or is only partly configured. not_configured: optional and switched off, which is a healthy state. down: configured but not reachable."+ },+ "database": {+ "type": "string",+ "enum": [+ "ok",+ "warning",+ "not_configured",+ "down"+ ],+ "description": "ok: working. warning: works with a problem, or is only partly configured. not_configured: optional and switched off, which is a healthy state. down: configured but not reachable."+ },+ "realtime": {+ "type": "string",+ "enum": [+ "ok",+ "warning",+ "not_configured",+ "down"+ ],+ "description": "ok: working. warning: works with a problem, or is only partly configured. not_configured: optional and switched off, which is a healthy state. down: configured but not reachable."+ },+ "redis": {+ "type": "string",+ "enum": [+ "ok",+ "warning",+ "not_configured",+ "down"+ ],+ "description": "ok: working. warning: works with a problem, or is only partly configured. not_configured: optional and switched off, which is a healthy state. down: configured but not reachable."+ },+ "email": {+ "type": "string",+ "enum": [+ "ok",+ "warning",+ "not_configured",+ "down"+ ],+ "description": "ok: working. warning: works with a problem, or is only partly configured. not_configured: optional and switched off, which is a healthy state. down: configured but not reachable."+ },+ "storage": {+ "type": "string",+ "enum": [+ "ok",+ "warning",+ "not_configured",+ "down"+ ],+ "description": "ok: working. warning: works with a problem, or is only partly configured. not_configured: optional and switched off, which is a healthy state. down: configured but not reachable."+ }+ },+ "required": [+ "checkedAt",+ "api",+ "database",+ "realtime",+ "redis",+ "email",+ "storage"+ ]+ },+ "warnings": {+ "type": "array",+ "items": {+ "type": "string",+ "enum": [+ "smtp_not_configured",+ "smtp_unreachable",+ "redis_unreachable",+ "storage_incomplete",+ "storage_unreachable",+ "registration_without_email",+ "no_second_admin"+ ]+ }+ }+ },+ "required": [+ "users",+ "workspaces",+ "recentUsers",+ "recentActions",+ "services",+ "warnings"+ ]+ },"AdminUserList": {"type": "object","properties": {@@ -24895,6 +25145,51 @@}}},+ "/admin/overview": {+ "get": {+ "operationId": "getAdminOverview",+ "tags": [+ "Admin"+ ],+ "summary": "Get the administration overview",+ "description": "User and workspace counts, the five newest users and administrative actions, compact service checks, and configuration warnings. Activity is based on session refreshes within 30 days and excludes deactivated accounts. Requires an instance administrator session; API keys are rejected. No credentials or audit metadata are returned.",+ "responses": {+ "200": {+ "description": "Instance overview",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/AdminOverview"+ }+ }+ }+ },+ "401": {+ "description": "Authentication required",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ },+ "403": {+ "description": "The caller is not an instance administrator or is authenticated with an API key",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ApiError"+ }+ }+ }+ },+ "429": {+ "$ref": "#/components/responses/ApiKeyRateLimited"+ }+ }+ }+ },"/admin/users": {"get": {"operationId": "listAdminUsers",diff --git a/apps/web/src/components/admin/overview/admin-overview-panel.test.tsx b/apps/web/src/components/admin/overview/admin-overview-panel.test.tsxnew file mode 100644index 000000000..daaddcee8--- /dev/null+++ b/apps/web/src/components/admin/overview/admin-overview-panel.test.tsx@@ -0,0 +1,136 @@+import { cleanup, fireEvent, render, screen } from "@testing-library/react";+import { afterEach, describe, expect, it, vi } from "vite-plus/test";+import type { AdminOverview } from "@/fetchers/admin/overview-types";+import useAdminOverview from "@/hooks/queries/admin/use-admin-overview";+import AdminOverviewPanel from "./admin-overview-panel";++vi.mock("react-i18next", () => ({+ useTranslation: () => ({+ t: (key: string) => key,+ i18n: { language: "en-US" },+ }),+ initReactI18next: { type: "3rdParty", init: () => {} },+}));+vi.mock("@tanstack/react-router", () => ({+ Link: ({+ to,+ children,+ ...props+ }: {+ to: string;+ children: React.ReactNode;+ }) => (+ <a href={to} {...props}>+ {children}+ </a>+ ),+}));+vi.mock("@/hooks/queries/admin/use-admin-overview", () => ({+ default: vi.fn(),+}));++const data: AdminOverview = {+ users: { total: 12, activeLast30Days: 7, deactivated: 2 },+ workspaces: { total: 4, archived: 1 },+ recentUsers: [+ {+ id: "u1",+ name: "Alex",+ email: "[email protected]",+ image: null,+ createdAt: "2026-10-27T09:30:00Z",+ },+ ],+ recentActions: [+ {+ id: "a1",+ createdAt: "2026-10-27T09:30:00Z",+ action: "user.created",+ actor: { id: "admin", name: "Sam", email: "[email protected]" },+ targetType: "user",+ targetId: "u1",+ targetLabel: "Alex",+ },+ ],+ services: {+ checkedAt: "2026-10-27T09:30:00Z",+ api: "ok",+ database: "ok",+ realtime: "ok",+ redis: "not_configured",+ email: "down",+ storage: "warning",+ },+ warnings: ["smtp_unreachable", "no_second_admin"],+};+function mockOverview(value: Partial<ReturnType<typeof useAdminOverview>>) {+ const refetch = vi.fn();+ vi.mocked(useAdminOverview).mockReturnValue({+ data: undefined,+ isLoading: false,+ isFetching: false,+ isError: false,+ refetch,+ ...value,+ } as unknown as ReturnType<typeof useAdminOverview>);+ return refetch;+}+afterEach(cleanup);++describe("AdminOverviewPanel", () => {+ it("shows loading placeholders and disables refresh while checking", () => {+ mockOverview({ isLoading: true, isFetching: true });+ render(<AdminOverviewPanel />);+ expect(screen.getAllByTestId("settings-row-skeleton")).toHaveLength(5);+ expect(screen.getByRole("button", { name: /refreshing/ })).toBeDisabled();+ expect(screen.queryByText("settings:adminOverview.totalUsers")).toBeNull();+ });+ it("offers a retry on failure", () => {+ const refetch = mockOverview({ isError: true });+ render(<AdminOverviewPanel />);+ fireEvent.click(screen.getByRole("button", { name: /retry/ }));+ expect(refetch).toHaveBeenCalledTimes(1);+ expect(screen.getByText("settings:adminOverview.loadError")).toBeTruthy();+ });+ it("shows counts, recent data, service statuses, actionable warnings and directory links", () => {+ const refetch = mockOverview({ data });+ render(<AdminOverviewPanel />);+ expect(screen.getByText("12")).toBeTruthy();+ expect(screen.getByText("7")).toBeTruthy();+ expect(screen.getByText("[email protected]")).toBeTruthy();+ expect(screen.getByText("Sam")).toBeTruthy();+ expect(+ screen.getByText("settings:adminAuditLog.actions.userCreated"),+ ).toBeTruthy();+ expect(screen.getByText("settings:adminSystem.status.down")).toBeTruthy();+ expect(screen.getByRole("link", { name: /viewUsers/ })).toHaveAttribute(+ "href",+ "/dashboard/settings/admin/users",+ );+ expect(screen.getByRole("link", { name: /viewAuditLog/ })).toHaveAttribute(+ "href",+ "/dashboard/settings/admin/audit-log",+ );+ expect(screen.getByRole("link", { name: /viewSystem/ })).toHaveAttribute(+ "href",+ "/dashboard/settings/admin/system",+ );+ expect(screen.getByRole("link", { name: /noSecondAdmin/ })).toHaveAttribute(+ "href",+ "/dashboard/settings/admin/users",+ );+ fireEvent.click(screen.getByRole("button", { name: /refresh$/ }));+ expect(refetch).toHaveBeenCalledTimes(1);+ });+ it("shows empty lists and hides the warnings section when there are no warnings", () => {+ mockOverview({+ data: { ...data, warnings: [], recentUsers: [], recentActions: [] },+ });+ render(<AdminOverviewPanel />);+ expect(screen.getByText("settings:adminOverview.noUsers")).toBeTruthy();+ expect(screen.getByText("settings:adminOverview.noActions")).toBeTruthy();+ expect(+ screen.queryByText("settings:adminOverview.configurationWarnings"),+ ).toBeNull();+ });+});diff --git a/apps/web/src/components/admin/overview/admin-overview-panel.tsx b/apps/web/src/components/admin/overview/admin-overview-panel.tsxnew file mode 100644index 000000000..b3c4e0c85--- /dev/null+++ b/apps/web/src/components/admin/overview/admin-overview-panel.tsx@@ -0,0 +1,75 @@+import { RefreshCwIcon } from "lucide-react";+import { useTranslation } from "react-i18next";+import { DirectoryErrorRow } from "@/components/admin/directory/directory-error-row";+import { SettingsCard } from "@/components/settings/settings-card";+import { SettingsPage } from "@/components/settings/settings-page";+import { SettingsRowsSkeleton } from "@/components/settings/settings-rows-skeleton";+import { Button } from "@/components/ui/button";+import useAdminOverview from "@/hooks/queries/admin/use-admin-overview";+import { cn } from "@/lib/cn";+import { formatDateTime } from "@/lib/format";+import { OverviewServices } from "./overview-services";+import { OverviewStats } from "./overview-stats";+import { OverviewWarnings } from "./overview-warnings";+import { RecentActions } from "./recent-actions";+import { RecentUsers } from "./recent-users";++export default function AdminOverviewPanel() {+ const { t, i18n } = useTranslation();+ const { data, isLoading, isFetching, isError, refetch } = useAdminOverview();+ return (+ <SettingsPage+ title={t("settings:adminOverview.title")}+ actions={+ <div className="flex items-center gap-3">+ {data ? (+ <span className="text-xs text-muted-foreground tabular-nums">+ {t("settings:adminSystem.checkedAt", {+ time: formatDateTime(data.services.checkedAt, i18n.language),+ })}+ </span>+ ) : null}+ <Button+ type="button"+ variant="outline"+ size="sm"+ disabled={isFetching}+ onClick={() => refetch()}+ >+ <RefreshCwIcon+ aria-hidden="true"+ className={cn(isFetching && "animate-spin")}+ />+ {isFetching+ ? t("settings:adminSystem.refreshing")+ : t("settings:adminSystem.refresh")}+ </Button>+ </div>+ }+ >+ {isError ? (+ <SettingsCard>+ <DirectoryErrorRow+ message={t("settings:adminOverview.loadError")}+ retryLabel={t("settings:adminSystem.retry")}+ onRetry={() => refetch()}+ />+ </SettingsCard>+ ) : null}+ {isLoading ? (+ <SettingsCard aria-busy="true">+ <SettingsRowsSkeleton rows={5} />+ </SettingsCard>+ ) : null}+ {data ? (+ <>+ <OverviewStats data={data} />+ <OverviewWarnings warnings={data.warnings} />+ <OverviewServices services={data.services} />+ <RecentUsers users={data.recentUsers} />+ <RecentActions actions={data.recentActions} />+ </>+ ) : null}+ </SettingsPage>+ );+}diff --git a/apps/web/src/components/admin/overview/overview-services.tsx b/apps/web/src/components/admin/overview/overview-services.tsxnew file mode 100644index 000000000..8e195fd1c--- /dev/null+++ b/apps/web/src/components/admin/overview/overview-services.tsx@@ -0,0 +1,47 @@+import { Link } from "@tanstack/react-router";+import { useTranslation } from "react-i18next";+import { ServiceStatusBadge } from "@/components/admin/system/service-status-badge";+import { SettingsCard } from "@/components/settings/settings-card";+import { SettingsSection } from "@/components/settings/settings-section";+import type { AdminOverview } from "@/fetchers/admin/overview-types";++export function OverviewServices({+ services,+}: {+ services: AdminOverview["services"];+}) {+ const { t } = useTranslation();+ const rows = [+ [t("settings:adminSystem.instance.api"), services.api],+ [t("settings:adminSystem.instance.database"), services.database],+ [t("settings:adminSystem.instance.realtime"), services.realtime],+ [t("settings:adminSystem.instance.redis"), services.redis],+ [t("settings:adminSystem.email.title"), services.email],+ [t("settings:adminSystem.instance.storage"), services.storage],+ ] as const;+ return (+ <SettingsSection+ title={t("settings:adminOverview.services")}+ action={+ <Link+ to="/dashboard/settings/admin/system"+ className="text-xs text-muted-foreground hover:text-foreground"+ >+ {t("settings:adminOverview.viewSystem")}+ </Link>+ }+ >+ <SettingsCard className="grid divide-y-0 gap-px bg-border sm:grid-cols-2 lg:grid-cols-3">+ {rows.map(([label, status]) => (+ <div+ key={label}+ className="flex items-center justify-between gap-3 bg-card px-4 py-3"+ >+ <span className="text-sm">{label}</span>+ <ServiceStatusBadge status={status} />+ </div>+ ))}+ </SettingsCard>+ </SettingsSection>+ );+}diff --git a/apps/web/src/components/admin/overview/overview-stats.tsx b/apps/web/src/components/admin/overview/overview-stats.tsxnew file mode 100644index 000000000..64e80763c--- /dev/null+++ b/apps/web/src/components/admin/overview/overview-stats.tsx@@ -0,0 +1,52 @@+import { Link } from "@tanstack/react-router";+import { useTranslation } from "react-i18next";+import type { AdminOverview } from "@/fetchers/admin/overview-types";++export function OverviewStats({ data }: { data: AdminOverview }) {+ const { t, i18n } = useTranslation();+ const stats = [+ {+ label: t("settings:adminOverview.totalUsers"),+ value: data.users.total,+ to: "/dashboard/settings/admin/users",+ },+ {+ label: t("settings:adminOverview.activeUsers"),+ value: data.users.activeLast30Days,+ to: "/dashboard/settings/admin/users",+ },+ {+ label: t("settings:adminOverview.disabledUsers"),+ value: data.users.deactivated,+ to: "/dashboard/settings/admin/users",+ },+ {+ label: t("settings:adminOverview.workspaces"),+ value: data.workspaces.total,+ to: "/dashboard/settings/admin/workspaces",+ },+ {+ label: t("settings:adminOverview.archivedWorkspaces"),+ value: data.workspaces.archived,+ to: "/dashboard/settings/admin/workspaces",+ },+ ] as const;+ return (+ <div className="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5">+ {stats.map((stat) => (+ <Link+ key={stat.label}+ to={stat.to}+ className="rounded-xl border bg-card p-4 transition-colors hover:bg-accent focus-visible:outline-ring"+ >+ <span className="block text-xs text-muted-foreground">+ {stat.label}+ </span>+ <span className="mt-3 block text-2xl font-semibold tracking-tight tabular-nums">+ {stat.value.toLocaleString(i18n.language)}+ </span>+ </Link>+ ))}+ </div>+ );+}diff --git a/apps/web/src/components/admin/overview/overview-warnings.tsx b/apps/web/src/components/admin/overview/overview-warnings.tsxnew file mode 100644index 000000000..0637c4d00--- /dev/null+++ b/apps/web/src/components/admin/overview/overview-warnings.tsx@@ -0,0 +1,52 @@+import { Link } from "@tanstack/react-router";+import { TriangleAlertIcon } from "lucide-react";+import { useTranslation } from "react-i18next";+import { SettingsCard } from "@/components/settings/settings-card";+import { SettingsSection } from "@/components/settings/settings-section";+import type { AdminOverview } from "@/fetchers/admin/overview-types";++const WARNING_KEYS = {+ smtp_not_configured: "settings:adminOverview.warnings.smtpNotConfigured",+ smtp_unreachable: "settings:adminOverview.warnings.smtpUnreachable",+ redis_unreachable: "settings:adminOverview.warnings.redisUnreachable",+ storage_incomplete: "settings:adminOverview.warnings.storageIncomplete",+ storage_unreachable: "settings:adminOverview.warnings.storageUnreachable",+ registration_without_email:+ "settings:adminOverview.warnings.registrationWithoutEmail",+ no_second_admin: "settings:adminOverview.warnings.noSecondAdmin",+} as const;++export function OverviewWarnings({+ warnings,+}: {+ warnings: AdminOverview["warnings"];+}) {+ const { t } = useTranslation();+ if (!warnings.length) return null;+ return (+ <SettingsSection title={t("settings:adminOverview.configurationWarnings")}>+ <SettingsCard>+ <ul className="divide-y divide-border">+ {warnings.map((warning) => (+ <li key={warning}>+ <Link+ to={+ warning === "no_second_admin"+ ? "/dashboard/settings/admin/users"+ : "/dashboard/settings/admin/system"+ }+ className="flex items-start gap-3 px-4 py-3 text-sm hover:bg-accent"+ >+ <TriangleAlertIcon+ aria-hidden="true"+ className="mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-400"+ />+ {t(WARNING_KEYS[warning])}+ </Link>+ </li>+ ))}+ </ul>+ </SettingsCard>+ </SettingsSection>+ );+}diff --git a/apps/web/src/components/admin/overview/recent-actions.tsx b/apps/web/src/components/admin/overview/recent-actions.tsxnew file mode 100644index 000000000..a7e68286c--- /dev/null+++ b/apps/web/src/components/admin/overview/recent-actions.tsx@@ -0,0 +1,63 @@+import { Link } from "@tanstack/react-router";+import { useTranslation } from "react-i18next";+import { getAuditActionLabel } from "@/components/admin/audit-log/get-audit-action-label";+import { SettingsCard } from "@/components/settings/settings-card";+import { SettingsSection } from "@/components/settings/settings-section";+import type { AdminOverview } from "@/fetchers/admin/overview-types";+import { formatDateMedium, formatDateTime } from "@/lib/format";++export function RecentActions({+ actions,+}: {+ actions: AdminOverview["recentActions"];+}) {+ const { t } = useTranslation();+ return (+ <SettingsSection+ title={t("settings:adminOverview.recentActions")}+ action={+ <Link+ to="/dashboard/settings/admin/audit-log"+ className="text-xs text-muted-foreground hover:text-foreground"+ >+ {t("settings:adminOverview.viewAuditLog")}+ </Link>+ }+ >+ <SettingsCard>+ {actions.length ? (+ <ul className="divide-y divide-border">+ {actions.map((entry) => (+ <li key={entry.id} className="flex items-start gap-3 px-4 py-3">+ <div className="min-w-0 flex-1">+ <span className="block text-sm font-medium">+ {getAuditActionLabel(entry.action, t)}+ </span>+ <span className="block truncate text-xs text-muted-foreground">+ {entry.targetLabel ?? entry.targetId ?? "—"}+ </span>+ <span className="block truncate text-xs text-muted-foreground">+ {entry.actor.name ??+ entry.actor.email ??+ t("settings:adminAuditLog.unknownActor")}+ </span>+ </div>+ <time+ dateTime={entry.createdAt}+ title={formatDateTime(entry.createdAt)}+ className="shrink-0 text-xs text-muted-foreground tabular-nums"+ >+ {formatDateMedium(entry.createdAt)}+ </time>+ </li>+ ))}+ </ul>+ ) : (+ <p className="p-4 text-sm text-muted-foreground">+ {t("settings:adminOverview.noActions")}+ </p>+ )}+ </SettingsCard>+ </SettingsSection>+ );+}diff --git a/apps/web/src/components/admin/overview/recent-users.tsx b/apps/web/src/components/admin/overview/recent-users.tsxnew file mode 100644index 000000000..39aea0962--- /dev/null+++ b/apps/web/src/components/admin/overview/recent-users.tsx@@ -0,0 +1,59 @@+import { Link } from "@tanstack/react-router";+import { useTranslation } from "react-i18next";+import { DirectoryAvatar } from "@/components/admin/directory/directory-avatar";+import { SettingsCard } from "@/components/settings/settings-card";+import { SettingsSection } from "@/components/settings/settings-section";+import type { AdminOverview } from "@/fetchers/admin/overview-types";+import { formatDateMedium, formatDateTime } from "@/lib/format";++export function RecentUsers({+ users,+}: {+ users: AdminOverview["recentUsers"];+}) {+ const { t } = useTranslation();+ return (+ <SettingsSection+ title={t("settings:adminOverview.recentUsers")}+ action={+ <Link+ to="/dashboard/settings/admin/users"+ className="text-xs text-muted-foreground hover:text-foreground"+ >+ {t("settings:adminOverview.viewUsers")}+ </Link>+ }+ >+ <SettingsCard>+ {users.length ? (+ <ul className="divide-y divide-border">+ {users.map((user) => (+ <li key={user.id} className="flex items-center gap-3 px-4 py-3">+ <DirectoryAvatar name={user.name} image={user.image} />+ <div className="min-w-0 flex-1">+ <span className="block truncate text-sm font-medium">+ {user.name}+ </span>+ <span className="block truncate text-xs text-muted-foreground">+ {user.email}+ </span>+ </div>+ <time+ dateTime={user.createdAt}+ title={formatDateTime(user.createdAt)}+ className="shrink-0 text-xs text-muted-foreground tabular-nums"+ >+ {formatDateMedium(user.createdAt)}+ </time>+ </li>+ ))}+ </ul>+ ) : (+ <p className="p-4 text-sm text-muted-foreground">+ {t("settings:adminOverview.noUsers")}+ </p>+ )}+ </SettingsCard>+ </SettingsSection>+ );+}diff --git a/apps/web/src/components/settings/nav/build-settings-nav.test.ts b/apps/web/src/components/settings/nav/build-settings-nav.test.tsindex 68f858c75..929aadd96 100644--- a/apps/web/src/components/settings/nav/build-settings-nav.test.ts+++ b/apps/web/src/components/settings/nav/build-settings-nav.test.ts@@ -56,6 +56,7 @@ describe("buildSettingsNav", () => {expect(build({ hasAdminAccess: true }).admin?.links.map((link) => link.to),).toEqual([+ "/dashboard/settings/admin/overview","/dashboard/settings/admin/users","/dashboard/settings/admin/workspaces","/dashboard/settings/admin/audit-log",diff --git a/apps/web/src/components/settings/nav/build-settings-nav.ts b/apps/web/src/components/settings/nav/build-settings-nav.tsindex d0a11d4cd..04c4dde2d 100644--- a/apps/web/src/components/settings/nav/build-settings-nav.ts+++ b/apps/web/src/components/settings/nav/build-settings-nav.ts@@ -6,6 +6,7 @@ import {CreditCard,Import,KeyRound,+ LayoutDashboard,ScrollText,Server,Settings,@@ -155,6 +156,12 @@ export function buildSettingsNav({id: "admin",label: t("settings:administration"),links: [+ {+ id: "admin-overview",+ label: t("settings:adminOverview.title"),+ to: "/dashboard/settings/admin/overview",+ icon: LayoutDashboard,+ },{id: "admin-users",label: t("settings:adminUsers.title"),diff --git a/apps/web/src/fetchers/admin/get-admin-overview.ts b/apps/web/src/fetchers/admin/get-admin-overview.tsnew file mode 100644index 000000000..2052bdbda--- /dev/null+++ b/apps/web/src/fetchers/admin/get-admin-overview.ts@@ -0,0 +1,8 @@+import { client } from "@kaneo/libs";+import { HttpError } from "@/lib/http-error";++export async function getAdminOverview() {+ const response = await client.admin.overview.$get();+ if (!response.ok) throw await HttpError.fromResponse(response);+ return response.json();+}diff --git a/apps/web/src/fetchers/admin/overview-types.ts b/apps/web/src/fetchers/admin/overview-types.tsnew file mode 100644index 000000000..563db8039--- /dev/null+++ b/apps/web/src/fetchers/admin/overview-types.ts@@ -0,0 +1,3 @@+import type { getAdminOverview } from "./get-admin-overview";++export type AdminOverview = Awaited<ReturnType<typeof getAdminOverview>>;diff --git a/apps/web/src/hooks/queries/admin/use-admin-overview.ts b/apps/web/src/hooks/queries/admin/use-admin-overview.tsnew file mode 100644index 000000000..017e2dc1b--- /dev/null+++ b/apps/web/src/hooks/queries/admin/use-admin-overview.ts@@ -0,0 +1,15 @@+import { useQuery } from "@tanstack/react-query";+import useAuth from "@/components/providers/auth-provider/hooks/use-auth";+import { getAdminOverview } from "@/fetchers/admin/get-admin-overview";++export default function useAdminOverview() {+ const { user } = useAuth();+ return useQuery({+ queryKey: ["admin", "overview", user?.id ?? ""],+ queryFn: getAdminOverview,+ enabled: Boolean(user?.id),+ staleTime: 0,+ refetchOnWindowFocus: false,+ retry: false,+ });+}diff --git a/apps/web/src/routeTree.gen.ts b/apps/web/src/routeTree.gen.tsindex 6adba006e..78edc4fb5 100644--- a/apps/web/src/routeTree.gen.ts+++ b/apps/web/src/routeTree.gen.ts@@ -45,7 +45,9 @@ import { Route as LayoutAuthenticatedDashboardSettingsAccountInformationRouteImpimport { Route as LayoutAuthenticatedDashboardSettingsAccountNotificationsRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/notifications'import { Route as LayoutAuthenticatedDashboardSettingsAccountPreferencesRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/preferences'import { Route as LayoutAuthenticatedDashboardSettingsAccountSecurityRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/security'+import { Route as LayoutAuthenticatedDashboardSettingsAdminIndexRouteImport } from './routes/_layout/_authenticated/dashboard/settings/admin/index'import { Route as LayoutAuthenticatedDashboardSettingsAdminAuditLogRouteImport } from './routes/_layout/_authenticated/dashboard/settings/admin/audit-log'+import { Route as LayoutAuthenticatedDashboardSettingsAdminOverviewRouteImport } from './routes/_layout/_authenticated/dashboard/settings/admin/overview'import { Route as LayoutAuthenticatedDashboardSettingsAdminSystemRouteImport } from './routes/_layout/_authenticated/dashboard/settings/admin/system'import { Route as LayoutAuthenticatedDashboardSettingsAdminUsersRouteImport } from './routes/_layout/_authenticated/dashboard/settings/admin/users'import { Route as LayoutAuthenticatedDashboardSettingsAdminWorkspacesRouteImport } from './routes/_layout/_authenticated/dashboard/settings/admin/workspaces'@@ -273,12 +275,24 @@ const LayoutAuthenticatedDashboardSettingsAccountSecurityRoute =path: '/security',getParentRoute: () => LayoutAuthenticatedDashboardSettingsAccountRoute,} as any)+const LayoutAuthenticatedDashboardSettingsAdminIndexRoute =+ LayoutAuthenticatedDashboardSettingsAdminIndexRouteImport.update({+ id: '/',+ path: '/',+ getParentRoute: () => LayoutAuthenticatedDashboardSettingsAdminRoute,+ } as any)const LayoutAuthenticatedDashboardSettingsAdminAuditLogRoute =LayoutAuthenticatedDashboardSettingsAdminAuditLogRouteImport.update({id: '/audit-log',path: '/audit-log',getParentRoute: () => LayoutAuthenticatedDashboardSettingsAdminRoute,} as any)+const LayoutAuthenticatedDashboardSettingsAdminOverviewRoute =+ LayoutAuthenticatedDashboardSettingsAdminOverviewRouteImport.update({+ id: '/overview',+ path: '/overview',+ getParentRoute: () => LayoutAuthenticatedDashboardSettingsAdminRoute,+ } as any)const LayoutAuthenticatedDashboardSettingsAdminSystemRoute =LayoutAuthenticatedDashboardSettingsAdminSystemRouteImport.update({id: '/system',@@ -502,6 +516,7 @@ export interface FileRoutesByFullPath {'/dashboard/settings/account/preferences': typeof LayoutAuthenticatedDashboardSettingsAccountPreferencesRoute'/dashboard/settings/account/security': typeof LayoutAuthenticatedDashboardSettingsAccountSecurityRoute'/dashboard/settings/admin/audit-log': typeof LayoutAuthenticatedDashboardSettingsAdminAuditLogRoute+ '/dashboard/settings/admin/overview': typeof LayoutAuthenticatedDashboardSettingsAdminOverviewRoute'/dashboard/settings/admin/system': typeof LayoutAuthenticatedDashboardSettingsAdminSystemRoute'/dashboard/settings/admin/users': typeof LayoutAuthenticatedDashboardSettingsAdminUsersRoute'/dashboard/settings/admin/workspaces': typeof LayoutAuthenticatedDashboardSettingsAdminWorkspacesRoute@@ -515,6 +530,7 @@ export interface FileRoutesByFullPath {'/dashboard/workspace/$workspaceId/my-tasks': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMyTasksRoute'/dashboard/workspace/$workspaceId/projects': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectsRoute'/dashboard/workspace/$workspaceId/search': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRoute+ '/dashboard/settings/admin/': typeof LayoutAuthenticatedDashboardSettingsAdminIndexRoute'/dashboard/workspace/$workspaceId/': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRoute'/dashboard/settings/projects/$projectId/calendar': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRoute'/dashboard/settings/projects/$projectId/custom-fields': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCustomFieldsRoute@@ -551,7 +567,6 @@ export interface FileRoutesByTo {'/dashboard/settings': typeof LayoutAuthenticatedDashboardSettingsRouteWithChildren'/dashboard': typeof LayoutAuthenticatedDashboardIndexRoute'/dashboard/settings/account': typeof LayoutAuthenticatedDashboardSettingsAccountRouteWithChildren- '/dashboard/settings/admin': typeof LayoutAuthenticatedDashboardSettingsAdminRouteWithChildren'/dashboard/settings/projects': typeof LayoutAuthenticatedDashboardSettingsProjectsRouteWithChildren'/dashboard/settings/workspace': typeof LayoutAuthenticatedDashboardSettingsWorkspaceRouteWithChildren'/dashboard/workspace/create': typeof LayoutAuthenticatedDashboardWorkspaceCreateRoute@@ -562,6 +577,7 @@ export interface FileRoutesByTo {'/dashboard/settings/account/preferences': typeof LayoutAuthenticatedDashboardSettingsAccountPreferencesRoute'/dashboard/settings/account/security': typeof LayoutAuthenticatedDashboardSettingsAccountSecurityRoute'/dashboard/settings/admin/audit-log': typeof LayoutAuthenticatedDashboardSettingsAdminAuditLogRoute+ '/dashboard/settings/admin/overview': typeof LayoutAuthenticatedDashboardSettingsAdminOverviewRoute'/dashboard/settings/admin/system': typeof LayoutAuthenticatedDashboardSettingsAdminSystemRoute'/dashboard/settings/admin/users': typeof LayoutAuthenticatedDashboardSettingsAdminUsersRoute'/dashboard/settings/admin/workspaces': typeof LayoutAuthenticatedDashboardSettingsAdminWorkspacesRoute@@ -575,6 +591,7 @@ export interface FileRoutesByTo {'/dashboard/workspace/$workspaceId/my-tasks': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMyTasksRoute'/dashboard/workspace/$workspaceId/projects': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectsRoute'/dashboard/workspace/$workspaceId/search': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRoute+ '/dashboard/settings/admin': typeof LayoutAuthenticatedDashboardSettingsAdminIndexRoute'/dashboard/workspace/$workspaceId': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRoute'/dashboard/settings/projects/$projectId/calendar': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRoute'/dashboard/settings/projects/$projectId/custom-fields': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCustomFieldsRoute@@ -628,6 +645,7 @@ export interface FileRoutesById {'/_layout/_authenticated/dashboard/settings/account/preferences': typeof LayoutAuthenticatedDashboardSettingsAccountPreferencesRoute'/_layout/_authenticated/dashboard/settings/account/security': typeof LayoutAuthenticatedDashboardSettingsAccountSecurityRoute'/_layout/_authenticated/dashboard/settings/admin/audit-log': typeof LayoutAuthenticatedDashboardSettingsAdminAuditLogRoute+ '/_layout/_authenticated/dashboard/settings/admin/overview': typeof LayoutAuthenticatedDashboardSettingsAdminOverviewRoute'/_layout/_authenticated/dashboard/settings/admin/system': typeof LayoutAuthenticatedDashboardSettingsAdminSystemRoute'/_layout/_authenticated/dashboard/settings/admin/users': typeof LayoutAuthenticatedDashboardSettingsAdminUsersRoute'/_layout/_authenticated/dashboard/settings/admin/workspaces': typeof LayoutAuthenticatedDashboardSettingsAdminWorkspacesRoute@@ -641,6 +659,7 @@ export interface FileRoutesById {'/_layout/_authenticated/dashboard/workspace/$workspaceId/my-tasks': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMyTasksRoute'/_layout/_authenticated/dashboard/workspace/$workspaceId/projects': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectsRoute'/_layout/_authenticated/dashboard/workspace/$workspaceId/search': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRoute+ '/_layout/_authenticated/dashboard/settings/admin/': typeof LayoutAuthenticatedDashboardSettingsAdminIndexRoute'/_layout/_authenticated/dashboard/workspace/$workspaceId/': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRoute'/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRoute'/_layout/_authenticated/dashboard/settings/projects/$projectId/custom-fields': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCustomFieldsRoute@@ -693,6 +712,7 @@ export interface FileRouteTypes {| '/dashboard/settings/account/preferences'| '/dashboard/settings/account/security'| '/dashboard/settings/admin/audit-log'+ | '/dashboard/settings/admin/overview'| '/dashboard/settings/admin/system'| '/dashboard/settings/admin/users'| '/dashboard/settings/admin/workspaces'@@ -706,6 +726,7 @@ export interface FileRouteTypes {| '/dashboard/workspace/$workspaceId/my-tasks'| '/dashboard/workspace/$workspaceId/projects'| '/dashboard/workspace/$workspaceId/search'+ | '/dashboard/settings/admin/'| '/dashboard/workspace/$workspaceId/'| '/dashboard/settings/projects/$projectId/calendar'| '/dashboard/settings/projects/$projectId/custom-fields'@@ -742,7 +763,6 @@ export interface FileRouteTypes {| '/dashboard/settings'| '/dashboard'| '/dashboard/settings/account'- | '/dashboard/settings/admin'| '/dashboard/settings/projects'| '/dashboard/settings/workspace'| '/dashboard/workspace/create'@@ -753,6 +773,7 @@ export interface FileRouteTypes {| '/dashboard/settings/account/preferences'| '/dashboard/settings/account/security'| '/dashboard/settings/admin/audit-log'+ | '/dashboard/settings/admin/overview'| '/dashboard/settings/admin/system'| '/dashboard/settings/admin/users'| '/dashboard/settings/admin/workspaces'@@ -766,6 +787,7 @@ export interface FileRouteTypes {| '/dashboard/workspace/$workspaceId/my-tasks'| '/dashboard/workspace/$workspaceId/projects'| '/dashboard/workspace/$workspaceId/search'+ | '/dashboard/settings/admin'| '/dashboard/workspace/$workspaceId'| '/dashboard/settings/projects/$projectId/calendar'| '/dashboard/settings/projects/$projectId/custom-fields'@@ -818,6 +840,7 @@ export interface FileRouteTypes {| '/_layout/_authenticated/dashboard/settings/account/preferences'| '/_layout/_authenticated/dashboard/settings/account/security'| '/_layout/_authenticated/dashboard/settings/admin/audit-log'+ | '/_layout/_authenticated/dashboard/settings/admin/overview'| '/_layout/_authenticated/dashboard/settings/admin/system'| '/_layout/_authenticated/dashboard/settings/admin/users'| '/_layout/_authenticated/dashboard/settings/admin/workspaces'@@ -831,6 +854,7 @@ export interface FileRouteTypes {| '/_layout/_authenticated/dashboard/workspace/$workspaceId/my-tasks'| '/_layout/_authenticated/dashboard/workspace/$workspaceId/projects'| '/_layout/_authenticated/dashboard/workspace/$workspaceId/search'+ | '/_layout/_authenticated/dashboard/settings/admin/'| '/_layout/_authenticated/dashboard/workspace/$workspaceId/'| '/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar'| '/_layout/_authenticated/dashboard/settings/projects/$projectId/custom-fields'@@ -1111,6 +1135,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountSecurityRouteImportparentRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRoute}+ '/_layout/_authenticated/dashboard/settings/admin/': {+ id: '/_layout/_authenticated/dashboard/settings/admin/'+ path: '/'+ fullPath: '/dashboard/settings/admin/'+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAdminIndexRouteImport+ parentRoute: typeof LayoutAuthenticatedDashboardSettingsAdminRoute+ }'/_layout/_authenticated/dashboard/settings/admin/audit-log': {id: '/_layout/_authenticated/dashboard/settings/admin/audit-log'path: '/audit-log'@@ -1118,6 +1149,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAdminAuditLogRouteImportparentRoute: typeof LayoutAuthenticatedDashboardSettingsAdminRoute}+ '/_layout/_authenticated/dashboard/settings/admin/overview': {+ id: '/_layout/_authenticated/dashboard/settings/admin/overview'+ path: '/overview'+ fullPath: '/dashboard/settings/admin/overview'+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAdminOverviewRouteImport+ parentRoute: typeof LayoutAuthenticatedDashboardSettingsAdminRoute+ }'/_layout/_authenticated/dashboard/settings/admin/system': {id: '/_layout/_authenticated/dashboard/settings/admin/system'path: '/system'@@ -1332,21 +1370,27 @@ const LayoutAuthenticatedDashboardSettingsAccountRouteWithChildren =interface LayoutAuthenticatedDashboardSettingsAdminRouteChildren {LayoutAuthenticatedDashboardSettingsAdminAuditLogRoute: typeof LayoutAuthenticatedDashboardSettingsAdminAuditLogRoute+ LayoutAuthenticatedDashboardSettingsAdminOverviewRoute: typeof LayoutAuthenticatedDashboardSettingsAdminOverviewRouteLayoutAuthenticatedDashboardSettingsAdminSystemRoute: typeof LayoutAuthenticatedDashboardSettingsAdminSystemRouteLayoutAuthenticatedDashboardSettingsAdminUsersRoute: typeof LayoutAuthenticatedDashboardSettingsAdminUsersRouteLayoutAuthenticatedDashboardSettingsAdminWorkspacesRoute: typeof LayoutAuthenticatedDashboardSettingsAdminWorkspacesRoute+ LayoutAuthenticatedDashboardSettingsAdminIndexRoute: typeof LayoutAuthenticatedDashboardSettingsAdminIndexRoute}const LayoutAuthenticatedDashboardSettingsAdminRouteChildren: LayoutAuthenticatedDashboardSettingsAdminRouteChildren ={LayoutAuthenticatedDashboardSettingsAdminAuditLogRoute:LayoutAuthenticatedDashboardSettingsAdminAuditLogRoute,+ LayoutAuthenticatedDashboardSettingsAdminOverviewRoute:+ LayoutAuthenticatedDashboardSettingsAdminOverviewRoute,LayoutAuthenticatedDashboardSettingsAdminSystemRoute:LayoutAuthenticatedDashboardSettingsAdminSystemRoute,LayoutAuthenticatedDashboardSettingsAdminUsersRoute:LayoutAuthenticatedDashboardSettingsAdminUsersRoute,LayoutAuthenticatedDashboardSettingsAdminWorkspacesRoute:LayoutAuthenticatedDashboardSettingsAdminWorkspacesRoute,+ LayoutAuthenticatedDashboardSettingsAdminIndexRoute:+ LayoutAuthenticatedDashboardSettingsAdminIndexRoute,}const LayoutAuthenticatedDashboardSettingsAdminRouteWithChildren =diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/admin/index.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/admin/index.tsxnew file mode 100644index 000000000..052eb09f3--- /dev/null+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/admin/index.tsx@@ -0,0 +1,9 @@+import { createFileRoute, redirect } from "@tanstack/react-router";++export const Route = createFileRoute(+ "/_layout/_authenticated/dashboard/settings/admin/",+)({+ beforeLoad: () => {+ throw redirect({ to: "/dashboard/settings/admin/overview", replace: true });+ },+});diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/admin/overview.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/admin/overview.tsxnew file mode 100644index 000000000..44b421ac1--- /dev/null+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/admin/overview.tsx@@ -0,0 +1,18 @@+import { createFileRoute } from "@tanstack/react-router";+import { useTranslation } from "react-i18next";+import AdminOverviewPanel from "@/components/admin/overview/admin-overview-panel";+import PageTitle from "@/components/page-title";++export const Route = createFileRoute(+ "/_layout/_authenticated/dashboard/settings/admin/overview",+)({ component: RouteComponent });++function RouteComponent() {+ const { t } = useTranslation();+ return (+ <>+ <PageTitle title={t("settings:adminOverview.title")} />+ <AdminOverviewPanel />+ </>+ );+}diff --git a/i18n/az-AZ.json b/i18n/az-AZ.jsonindex 79b912abc..6e0491bc1 100644--- a/i18n/az-AZ.json+++ b/i18n/az-AZ.json@@ -2677,6 +2677,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/de-DE.json b/i18n/de-DE.jsonindex 292875cd7..195490cf5 100644--- a/i18n/de-DE.json+++ b/i18n/de-DE.json@@ -2677,6 +2677,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/el-GR.json b/i18n/el-GR.jsonindex c2940b1f8..d3bc9aecc 100644--- a/i18n/el-GR.json+++ b/i18n/el-GR.json@@ -2677,6 +2677,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/en-US.json b/i18n/en-US.jsonindex b18fb8912..3232576a1 100644--- a/i18n/en-US.json+++ b/i18n/en-US.json@@ -2677,6 +2677,33 @@"testEmailSent": "Test email sent to {{to}}","testEmailError": "The test email could not be sent."}+ },+ "adminOverview": {+ "title": "Overview",+ "totalUsers": "Total users",+ "activeUsers": "Active (30 days)",+ "disabledUsers": "Disabled users",+ "workspaces": "Workspaces",+ "archivedWorkspaces": "Archived",+ "recentUsers": "Recent users",+ "recentActions": "Recent administrative actions",+ "services": "Services",+ "configurationWarnings": "Configuration warnings",+ "viewUsers": "View users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "noUsers": "No users",+ "noActions": "No administrative actions",+ "loadError": "Could not load the overview.",+ "warnings": {+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management."+ }}},"navigation": {diff --git a/i18n/es-ES.json b/i18n/es-ES.jsonindex 9bc124bf9..b268d4d73 100644--- a/i18n/es-ES.json+++ b/i18n/es-ES.json@@ -2723,6 +2723,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/fr-FR.json b/i18n/fr-FR.jsonindex 52b07f6c1..25fbd0b66 100644--- a/i18n/fr-FR.json+++ b/i18n/fr-FR.json@@ -2723,6 +2723,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/hi-IN.json b/i18n/hi-IN.jsonindex e4c6637ca..accbd53b4 100644--- a/i18n/hi-IN.json+++ b/i18n/hi-IN.json@@ -2677,6 +2677,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/id-ID.json b/i18n/id-ID.jsonindex de770fd25..8fc08e044 100644--- a/i18n/id-ID.json+++ b/i18n/id-ID.json@@ -2631,6 +2631,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/it-IT.json b/i18n/it-IT.jsonindex e15ddab81..f6fb7bf8b 100644--- a/i18n/it-IT.json+++ b/i18n/it-IT.json@@ -2723,6 +2723,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/ja-JP.json b/i18n/ja-JP.jsonindex e9b7bfc4f..11bfa027a 100644--- a/i18n/ja-JP.json+++ b/i18n/ja-JP.json@@ -2631,6 +2631,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/ko-KR.json b/i18n/ko-KR.jsonindex c4e586539..e0b1b3eae 100644--- a/i18n/ko-KR.json+++ b/i18n/ko-KR.json@@ -2631,6 +2631,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/mk-MK.json b/i18n/mk-MK.jsonindex eb36e27ff..0f5bc9fdb 100644--- a/i18n/mk-MK.json+++ b/i18n/mk-MK.json@@ -2677,6 +2677,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/nl-NL.json b/i18n/nl-NL.jsonindex d07a998cf..76f055e25 100644--- a/i18n/nl-NL.json+++ b/i18n/nl-NL.json@@ -2677,6 +2677,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/pl-PL.json b/i18n/pl-PL.jsonindex 34411f7af..a91986987 100644--- a/i18n/pl-PL.json+++ b/i18n/pl-PL.json@@ -3460,6 +3460,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"tasks": {diff --git a/i18n/pt-BR.json b/i18n/pt-BR.jsonindex a0afa2858..4a94d996d 100644--- a/i18n/pt-BR.json+++ b/i18n/pt-BR.json@@ -2723,6 +2723,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/ru-RU.json b/i18n/ru-RU.jsonindex e0d1dbbe1..25970fa7f 100644--- a/i18n/ru-RU.json+++ b/i18n/ru-RU.json@@ -2777,6 +2777,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/tr-TR.json b/i18n/tr-TR.jsonindex f45518310..c6f2f197e 100644--- a/i18n/tr-TR.json+++ b/i18n/tr-TR.json@@ -2677,6 +2677,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/uk-UA.json b/i18n/uk-UA.jsonindex c70d5ecae..f7748659c 100644--- a/i18n/uk-UA.json+++ b/i18n/uk-UA.json@@ -2769,6 +2769,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/vi-VN.json b/i18n/vi-VN.jsonindex 948ea7b17..80560fa03 100644--- a/i18n/vi-VN.json+++ b/i18n/vi-VN.json@@ -2631,6 +2631,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/zh-CN.json b/i18n/zh-CN.jsonindex 313bdc520..f3b1cee90 100644--- a/i18n/zh-CN.json+++ b/i18n/zh-CN.json@@ -2631,6 +2631,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/i18n/zh-TW.json b/i18n/zh-TW.jsonindex 93d872ff9..eba17394c 100644--- a/i18n/zh-TW.json+++ b/i18n/zh-TW.json@@ -2631,6 +2631,33 @@"testEmailError": "The test email could not be sent.","testEmailSent": "Test email sent to {{to}}"}+ },+ "adminOverview": {+ "activeUsers": "Active (30 days)",+ "archivedWorkspaces": "Archived",+ "configurationWarnings": "Configuration warnings",+ "disabledUsers": "Disabled users",+ "loadError": "Could not load the overview.",+ "noActions": "No administrative actions",+ "noUsers": "No users",+ "recentActions": "Recent administrative actions",+ "recentUsers": "Recent users",+ "services": "Services",+ "title": "Overview",+ "totalUsers": "Total users",+ "viewAuditLog": "View audit log",+ "viewSystem": "View system",+ "viewUsers": "View users",+ "warnings": {+ "noSecondAdmin": "Only one administrator has access. Assign a second admin in User management.",+ "redisUnreachable": "Redis is unavailable. Check the connection.",+ "registrationWithoutEmail": "Registration is open without email. Configure SMTP or set DISABLE_REGISTRATION=true.",+ "smtpNotConfigured": "Email is not configured. Set SMTP_HOST and SMTP_FROM.",+ "smtpUnreachable": "Email is unavailable. Check SMTP settings.",+ "storageIncomplete": "Storage setup is incomplete. Check S3 settings.",+ "storageUnreachable": "Storage needs attention. Check S3 access."+ },+ "workspaces": "Workspaces"}},"navigation": {diff --git a/tests/api-integration/admin-overview.test.ts b/tests/api-integration/admin-overview.test.tsnew file mode 100644index 000000000..471b62aca--- /dev/null+++ b/tests/api-integration/admin-overview.test.ts@@ -0,0 +1,274 @@+import { createHash, randomUUID } from "node:crypto";+import {+ afterEach,+ beforeEach,+ describe,+ expect,+ it,+ vi,+} from "vite-plus/test";+import { eq } from "drizzle-orm";+import db, { schema } from "../../apps/api/src/database";+import type { z } from "../../apps/api/src/openapi";+import type { adminOverviewSchema } from "../../apps/api/src/admin/overview/response";+import { mockAnonymousSession, mockAuthenticatedSession } from "./helpers/auth";+import { createInstanceAdmin } from "./helpers/admin/create-instance-admin";+import { resetTestDatabase } from "./helpers/database";+import { projectAccessApi } from "./helpers/project-access/project-access-api";++type Overview = z.infer<typeof adminOverviewSchema>;+const smtp = vi.hoisted(() => ({+ verify: vi.fn(async () => ({ status: "not_configured" })),+}));+const redis = vi.hoisted(() => ({ ping: vi.fn(async () => "PONG") }));+vi.mock("@kaneo/email", async (importOriginal) => ({+ ...(await importOriginal<Record<string, unknown>>()),+ verifySmtpConnection: smtp.verify,+}));+vi.mock("../../apps/api/src/redis", async (importOriginal) => ({+ ...(await importOriginal<Record<string, unknown>>()),+ getRedisPub: () => ({ ping: redis.ping }),+}));++beforeEach(async () => {+ await resetTestDatabase();+ smtp.verify.mockReset().mockResolvedValue({ status: "not_configured" });+ redis.ping.mockReset().mockResolvedValue("PONG");+ for (const name of [+ "REDIS_URL",+ "REDIS_HOST",+ "REDIS_SENTINELS",+ "REDIS_CLUSTER_NODES",+ "S3_ENDPOINT",+ "S3_BUCKET",+ "S3_ACCESS_KEY_ID",+ "S3_SECRET_ACCESS_KEY",+ ])+ vi.stubEnv(name, "");+});+afterEach(() => vi.unstubAllEnvs());++async function overview() {+ const response = await projectAccessApi()("/admin/overview");+ expect(response.status).toBe(200);+ expect(response.headers.get("cache-control")).toBe("no-store");+ return (await response.json()) as Overview;+}++async function addUser(+ id: string,+ overrides: Partial<typeof schema.userTable.$inferInsert> = {},+) {+ const [user] = await db+ .insert(schema.userTable)+ .values({+ id,+ name: id,+ email: `${id}@example.com`,+ ...overrides,+ })+ .returning();+ return user;+}++async function addSession(userId: string, daysAgo: number) {+ await db.insert(schema.sessionTable).values({+ id: randomUUID(),+ token: `private-session-${randomUUID()}`,+ userId,+ updatedAt: new Date(Date.now() - daysAgo * 86_400_000),+ expiresAt: new Date(Date.now() + 86_400_000),+ });+}++describe("admin overview", () => {+ it("requires an administrator session and rejects administrator API keys", async () => {+ mockAnonymousSession();+ expect((await projectAccessApi()("/admin/overview")).status).toBe(401);+ const user = await addUser("member");+ mockAuthenticatedSession(user);+ expect((await projectAccessApi()("/admin/overview")).status).toBe(403);+ const admin = await createInstanceAdmin();+ const key = `test_${randomUUID()}`;+ await db.insert(schema.apikeyTable).values({+ referenceId: admin.id,+ userId: admin.id,+ key: createHash("sha256").update(key).digest("base64url"),+ enabled: true,+ createdAt: new Date(),+ updatedAt: new Date(),+ });+ mockAnonymousSession();+ expect(+ (await projectAccessApi({ "x-api-key": key })("/admin/overview")).status,+ ).toBe(403);+ expect(smtp.verify).not.toHaveBeenCalled();+ });++ it("counts recently active users once, excludes current bans, and includes expired bans", async () => {+ const admin = await createInstanceAdmin();+ mockAuthenticatedSession(admin);+ await addUser("active");+ await addUser("old");+ await addUser("never");+ await addUser("expired", {+ banned: true,+ banExpires: new Date(Date.now() - 86_400_000),+ });+ await addUser("indefinite", { banned: true });+ await addUser("future", {+ banned: true,+ banExpires: new Date(Date.now() + 86_400_000),+ });+ await addUser("null-ban", { banned: null });+ await addSession("active", 1);+ await addSession("active", 2);+ await addSession("old", 31);+ await addSession("expired", 29);+ await addSession("indefinite", 0);+ await addSession("future", 0);+ await addSession("null-ban", 0);+ await db.insert(schema.workspaceTable).values([+ { id: "active", name: "Active", slug: "active", createdAt: new Date() },+ {+ id: "archived",+ name: "Archived",+ slug: "archived",+ createdAt: new Date(),+ archivedAt: new Date(),+ },+ ]);++ const body = await overview();+ expect(body.users).toEqual({+ total: 8,+ activeLast30Days: 3,+ deactivated: 2,+ });+ expect(body.workspaces).toEqual({ total: 2, archived: 1 });+ expect(body.services).toMatchObject({+ api: "ok",+ database: "ok",+ redis: "not_configured",+ email: "not_configured",+ storage: "not_configured",+ });+ expect(body.warnings).toEqual([+ "smtp_not_configured",+ "registration_without_email",+ "no_second_admin",+ ]);+ });++ it("limits recent lists to five with stable newest-first ordering and only summary fields", async () => {+ const admin = await createInstanceAdmin();+ mockAuthenticatedSession(admin);+ await db+ .update(schema.userTable)+ .set({ createdAt: new Date("2020-01-01") })+ .where(eq(schema.userTable.id, admin.id));+ for (let i = 0; i < 7; i++) {+ await addUser(`recent-${i}`, {+ createdAt: new Date("2026-01-01"),+ banReason: "private-ban-reason",+ });+ await db.insert(schema.adminAuditLogTable).values({+ id: `audit-${i}`,+ action: "user.updated",+ actorUserId: admin.id,+ actorName: admin.name,+ actorEmail: admin.email,+ targetType: "user",+ targetId: `recent-${i}`,+ targetLabel: `recent-${i}@example.com`,+ createdAt: new Date("2026-01-01"),+ metadata: { internal: "private-audit-metadata" },+ ipAddress: "192.0.2.1",+ userAgent: "private-user-agent",+ });+ }+ await addSession(admin.id, 0);+ const body = await overview();+ expect(body.recentUsers.map((u) => u.id)).toEqual(+ [6, 5, 4, 3, 2].map((i) => `recent-${i}`),+ );+ expect(body.recentActions.map((a) => a.id)).toEqual(+ [6, 5, 4, 3, 2].map((i) => `audit-${i}`),+ );+ expect(Object.keys(body.recentUsers[0]).sort()).toEqual([+ "createdAt",+ "email",+ "id",+ "image",+ "name",+ ]);+ expect(Object.keys(body.recentActions[0]).sort()).toEqual([+ "action",+ "actor",+ "createdAt",+ "id",+ "targetId",+ "targetLabel",+ "targetType",+ ]);+ const text = JSON.stringify(body);+ for (const secret of [+ "private-session-",+ "private-ban-reason",+ "private-audit-metadata",+ "private-user-agent",+ "192.0.2.1",+ ])+ expect(text).not.toContain(secret);+ });++ it("derives warnings from real service configuration without returning secrets", async () => {+ const admin = await createInstanceAdmin();+ mockAuthenticatedSession(admin);+ vi.stubEnv(+ "REDIS_URL",+ "redis://:[email protected]:6379",+ );+ redis.ping.mockRejectedValue(+ Object.assign(new Error("private-redis-password"), {+ code: "ECONNREFUSED",+ }),+ );+ vi.stubEnv("S3_SECRET_ACCESS_KEY", "private-s3-secret");+ vi.stubEnv("GOOGLE_CLIENT_SECRET", "private-google-secret");+ const body = await overview();+ expect(body.services).toMatchObject({ redis: "down", storage: "warning" });+ expect(body.warnings).toContain("redis_unreachable");+ expect(body.warnings).toContain("storage_incomplete");+ for (const secret of [+ "private-redis-password",+ "redis.internal.test",+ "private-s3-secret",+ "private-google-secret",+ ])+ expect(JSON.stringify(body)).not.toContain(secret);+ });++ it("does not warn about closed registration, optional services, or a second enabled admin", async () => {+ const admin = await createInstanceAdmin();+ mockAuthenticatedSession(admin);+ await addUser("expired-admin", {+ role: "user,admin",+ banned: true,+ banExpires: new Date(Date.now() - 86_400_000),+ });+ vi.stubEnv("DISABLE_REGISTRATION", "true");+ smtp.verify.mockResolvedValue({ status: "ok" });+ const body = await overview();+ expect(body.warnings).toEqual([]);+ expect(body.recentActions).toEqual([]);+ expect(body.workspaces).toEqual({ total: 0, archived: 0 });+ });++ it("does not count deactivated admins as a second administrator", async () => {+ const admin = await createInstanceAdmin();+ mockAuthenticatedSession(admin);+ await addUser("disabled-admin", { role: "admin", banned: true });+ expect((await overview()).warnings).toContain("no_second_admin");+ });+});