1
This commit is contained in:
+54
-81
@@ -354,26 +354,19 @@ async def _seed_data():
|
|||||||
# Seed menu configs
|
# Seed menu configs
|
||||||
from app.models.menu_config import MenuConfig
|
from app.models.menu_config import MenuConfig
|
||||||
|
|
||||||
frontend_groups = [
|
menu_count = await db.execute(select(func.count(MenuConfig.id)))
|
||||||
("AI项目行业生成", "HomeOutlined", 0),
|
menu_count_result = menu_count.scalar_one()
|
||||||
("AI对话生成", "HomeOutlined", 1),
|
|
||||||
("AI视频创作", "HomeOutlined", 2),
|
if menu_count_result == 0:
|
||||||
("资产管理", "HomeOutlined", 3),
|
frontend_groups = [
|
||||||
("媒体关联", "HomeOutlined", 4),
|
("AI项目行业生成", "HomeOutlined", 0),
|
||||||
]
|
("AI对话生成", "HomeOutlined", 1),
|
||||||
frontend_group_ids: dict[str, str] = {}
|
("AI视频创作", "HomeOutlined", 2),
|
||||||
for label, icon, order in frontend_groups:
|
("资产管理", "HomeOutlined", 3),
|
||||||
existing = await db.execute(
|
("媒体关联", "HomeOutlined", 4),
|
||||||
select(MenuConfig).where(
|
]
|
||||||
MenuConfig.label == label,
|
frontend_group_ids: dict[str, str] = {}
|
||||||
MenuConfig.menu_type == "group",
|
for label, icon, order in frontend_groups:
|
||||||
MenuConfig.menu_target == "frontend",
|
|
||||||
).limit(1)
|
|
||||||
)
|
|
||||||
group = existing.scalar_one_or_none()
|
|
||||||
if group:
|
|
||||||
frontend_group_ids[label] = group.id
|
|
||||||
else:
|
|
||||||
gid = generate_id()
|
gid = generate_id()
|
||||||
frontend_group_ids[label] = gid
|
frontend_group_ids[label] = gid
|
||||||
db.add(
|
db.add(
|
||||||
@@ -391,21 +384,19 @@ async def _seed_data():
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
frontend_pages = [
|
frontend_pages = [
|
||||||
("/projects", "我的项目", "HomeOutlined", 0, "AI项目行业生成", True),
|
("/projects", "我的项目", "HomeOutlined", 0, "AI项目行业生成", True),
|
||||||
("/conversation", "AI创作", "StarOutlined", 0, "AI对话生成", True),
|
("/conversation", "AI创作", "StarOutlined", 0, "AI对话生成", True),
|
||||||
("/initial", "爆款开头复刻", "CodeOutlined", 0, "AI视频创作", False),
|
("/initial", "爆款开头复刻", "CodeOutlined", 0, "AI视频创作", False),
|
||||||
("/removelens", "拆镜复刻", "CameraOutlined", 1, "AI视频创作", False),
|
("/removelens", "拆镜复刻", "CameraOutlined", 1, "AI视频创作", False),
|
||||||
("/records", "项目记录", "PlayCircleOutlined", 0, "资产管理", True),
|
("/records", "项目记录", "PlayCircleOutlined", 0, "资产管理", True),
|
||||||
("/generated", "素材云", "CloudOutlined", 1, "资产管理", True),
|
("/generated", "素材云", "CloudOutlined", 1, "资产管理", True),
|
||||||
("/authorization", "授权管理", "UserOutlined", 0, "媒体关联", False),
|
("/authorization", "授权管理", "UserOutlined", 0, "媒体关联", False),
|
||||||
("/consume", "消耗列表", "FileTextOutlined", 1, "媒体关联", False),
|
("/consume", "消耗列表", "FileTextOutlined", 1, "媒体关联", False),
|
||||||
]
|
("/popular", "爆款榜单", "ThunderboltOutlined", 0, "AI项目行业生成", False),
|
||||||
for path, label, icon, order, group_label, is_default in frontend_pages:
|
("/creativeplaza", "创意广场", "GiftOutlined", 0, "AI对话生成", False),
|
||||||
existing = await db.execute(
|
]
|
||||||
select(MenuConfig).where(MenuConfig.path == path).limit(1)
|
for path, label, icon, order, group_label, is_default in frontend_pages:
|
||||||
)
|
|
||||||
if not existing.scalar_one_or_none():
|
|
||||||
db.add(
|
db.add(
|
||||||
MenuConfig(
|
MenuConfig(
|
||||||
id=generate_id(),
|
id=generate_id(),
|
||||||
@@ -421,24 +412,13 @@ async def _seed_data():
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
admin_groups = [
|
admin_groups = [
|
||||||
("模型设置", "RobotOutlined", 98),
|
("模型设置", "RobotOutlined", 98),
|
||||||
("模型配置", "RobotOutlined", 6),
|
("模型配置", "RobotOutlined", 6),
|
||||||
("系统设置", "SettingOutlined", 99),
|
("系统设置", "SettingOutlined", 99),
|
||||||
]
|
]
|
||||||
admin_group_ids: dict[str, str] = {}
|
admin_group_ids: dict[str, str] = {}
|
||||||
for label, icon, order in admin_groups:
|
for label, icon, order in admin_groups:
|
||||||
existing = await db.execute(
|
|
||||||
select(MenuConfig).where(
|
|
||||||
MenuConfig.label == label,
|
|
||||||
MenuConfig.menu_type == "group",
|
|
||||||
MenuConfig.menu_target == "admin",
|
|
||||||
).limit(1)
|
|
||||||
)
|
|
||||||
group = existing.scalar_one_or_none()
|
|
||||||
if group:
|
|
||||||
admin_group_ids[label] = group.id
|
|
||||||
else:
|
|
||||||
gid = generate_id()
|
gid = generate_id()
|
||||||
admin_group_ids[label] = gid
|
admin_group_ids[label] = gid
|
||||||
db.add(
|
db.add(
|
||||||
@@ -454,34 +434,27 @@ async def _seed_data():
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
admin_pages = [
|
admin_pages = [
|
||||||
("/", "数据概览", "DashboardOutlined", 0, None),
|
("/", "数据概览", "DashboardOutlined", 0, None),
|
||||||
("/users", "用户管理", "UserOutlined", 1, None),
|
("/users", "用户管理", "UserOutlined", 1, None),
|
||||||
("/credit-records", "交易流水", "WalletOutlined", 2, None),
|
("/credit-records", "交易流水", "WalletOutlined", 2, None),
|
||||||
("/generation-ai", "创作记录", "BulbOutlined", 3, None),
|
("/generation-ai", "创作记录", "BulbOutlined", 3, None),
|
||||||
("/generation-records", "项目记录", "VideoCameraOutlined", 3, None),
|
("/generation-records", "项目记录", "VideoCameraOutlined", 3, None),
|
||||||
("/recharge-packages", "充值套餐", "GiftOutlined", 4, None),
|
("/recharge-packages", "充值套餐", "GiftOutlined", 4, None),
|
||||||
("/notifications", "消息推送", "BellOutlined", 5, None),
|
("/notifications", "消息推送", "BellOutlined", 5, None),
|
||||||
("/payment-stats", "支付统计", "LineChartOutlined", 6, None),
|
("/payment-stats", "支付统计", "LineChartOutlined", 6, None),
|
||||||
("/video-engines", "视频引擎", "PlayCircleOutlined", 0, "模型设置"),
|
("/video-engines", "视频引擎", "PlayCircleOutlined", 0, "模型设置"),
|
||||||
("/models", "模型配置", "RobotOutlined", 1, "模型设置"),
|
("/models", "模型配置", "RobotOutlined", 1, "模型设置"),
|
||||||
("/image-engines", "图片模型", "PictureOutlined", 2, "模型设置"),
|
("/image-engines", "图片模型", "PictureOutlined", 2, "模型设置"),
|
||||||
("/credit-ratios", "积分比例", "CalculatorOutlined", 3, "模型设置"),
|
("/credit-ratios", "积分比例", "CalculatorOutlined", 3, "模型设置"),
|
||||||
("/payment", "支付配置", "DollarOutlined", 1, "系统设置"),
|
("/payment", "支付配置", "DollarOutlined", 1, "系统设置"),
|
||||||
("/industries", "行业配置", "AppstoreOutlined", 2, "系统设置"),
|
("/industries", "行业配置", "AppstoreOutlined", 2, "系统设置"),
|
||||||
("/menu-configs", "菜单配置", "SettingOutlined", 3, "系统设置"),
|
("/menu-configs", "菜单配置", "SettingOutlined", 3, "系统设置"),
|
||||||
("/settings", "系统设置", "SettingOutlined", 4, "系统设置"),
|
("/settings", "系统设置", "SettingOutlined", 4, "系统设置"),
|
||||||
("/operation-logs", "操作日志", "DatabaseOutlined", 5, "系统设置"),
|
("/operation-logs", "操作日志", "DatabaseOutlined", 5, "系统设置"),
|
||||||
("/oauthapp-list", "授权应用", "MenuOutlined", 28, "系统设置"),
|
("/oauthapp-list", "授权应用", "MenuOutlined", 28, "系统设置"),
|
||||||
]
|
]
|
||||||
for path, label, icon, order, parent_group in admin_pages:
|
for path, label, icon, order, parent_group in admin_pages:
|
||||||
existing = await db.execute(
|
|
||||||
select(MenuConfig).where(
|
|
||||||
MenuConfig.path == path,
|
|
||||||
MenuConfig.menu_target == "admin",
|
|
||||||
).limit(1)
|
|
||||||
)
|
|
||||||
if not existing.scalar_one_or_none():
|
|
||||||
db.add(
|
db.add(
|
||||||
MenuConfig(
|
MenuConfig(
|
||||||
id=generate_id(),
|
id=generate_id(),
|
||||||
|
|||||||
+111
-111
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<script type="module" crossorigin src="/assets/index-D9QoFfGP.js"></script>
|
<script type="module" crossorigin src="/assets/index-WjS6rFiW.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-eLRg4pQk.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-eLRg4pQk.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
StarOutlined,
|
StarOutlined,
|
||||||
LockOutlined,
|
LockOutlined,
|
||||||
GiftOutlined,
|
GiftOutlined,
|
||||||
SparklesOutlined,
|
ThunderboltOutlined,
|
||||||
PlayCircleOutlined,
|
PlayCircleOutlined,
|
||||||
CheckCircleOutlined,
|
CheckCircleOutlined,
|
||||||
HeartOutlined,
|
HeartOutlined,
|
||||||
@@ -80,7 +80,7 @@ const CreativePlazaPage: React.FC = () => {
|
|||||||
|
|
||||||
const features = [
|
const features = [
|
||||||
{
|
{
|
||||||
icon: <SparklesOutlined style={{ fontSize: 28, color: '#8b5cf6' }} />,
|
icon: <ThunderboltOutlined style={{ fontSize: 28, color: '#8b5cf6' }} />,
|
||||||
title: 'AI智能生成',
|
title: 'AI智能生成',
|
||||||
description: '先进的AI技术,一键生成高质量视频内容',
|
description: '先进的AI技术,一键生成高质量视频内容',
|
||||||
},
|
},
|
||||||
@@ -252,7 +252,7 @@ const CreativePlazaPage: React.FC = () => {
|
|||||||
border: 'none',
|
border: 'none',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<SparklesOutlined style={{ marginRight: 4 }} />
|
<ThunderboltOutlined style={{ marginRight: 4 }} />
|
||||||
生成同款
|
生成同款
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
LockOutlined,
|
LockOutlined,
|
||||||
ThunderboltOutlined,
|
ThunderboltOutlined,
|
||||||
GiftOutlined,
|
GiftOutlined,
|
||||||
TrendingUpOutlined,
|
BarChartOutlined,
|
||||||
FlameOutlined,
|
FireOutlined,
|
||||||
AwardOutlined,
|
TrophyOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
|
|
||||||
const PopularPage: React.FC = () => {
|
const PopularPage: React.FC = () => {
|
||||||
@@ -90,7 +90,7 @@ const PopularPage: React.FC = () => {
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
boxShadow: '0 4px 16px rgba(245,158,11,0.3)',
|
boxShadow: '0 4px 16px rgba(245,158,11,0.3)',
|
||||||
}}>
|
}}>
|
||||||
<TrendingUpOutlined style={{ fontSize: 22, color: '#fff' }} />
|
<BarChartOutlined style={{ fontSize: 22, color: '#fff' }} />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Typography.Title level={2} style={{ margin: 0, color: '#1e293b', fontWeight: 700 }}>
|
<Typography.Title level={2} style={{ margin: 0, color: '#1e293b', fontWeight: 700 }}>
|
||||||
@@ -117,7 +117,7 @@ const PopularPage: React.FC = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography.Title level={4} style={{ marginBottom: 20, color: '#1e293b' }}>
|
<Typography.Title level={4} style={{ marginBottom: 20, color: '#1e293b' }}>
|
||||||
<FlameOutlined style={{ marginRight: 8, color: '#f59e0b' }} />
|
<FireOutlined style={{ marginRight: 8, color: '#f59e0b' }} />
|
||||||
行业热度排行
|
行业热度排行
|
||||||
</Typography.Title>
|
</Typography.Title>
|
||||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: 16 }}>
|
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: 16 }}>
|
||||||
@@ -165,7 +165,7 @@ const PopularPage: React.FC = () => {
|
|||||||
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 20 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 20 }}>
|
||||||
<Typography.Title level={4} style={{ margin: 0, color: '#1e293b' }}>
|
<Typography.Title level={4} style={{ margin: 0, color: '#1e293b' }}>
|
||||||
<AwardOutlined style={{ marginRight: 8, color: '#6366f1' }} />
|
<TrophyOutlined style={{ marginRight: 8, color: '#6366f1' }} />
|
||||||
爆款素材榜单
|
爆款素材榜单
|
||||||
</Typography.Title>
|
</Typography.Title>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user