feat: improve admin panel (#14180)

This commit is contained in:
DarkSky
2025-12-30 05:22:54 +08:00
committed by GitHub
parent d6b380aee5
commit 95a5e941e7
94 changed files with 3146 additions and 1114 deletions

View File

@@ -113,13 +113,6 @@ export async function createRandomUser(): Promise<{
password: '123456',
};
const result = await runPrisma(async client => {
const featureId = await client.feature
.findFirst({
where: { name: 'free_plan_v1' },
select: { id: true },
})
.then(f => f!.id);
await client.user.create({
data: {
...user,
@@ -129,7 +122,6 @@ export async function createRandomUser(): Promise<{
create: {
reason: 'created by test case',
activated: true,
featureId,
name: 'free_plan_v1',
type: 1,
},
@@ -189,19 +181,6 @@ export async function createRandomAIUser(): Promise<{
password: '123456',
};
const result = await runPrisma(async client => {
const freeFeatureId = await client.feature
.findFirst({
where: { name: 'free_plan_v1' },
select: { id: true },
})
.then(f => f!.id);
const aiFeatureId = await client.feature
.findFirst({
where: { name: 'unlimited_copilot' },
select: { id: true },
})
.then(f => f!.id);
await client.user.create({
data: {
...user,
@@ -212,14 +191,12 @@ export async function createRandomAIUser(): Promise<{
{
reason: 'created by test case',
activated: true,
featureId: freeFeatureId,
name: 'free_plan_v1',
type: 1,
},
{
reason: 'created by test case',
activated: true,
featureId: aiFeatureId,
name: 'unlimited_copilot',
type: 0,
},