feat: add save feedback prompts, featured agent fields, dynamic Dify API config, and chat improvements
- Add success/error feedback messages near submit buttons in all admin forms - Display success prompt for 1s before redirect after save - Show API error details on save failure - Add isFeatured/featuredOrder fields to Agent model and admin UI - Add difyApiUrl/difyApiKey fields for per-agent Dify API configuration - Show featured badge column in agent admin list - Display featured agents on homepage sorted by order - Refactor chat page streaming with AbortController and stable userId - Improve Dify API proxy to use per-agent credentials
This commit is contained in:
+40
-21
@@ -113,20 +113,37 @@ async function main() {
|
||||
]),
|
||||
usageCount: 1000,
|
||||
status: "active",
|
||||
isFeatured: true,
|
||||
featuredOrder: 1,
|
||||
difyApiUrl: "https://api.dify.ai/v1",
|
||||
difyApiKey: "app-demo-key-123456",
|
||||
},
|
||||
}),
|
||||
prisma.agent.upsert({
|
||||
where: { slug: "writing-assistant-pro" },
|
||||
where: { slug: "huaiqi-secretary" },
|
||||
update: {},
|
||||
create: {
|
||||
name: "写作助手 Pro",
|
||||
slug: "writing-assistant-pro",
|
||||
description: "营销文案、博客文章、邮件草稿,输入关键词即可生成高质量内容。",
|
||||
icon: "✍️",
|
||||
categoryId: categories[1].id,
|
||||
features: "营销文案, 博客文章, 邮件草稿",
|
||||
name: "淮企小秘书",
|
||||
slug: "huaiqi-secretary",
|
||||
description: "专为淮安企业打造的智能秘书,提供政策解读、企业办事指南、惠企政策查询等一站式服务,助力企业高效运营。",
|
||||
icon: "🏢",
|
||||
categoryId: categories[6].id,
|
||||
features: "政策解读, 企业办事指南, 惠企政策, 智能问答",
|
||||
hotQuestions: JSON.stringify([
|
||||
"到淮安这边投资,项目审批快吗?",
|
||||
"目前淮安对绿色工厂有哪些支持政策?",
|
||||
"请问企业实施技术改造项目,淮安市有哪些支持政策?",
|
||||
"淮安有哪些产业配套服务?",
|
||||
]),
|
||||
quickQuestions: JSON.stringify([
|
||||
"惠企政策查询",
|
||||
"企业办事指南",
|
||||
"政策解读",
|
||||
]),
|
||||
usageCount: 850,
|
||||
status: "active",
|
||||
isFeatured: true,
|
||||
featuredOrder: 2,
|
||||
},
|
||||
}),
|
||||
prisma.agent.upsert({
|
||||
@@ -141,6 +158,8 @@ async function main() {
|
||||
features: "数据清洗, 数据可视化, 分析报告",
|
||||
usageCount: 620,
|
||||
status: "active",
|
||||
isFeatured: true,
|
||||
featuredOrder: 3,
|
||||
},
|
||||
}),
|
||||
prisma.agent.upsert({
|
||||
@@ -185,20 +204,20 @@ async function main() {
|
||||
status: "active",
|
||||
},
|
||||
}),
|
||||
prisma.agent.upsert({
|
||||
where: { slug: "group-policy-ai-assistant" },
|
||||
update: {},
|
||||
create: {
|
||||
name: "集团制度AI助手",
|
||||
slug: "group-policy-ai-assistant",
|
||||
description: "专注于集团规章制度解读与咨询,快速查询、解读各类制度文件,助力合规管理与制度落地。",
|
||||
icon: "📋",
|
||||
categoryId: categories[6].id,
|
||||
features: "制度解读, 合规咨询, 文件查询, 制度培训",
|
||||
usageCount: 50,
|
||||
status: "active",
|
||||
},
|
||||
}),
|
||||
prisma.agent.upsert({
|
||||
where: { slug: "group-policy-ai-assistant" },
|
||||
update: {},
|
||||
create: {
|
||||
name: "集团制度AI助手",
|
||||
slug: "group-policy-ai-assistant",
|
||||
description: "专注于集团规章制度解读与咨询,快速查询、解读各类制度文件,助力合规管理与制度落地。",
|
||||
icon: "📋",
|
||||
categoryId: categories[6].id,
|
||||
features: "制度解读, 合规咨询, 文件查询, 制度培训",
|
||||
usageCount: 50,
|
||||
status: "active",
|
||||
},
|
||||
}),
|
||||
])
|
||||
console.log("Created agents:", agents.map(a => a.name).join(", "))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user