style: clean up code with prettier and eslint
This commit is contained in:
1 parent
60278b9e71
commit
fb8e77bb68
378 files changed
+22407
-20689
No files matched your search
@@ -1,34 +1,34 @@
|
||||
import Link from 'next/link'
|
||||
import { redirect } from 'next/navigation'
|
||||
import { detectMultiAccounts, type MultiAccountCluster } from '@/actions/multi-account-detect'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
import { canAccess, getAdminContext, PERMS } from '@/lib/permissions'
|
||||
import Link from "next/link";
|
||||
import { redirect } from "next/navigation";
|
||||
import { detectMultiAccounts, type MultiAccountCluster } from "@/actions/multi-account-detect";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
|
||||
|
||||
export default async function MultiAccountsPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<Record<string, string>>
|
||||
searchParams: Promise<Record<string, string>>;
|
||||
}) {
|
||||
const { session, permissions } = await getAdminContext()
|
||||
if (!canAccess(permissions, PERMS.USERS_VIEW, session.user.rank)) redirect('/admin')
|
||||
const { session, permissions } = await getAdminContext();
|
||||
if (!canAccess(permissions, PERMS.USERS_VIEW, session.user.rank)) redirect("/admin");
|
||||
|
||||
const params = await searchParams
|
||||
const minAccounts = Math.max(2, Number(params.min) || 2)
|
||||
const limit = Math.min(200, Number(params.limit) || 50)
|
||||
const params = await searchParams;
|
||||
const minAccounts = Math.max(2, Number(params.min) || 2);
|
||||
const limit = Math.min(200, Number(params.limit) || 50);
|
||||
|
||||
const result = await detectMultiAccounts({ minAccounts, limit })
|
||||
const result = await detectMultiAccounts({ minAccounts, limit });
|
||||
const clusters: MultiAccountCluster[] = result.ok
|
||||
? ((result.data as { clusters: MultiAccountCluster[] }).clusters ?? [])
|
||||
: []
|
||||
: [];
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold tracking-tight">Multi-account detector</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Clusters of users sharing a registration IP, current IP, or machine ID. Detection is
|
||||
passive — no AI, just a GROUP BY with index support.
|
||||
Clusters of users sharing a registration IP, current IP, or machine ID. Detection is passive — no
|
||||
AI, just a GROUP BY with index support.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -55,10 +55,7 @@ export default async function MultiAccountsPage({
|
||||
className="mt-1 h-9 w-24 rounded-md border bg-background px-2"
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
type="submit"
|
||||
className="h-9 rounded-md bg-primary px-4 text-sm text-primary-foreground"
|
||||
>
|
||||
<button type="submit" className="h-9 rounded-md bg-primary px-4 text-sm text-primary-foreground">
|
||||
Refresh
|
||||
</button>
|
||||
</form>
|
||||
@@ -92,7 +89,7 @@ export default async function MultiAccountsPage({
|
||||
<span className="font-medium">{acc.username}</span>
|
||||
<span className="text-xs text-muted-foreground">#{acc.id}</span>
|
||||
{acc.rank >= 5 && <Badge variant="outline">staff</Badge>}
|
||||
{acc.online === '1' && (
|
||||
{acc.online === "1" && (
|
||||
<span className="h-1.5 w-1.5 rounded-full bg-[var(--admin-success-subtle)]" />
|
||||
)}
|
||||
</Link>
|
||||
@@ -109,5 +106,5 @@ export default async function MultiAccountsPage({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user