fix: restore complete admin feature dependencies
This commit is contained in:
1 parent
5b4228261a
commit
0cd753c735
115 files changed
+18565
-4930
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { ExternalLink, Server } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import { EmulatorSettingsForm } from '@/app/[locale]/admin/settings/emulator/emulator-settings-form'
|
||||
import { EmulatorSettingsForm } from '@/components/admin/emulator-settings-form'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import type { Prisma } from '@/generated/prisma/client'
|
||||
import { calcPagination } from '@/lib/admin-helpers'
|
||||
@@ -31,32 +31,32 @@ export default async function EmulatorTranslationsPage({
|
||||
const perPage = Math.min(Math.max(parseInt(sp.perPage || '50', 10), 10), 200)
|
||||
const page = Math.max(parseInt(sp.page || '1', 10), 1)
|
||||
|
||||
const patternFilters: Prisma.EmulatorSettingWhereInput[] = TRANSLATION_KEY_PATTERNS.map((p) => ({
|
||||
const patternFilters: Prisma.EmulatorSettingsWhereInput[] = TRANSLATION_KEY_PATTERNS.map((p) => ({
|
||||
key: { contains: p.replace(/%/g, '') },
|
||||
}))
|
||||
|
||||
const baseFilter: Prisma.EmulatorSettingWhereInput = { OR: patternFilters }
|
||||
const baseFilter: Prisma.EmulatorSettingsWhereInput = { OR: patternFilters }
|
||||
|
||||
const conditions: Prisma.EmulatorSettingWhereInput[] = [baseFilter]
|
||||
const conditions: Prisma.EmulatorSettingsWhereInput[] = [baseFilter]
|
||||
if (group) conditions.push({ key: { startsWith: `${group}.` } })
|
||||
if (search) {
|
||||
conditions.push({
|
||||
OR: [{ key: { contains: search } }, { value: { contains: search } }],
|
||||
})
|
||||
}
|
||||
const where: Prisma.EmulatorSettingWhereInput = { AND: conditions }
|
||||
const where: Prisma.EmulatorSettingsWhereInput = { AND: conditions }
|
||||
|
||||
const [settings, total, allKeys] = await Promise.all([
|
||||
prisma.emulatorSetting.findMany({
|
||||
prisma.emulatorSettings.findMany({
|
||||
where,
|
||||
orderBy: { key: 'asc' },
|
||||
skip: (page - 1) * perPage,
|
||||
take: perPage,
|
||||
}),
|
||||
prisma.emulatorSetting.count({ where }),
|
||||
prisma.emulatorSettings.count({ where }),
|
||||
// Group chips reflect the WHOLE translation-pattern subset (so they don't
|
||||
// disappear when you click one); we ignore the group/search filters here.
|
||||
prisma.emulatorSetting.findMany({
|
||||
prisma.emulatorSettings.findMany({
|
||||
where: baseFilter,
|
||||
select: { key: true },
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user