diff --git a/frontend/public/locales/en/translation.json b/frontend/public/locales/en/translation.json index 27d58ea..a5be8bc 100644 --- a/frontend/public/locales/en/translation.json +++ b/frontend/public/locales/en/translation.json @@ -40,6 +40,7 @@ "Featured Packages": "Featured Packages", "Individual Tools": "Individual Tools", "Details": "Details", + "Copy code": "Copy code", "excel": "Excel", "data": "Data", "analysis": "Analysis", @@ -198,6 +199,27 @@ "Tool name": "Tool name", "Tool description": "Tool description", "Take Offline": "Take Offline", + "Platform Domain": "Platform Domain", + "Enter platform domain (e.g., example.com)": "Enter platform domain (e.g., example.com)", + "The domain name of your platform": "The domain name of your platform", + "MCP Server Domain": "MCP Server Domain", + "Enter MCP server domain (e.g., api.example.com)": "Enter MCP server domain (e.g., api.example.com)", + "The domain for MCP server API calls": "The domain for MCP server API calls", + "Featured in the XPack showcase": "Featured in the XPack showcase", + "Enable this option to feature your site in the XPack global showcase and reach users worldwide.": "Enable this option to feature your site in the XPack global showcase and reach users worldwide.", + "Please enter a platform domain before enabling showcase": "Please enter a platform domain before enabling showcase", + "FAQ Management": "FAQ Management", + "Configure frequently asked questions for your users": "Configure frequently asked questions for your users", + "FAQ List": "FAQ List", + "Edit questions and answers directly in the table below": "Edit questions and answers directly in the table below", + "Save All": "Save All", + "Order": "Order", + "Question": "Question", + "Answer": "Answer", + "No FAQ items available.": "No FAQ items available.", + "Enter question": "Enter question", + "Enter answer": "Enter answer", + "Insert below": "Insert below", "Bring Online": "Bring Online", "Short Description": "Short Description", "Long Description": "Long Description", @@ -234,6 +256,8 @@ "Failed to parse OpenAPI document": "Failed to parse OpenAPI document", "OpenAPI document parsed successfully": "OpenAPI document parsed successfully", "Please enter a valid URL": "Please enter a valid URL", + "Please enter a valid URL with http:// or https://": "Please enter a valid URL with http:// or https://", + "Please fix validation errors before saving": "Please fix validation errors before saving", "Please select a file": "Please select a file", "File uploaded successfully": "File uploaded successfully", "Failed to upload file": "Failed to upload file", @@ -306,6 +330,14 @@ "All Roles": "All Roles", "Ban User": "Ban User", "Unban User": "Unban User", + "Recharge User": "Recharge User", + "Current Balance": "Current Balance", + "User recharged successfully": "User recharged successfully", + "Please enter a valid amount": "Please enter a valid amount", + "Minimum recharge amount is $1": "Minimum recharge amount is $1", + "User not selected": "User not selected", + "Recharge failed": "Recharge failed", + "Network error, please try again": "Network error, please try again", "Delete User": "Delete User", "View Profile": "View Profile", "Edit User": "Edit User", @@ -386,12 +418,20 @@ "Failed to test Google auth": "Failed to test Google auth", "Failed to fetch Stripe config": "Failed to fetch Stripe config", "Failed to save Stripe config": "Failed to save Stripe config", + "Failed to save Alipay config": "Failed to save Alipay config", + "Failed to save WeChat config": "Failed to save WeChat config", "Stripe connection test failed": "Stripe connection test failed", "Stripe connection test successful": "Stripe connection test successful", + "Alipay connection test successful": "Alipay connection test successful", + "Alipay connection test failed": "Alipay connection test failed", + "WeChat connection test successful": "WeChat connection test successful", + "WeChat connection test failed": "WeChat connection test failed", "Connection test failed": "Connection test failed", "Unknown error": "Unknown error", "Secret Key cannot be empty": "Secret Key cannot be empty", "Stripe Configuration": "Stripe Configuration", + "Alipay Configuration": "Alipay Configuration", + "WeChat Configuration": "WeChat Configuration", "Google Login Settings": "Google Login Settings", "Enable Google Login": "Enable Google Login", "Administrator Account": "Administrator Account", @@ -533,8 +573,19 @@ "Billing Mode": "Billing Mode", "Enable free quota": "Enable free quota", "Configure Stripe payment interface": "Configure Stripe payment interface", + "Configure Alipay payment interface": "Configure Alipay payment interface", + "Configure WeChat payment interface": "Configure WeChat payment interface", "Secret Key": "Secret Key", "Stripe secret key for server-side API calls": "Stripe secret key for server-side API calls", + "App ID": "App ID", + "Alipay App ID": "Alipay App ID", + "App Private Key": "App Private Key", + "Alipay App Private Key": "Alipay App Private Key", + "Alipay Public Key": "Alipay Public Key", + "Alipay public key for verification": "Alipay public key for verification", + "WeChat App ID": "WeChat App ID", + "Merchant ID": "Merchant ID", + "WeChat Merchant ID": "WeChat Merchant ID", "Webhook Secret": "Webhook Secret", "Test Connection": "Test Connection", "Monitor platform revenue and view user recharge history": "Monitor platform revenue and view user recharge history", @@ -593,6 +644,7 @@ "Confirm": "Confirm", "Recharge Account": "Recharge Account", "Funds will be added to your account balance": "Funds will be added to your account balance", + "Please select a payment method": "Please select a payment method", "Manage your balance and recharge history": "Manage your balance and recharge history", "Build incredible AI agents together": "Build incredible AI agents together", "Balance: {{amount}}": "Balance: {{amount}}", @@ -633,6 +685,12 @@ "Total Revenue": "Total Revenue", "Failed to save stripe config": "Failed to save stripe config", "Stripe config saved successfully": "Stripe config saved successfully", + "Alipay config saved successfully": "Alipay config saved successfully", + "WeChat config saved successfully": "WeChat config saved successfully", + "Failed to save {{channelName}} config": "Failed to save {{channelName}} config", + "{{channelName}} config saved successfully": "{{channelName}} config saved successfully", + "{{channelName}} connection test failed": "{{channelName}} connection test failed", + "{{channelName}} connection test successful": "{{channelName}} connection test successful", "Login successful": "Login successful", "Logged out successfully": "Logged out successfully", "Configure email settings": "Configure email settings", @@ -727,5 +785,91 @@ "Theme changed successfully": "Theme changed successfully", "Failed to change theme": "Failed to change theme", "About page saved successfully": "About page saved successfully", - "Failed to save about page": "Failed to save about page" + "Failed to save about page": "Failed to save about page", + "General": "General", + "Homepage": "Homepage", + "Homepage content and theme settings": "Homepage content and theme settings", + "About Page": "About Page", + "About page content configuration": "About page content configuration", + "Email & Admin": "Email & Admin", + "Email and administrator settings": "Email and administrator settings", + "Embedded HTML": "Embedded HTML", + "Configure custom HTML content for global injection": "Configure custom HTML content for global injection", + "Enable Custom HTML": "Enable Custom HTML", + "Toggle to enable or disable custom HTML injection": "Toggle to enable or disable custom HTML injection", + "Show Preview": "Show Preview", + "Hide Preview": "Hide Preview", + "Enter your custom HTML, CSS, or JavaScript code here...\n\nExample:\n\n\n": "Enter your custom HTML, CSS, or JavaScript code here...\n\nExample:\n\n\n", + "This HTML will be injected globally into the application. You can include script tags, CSS styles, or any valid HTML.": "This HTML will be injected globally into the application. You can include script tags, CSS styles, or any valid HTML.", + "Preview": "Preview", + "Note: This is a text preview. The actual HTML will be rendered when saved and enabled.": "Note: This is a text preview. The actual HTML will be rendered when saved and enabled.", + "Usage Instructions": "Usage Instructions", + "You can include Google Analytics, custom CSS, or any tracking scripts": "You can include Google Analytics, custom CSS, or any tracking scripts", + "The HTML will be injected into the document head section": "The HTML will be injected into the document head section", + "Make sure your code is valid to avoid breaking the application": "Make sure your code is valid to avoid breaking the application", + "Changes take effect immediately after saving and enabling": "Changes take effect immediately after saving and enabling", + "Welcome to Your Platform": "Welcome to Your Platform", + "Let's set up your platform with some basic information": "Let's set up your platform with some basic information", + "Information needed": "Information needed", + "Fields marked with * are required": "Fields marked with * are required", + "Website title is required": "Website title is required", + "Headline is required": "Headline is required", + "Subheadline is required": "Subheadline is required", + "Please fill in all required fields": "Please fill in all required fields", + "Setup failed. Please try again.": "Setup failed. Please try again.", + "Complete Setup": "Complete Setup", + "Platform setup completed successfully!": "Platform setup completed successfully!", + "Welcome to the famous five-minute platform setup process! Just fill in the information below and you'll be on your way to using the most extendable and powerful platform.": "Welcome to the famous five-minute platform setup process! Just fill in the information below and you'll be on your way to using the most extendable and powerful platform.", + "Please provide the following information. Do not worry, you can always change these settings later in the admin panel.": "Please provide the following information. Do not worry, you can always change these settings later in the admin panel.", + "Failed to update homepage config": "Failed to update homepage config", + "Homepage config updated successfully": "Homepage config updated successfully", + "Failed to load homepage config": "Failed to load homepage config", + "FAQ updated successfully": "FAQ updated successfully", + "Navigation updated successfully": "Navigation updated successfully", + "Embedded HTML updated successfully": "Embedded HTML updated successfully", + "Payment channels updated successfully": "Payment channels updated successfully", + "Manage frequently asked questions": "Manage frequently asked questions", + "Add FAQ Item": "Add FAQ Item", + "Remove FAQ Item": "Remove FAQ Item", + "Top Navigation": "Top Navigation", + "Manage top navigation links": "Manage top navigation links", + "Title": "Title", + "Link": "Link", + "Target": "Target", + "Add Navigation Item": "Add Navigation Item", + "Remove Navigation Item": "Remove Navigation Item", + "Enter title": "Enter title", + "Enter link URL": "Enter link URL", + "Same window": "Same window", + "New window": "New window", + "Custom HTML injection": "Custom HTML injection", + "Enable embedded HTML": "Enable embedded HTML", + "HTML Content": "HTML Content", + "Enter custom HTML code": "Enter custom HTML code", + "Manage payment methods": "Manage payment methods", + "Channel ID": "Channel ID", + "Display Name": "Display Name", + "Add Payment Channel": "Add Payment Channel", + "Remove Payment Channel": "Remove Payment Channel", + "Enter channel ID": "Enter channel ID", + "Enter display name": "Enter display name", + "Installation Status": "Installation Status", + "First time installation": "First time installation", + "System installed": "System installed", + "Configure top navigation menu items and links": "Configure top navigation menu items and links", + "Per Million Tokens": "Per Million Tokens", + "Price per million tokens consumed": "Price per million tokens consumed", + "Price per million tokens": "Price per million tokens", + "Price per API call": "Price per API call", + "Payment channel disabled successfully": "Payment channel disabled successfully", + "Failed to disable payment channel": "Failed to disable payment channel", + "Payment channel enabled successfully": "Payment channel enabled successfully", + "Failed to enable payment channel": "Failed to enable payment channel", + "Input Token Price": "Input Token Price", + "Output Token Price": "Output Token Price", + "Price per million input tokens": "Price per million input tokens", + "Price per million output tokens": "Price per million output tokens", + "Input": "Input", + "Output": "Output", + "1M tokens": "1M tokens" } diff --git a/frontend/public/locales/zh-CN/translation.json b/frontend/public/locales/zh-CN/translation.json index 8cf41e9..993b599 100644 --- a/frontend/public/locales/zh-CN/translation.json +++ b/frontend/public/locales/zh-CN/translation.json @@ -40,6 +40,7 @@ "Featured Packages": "精选工具包", "Individual Tools": "单个工具", "Details": "详情", + "Copy code": "复制代码", "excel": "Excel", "data": "数据", "analysis": "分析", @@ -199,6 +200,27 @@ "Tool name": "工具名称", "Tool description": "工具描述", "Take Offline": "下线", + "Platform Domain": "平台域名", + "Enter platform domain (e.g., example.com)": "输入平台域名(例如:example.com)", + "The domain name of your platform": "您平台的域名", + "MCP Server Domain": "MCP 服务器域名", + "Enter MCP server domain (e.g., api.example.com)": "输入 MCP 服务器域名(例如:api.example.com)", + "The domain for MCP server API calls": "用于 MCP 服务器 API 调用的域名", + "Featured in the XPack showcase": "展示在 XPack 的全球案例榜单", + "Enable this option to feature your site in the XPack global showcase and reach users worldwide.": "当开启选项,你的网站会展示在 XPack 的全球案例榜单来获得全球用户的关注。", + "Please enter a platform domain before enabling showcase": "启用展示功能前请先输入平台域名", + "FAQ Management": "FAQ管理", + "Configure frequently asked questions for your users": "为您的用户配置常见问题", + "FAQ List": "FAQ列表", + "Edit questions and answers directly in the table below": "在下方表格中直接编辑问题和答案", + "Save All": "保存全部", + "Order": "排序", + "Question": "问题", + "Answer": "答案", + "No FAQ items available.": "暂无FAQ项目。", + "Enter question": "输入问题", + "Enter answer": "输入答案", + "Insert below": "在下方插入", "Bring Online": "上线", "Short Description": "简短描述", "Long Description": "详细描述", @@ -235,6 +257,8 @@ "Failed to parse OpenAPI document": "解析 OpenAPI 文档失败", "OpenAPI document parsed successfully": "OpenAPI 文档解析成功", "Please enter a valid URL": "请输入有效的 URL", + "Please enter a valid URL with http:// or https://": "请输入有效的 URL,需要包含 http:// 或 https://", + "Please fix validation errors before saving": "请修复验证错误后再保存", "Please select a file": "请选择文件", "File uploaded successfully": "文件上传成功", "Failed to upload file": "文件上传失败", @@ -307,6 +331,14 @@ "All Roles": "所有角色", "Ban User": "封禁用户", "Unban User": "解封用户", + "Recharge User": "为用户充值", + "Current Balance": "当前余额", + "User recharged successfully": "用户充值成功", + "Please enter a valid amount": "请输入有效金额", + "Minimum recharge amount is $1": "最低充值金额为 $1", + "User not selected": "未选择用户", + "Recharge failed": "充值失败", + "Network error, please try again": "网络错误,请重试", "Delete User": "删除用户", "View Profile": "查看资料", "Edit User": "编辑用户", @@ -387,12 +419,20 @@ "Failed to test Google auth": "测试Google认证失败", "Failed to fetch Stripe config": "获取Stripe配置失败", "Failed to save Stripe config": "保存Stripe配置失败", + "Failed to save Alipay config": "保存支付宝配置失败", + "Failed to save WeChat config": "保存微信配置失败", "Stripe connection test failed": "Stripe连接测试失败", "Stripe connection test successful": "Stripe连接测试成功", + "Alipay connection test successful": "支付宝连接测试成功", + "Alipay connection test failed": "支付宝连接测试失败", + "WeChat connection test successful": "微信连接测试成功", + "WeChat connection test failed": "微信连接测试失败", "Connection test failed": "连接测试失败", "Unknown error": "未知错误", "Secret Key cannot be empty": "密钥不能为空", "Stripe Configuration": "Stripe配置", + "Alipay Configuration": "支付宝配置", + "WeChat Configuration": "微信配置", "Google Login Settings": "Google登录设置", "Enable Google Login": "启用Google登录", "Administrator Account": "管理员账户", @@ -535,6 +575,17 @@ "Billing Mode": "计费模式", "Enable free quota": "启用免费配额", "Configure Stripe payment interface": "配置Stripe支付接口", + "Configure Alipay payment interface": "配置支付宝支付接口", + "Configure WeChat payment interface": "配置微信支付接口", + "App ID": "应用ID", + "Alipay App ID": "支付宝应用ID", + "App Private Key": "应用私钥", + "Alipay App Private Key": "支付宝应用私钥", + "Alipay Public Key": "支付宝公钥", + "Alipay public key for verification": "支付宝公钥用于验证", + "WeChat App ID": "微信应用ID", + "Merchant ID": "商户号", + "WeChat Merchant ID": "微信商户号", "Secret Key": "密钥", "Stripe secret key for server-side API calls": "用于服务端API调用的Stripe密钥", "Webhook Secret": "Webhook密钥", @@ -594,7 +645,8 @@ "WeChat Pay": "微信支付", "Confirm": "确认", "Recharge Account": "充值账户", - "Funds will be added to your account balance": "资金将添加到您的账户余额", + "Funds will be added to your account balance": "资金将添加到您的账户余额中", + "Please select a payment method": "请选择支付方式", "Manage your balance and recharge history": "管理您的余额和充值历史", "Build incredible AI agents together": "一起构建强大的 AI 代理", "Balance: {{amount}}": "余额: {{amount}}", @@ -609,6 +661,10 @@ "Failed to toggle service status": "切换服务状态失败", "Stripe configuration saved successfully": "Stripe 配置保存成功", "Failed to save Stripe configuration": "保存 Stripe 配置失败", + "Failed to save {{channelName}} config": "保存{{channelName}}配置失败", + "{{channelName}} config saved successfully": "{{channelName}}配置保存成功", + "{{channelName}} connection test failed": "{{channelName}}连接测试失败", + "{{channelName}} connection test successful": "{{channelName}}连接测试成功", "System config updated successfully": "系统配置更新成功", "Failed to update system config": "更新系统配置失败", "Confirm Purchase": "确认购买", @@ -635,6 +691,8 @@ "Total Revenue": "总收入", "Failed to save stripe config": "保存 Stripe 配置失败", "Stripe config saved successfully": "Stripe 配置保存成功", + "Alipay config saved successfully": "支付宝配置保存成功", + "WeChat config saved successfully": "微信配置保存成功", "Login successful": "登录成功", "Logged out successfully": "退出登录成功", "Configure email settings": "配置邮箱设置", @@ -729,5 +787,91 @@ "Theme changed successfully": "主题切换成功", "Failed to change theme": "主题切换失败", "About page saved successfully": "关于页面保存成功", - "Failed to save about page": "关于页面保存失败" + "Failed to save about page": "关于页面保存失败", + "General": "常规设置", + "Homepage": "首页设置", + "Homepage content and theme settings": "首页内容和主题设置", + "About Page": "关于页面", + "About page content configuration": "关于页面内容配置", + "Email & Admin": "邮箱与管理员", + "Email and administrator settings": "邮箱和管理员设置", + "Embedded HTML": "嵌入式HTML", + "Configure custom HTML content for global injection": "配置自定义HTML内容进行全局注入", + "Enable Custom HTML": "启用自定义HTML", + "Toggle to enable or disable custom HTML injection": "切换启用或禁用自定义HTML注入", + "Show Preview": "显示预览", + "Hide Preview": "隐藏预览", + "Enter your custom HTML, CSS, or JavaScript code here...\n\nExample:\n\n\n": "在此输入您的自定义HTML、CSS或JavaScript代码...\n\n示例:\n\n\n", + "This HTML will be injected globally into the application. You can include script tags, CSS styles, or any valid HTML.": "此HTML将全局注入到应用程序中。您可以包含脚本标签、CSS样式或任何有效的HTML。", + "Preview": "预览", + "Note: This is a text preview. The actual HTML will be rendered when saved and enabled.": "注意:这是文本预览。实际的HTML将在保存并启用后渲染。", + "Usage Instructions": "使用说明", + "You can include Google Analytics, custom CSS, or any tracking scripts": "您可以包含Google Analytics、自定义CSS或任何跟踪脚本", + "The HTML will be injected into the document head section": "HTML将注入到文档头部分", + "Make sure your code is valid to avoid breaking the application": "确保您的代码有效,以避免破坏应用程序", + "Changes take effect immediately after saving and enabling": "更改在保存并启用后立即生效", + "Welcome to Your Platform": "欢迎使用您的平台", + "Let's set up your platform with some basic information": "让我们用一些基本信息来设置您的平台", + "Fields marked with * are required": "标有 * 的字段为必填项", + "Website title is required": "网站标题为必填项", + "Headline is required": "标题为必填项", + "Subheadline is required": "副标题为必填项", + "Please fill in all required fields": "请填写所有必填字段", + "Setup failed. Please try again.": "设置失败,请重试。", + "Complete Setup": "完成设置", + "Platform setup completed successfully!": "平台设置成功完成!", + "Welcome to the famous five-minute platform setup process! Just fill in the information below and you'll be on your way to using the most extendable and powerful platform.": "欢迎使用著名的五分钟平台设置流程!只需填写下面的信息,您就可以开始使用最具扩展性和功能强大的平台了。", + "Information needed": "所需信息", + "Please provide the following information. Do not worry, you can always change these settings later in the admin panel.": "请提供以下信息。不用担心,您随时可以在管理面板中更改这些设置。", + "Failed to update homepage config": "更新主页配置失败", + "Homepage config updated successfully": "主页配置更新成功", + "Failed to load homepage config": "加载主页配置失败", + "FAQ updated successfully": "常见问题更新成功", + "Navigation updated successfully": "导航更新成功", + "Embedded HTML updated successfully": "嵌入HTML更新成功", + "Payment channels updated successfully": "支付渠道更新成功", + "Manage frequently asked questions": "管理常见问题", + "Add FAQ Item": "添加常见问题", + "Remove FAQ Item": "删除常见问题", + "Top Navigation": "顶部导航", + "Manage top navigation links": "管理顶部导航链接", + "Title": "标题", + "Link": "链接", + "Target": "目标", + "Add Navigation Item": "添加导航项", + "Remove Navigation Item": "删除导航项", + "Enter title": "输入标题", + "Enter link URL": "输入链接地址", + "Same window": "当前窗口", + "New window": "新窗口", + "Custom HTML injection": "自定义HTML注入", + "Enable embedded HTML": "启用嵌入HTML", + "HTML Content": "HTML内容", + "Enter custom HTML code": "输入自定义HTML代码", + "Manage payment methods": "管理支付方式", + "Channel ID": "渠道ID", + "Display Name": "显示名称", + "Add Payment Channel": "添加支付渠道", + "Remove Payment Channel": "删除支付渠道", + "Enter channel ID": "输入渠道ID", + "Enter display name": "输入显示名称", + "Installation Status": "安装状态", + "First time installation": "首次安装", + "System installed": "系统已安装", + "Configure top navigation menu items and links": "配置顶部导航菜单项和链接", + "Per Million Tokens": "每百万Token", + "Price per million tokens consumed": "每百万Token消耗的价格", + "Price per million tokens": "每百万Token价格", + "Price per API call": "每次API调用价格", + "Payment channel disabled successfully": "支付渠道禁用成功", + "Failed to disable payment channel": "禁用支付渠道失败", + "Payment channel enabled successfully": "支付渠道启用成功", + "Failed to enable payment channel": "启用支付渠道失败", + "Input Token Price": "输入Token价格", + "Output Token Price": "输出Token价格", + "Price per million input tokens": "每百万输入Token价格", + "Price per million output tokens": "每百万输出Token价格", + "Input": "输入", + "Output": "输出", + "1M tokens": "1M tokens" } diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 9f6571a..59e1931 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -32,6 +32,13 @@ export default async function RootLayout({ `, }} /> + {platformConfig?.embeded_html?.is_enabled && platformConfig?.embeded_html?.html && ( +
+ )}+ {t(activeItem.description)} +
+{t('Configure Stripe payment interface')}
-+ {t("Configure Alipay payment interface")} +
++ {t("Configure Stripe payment interface")} +
++ {t("Configure WeChat payment interface")} +
+{t('Configure administrator login credentials')}
- - }> ++ {t("Configure administrator login credentials")} +
+ + } + >+ {t("Configure custom HTML content for global injection")} +
+ + } + > ++ {t("Configure frequently asked questions for your users")} +
+ + } + > +- {t("Configure about page content")} -
- - } - > -+ {t("Configure top navigation menu items and links")} +
+ + } + > +
{`{
"mcpServers": {
- "${mcpName || "xpack-mcp-market"}": {
+ "${mcpName}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey=`}
diff --git a/frontend/src/components/theme/classic/Home.tsx b/frontend/src/components/theme/classic/Home.tsx
index 847cfd2..e6a3a79 100644
--- a/frontend/src/components/theme/classic/Home.tsx
+++ b/frontend/src/components/theme/classic/Home.tsx
@@ -23,6 +23,7 @@ import {
import { Footer } from "./Footer";
import { Navigation } from "./Navigation";
import { NavigationItem } from "@/shared/components/Navigation";
+import { Faq } from "@/components/marketplace/Faq";
interface HomeProps {
// 状态
@@ -163,13 +164,14 @@ export const Home: React.FC = ({
{/* Services Grid */}
-
+
{services.map((service) => (
-
+
{/* Header */}
@@ -211,6 +213,8 @@ export const Home: React.FC = ({
@@ -245,6 +249,7 @@ export const Home: React.FC = ({
)}
+
diff --git a/frontend/src/components/theme/classic/Navigation.tsx b/frontend/src/components/theme/classic/Navigation.tsx
index 70df4a9..8946cc6 100644
--- a/frontend/src/components/theme/classic/Navigation.tsx
+++ b/frontend/src/components/theme/classic/Navigation.tsx
@@ -43,7 +43,12 @@ export const Navigation: React.FC = ({ items }) => {
{items?.map((item) => (
-
+
{t(item.label)}
))}
diff --git a/frontend/src/components/theme/creative/Detail.tsx b/frontend/src/components/theme/creative/Detail.tsx
index 71af15c..dac9143 100644
--- a/frontend/src/components/theme/creative/Detail.tsx
+++ b/frontend/src/components/theme/creative/Detail.tsx
@@ -2,13 +2,12 @@
import React, { useState } from "react";
import { useTranslation } from "@/shared/lib/useTranslation";
-import { Tabs, Tab, Chip, Card, CardBody } from "@nextui-org/react";
+import { Tabs, Tab, Chip, Card, CardBody, Button } from "@nextui-org/react";
import { ServiceData } from "@/shared/types/marketplace";
import { ProductHeader } from "@/shared/components/marketplace/ProductHeader";
import { ProductOverview } from "@/shared/components/marketplace/ProductOverview";
-import { ProductTools } from "@/shared/components/marketplace/ProductTools";
import { ProductNotFound } from "@/shared/components/marketplace/ProductNotFound";
-import { Sparkles, Zap, Settings2 } from "lucide-react";
+import { Sparkles, Zap, Settings2, Copy } from "lucide-react";
import { Navigation } from "./Navigation";
import { Footer } from "./Footer";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
@@ -24,6 +23,7 @@ interface DetailProps {
mcpName?: string;
// navigation items
navItems?: NavigationItem[];
+ onCopy: () => void;
}
export const Detail: React.FC = ({
@@ -32,6 +32,7 @@ export const Detail: React.FC = ({
url,
mcpName,
navItems = [],
+ onCopy,
}) => {
const { t } = useTranslation();
const [activeTab, setActiveTab] = useState("overview");
@@ -42,151 +43,190 @@ export const Detail: React.FC = ({
}
return (
-
+
{/* Creative Background */}
-
- {/* Artistic decorative elements */}
-
-
-
-
+
+
+ {/* Artistic decorative elements */}
+
+
+
+
- {/* Additional artistic elements */}
-
-
-
-
-
- {/* Creative Product Header */}
-
-
-
-
-
-
+ {/* Additional artistic elements */}
+
+
- {/* Main Content */}
-
-
- {/* Left side - Main content */}
-
-
-
-
- setActiveTab(key as string)}
- variant="underlined"
- color="secondary"
- className="px-6 pt-6"
- classNames={{
- tabList:
- "gap-6 w-full relative rounded-none p-0 border-b border-pink-200/50",
- cursor:
- "w-full bg-gradient-to-r from-pink-500 via-red-500 to-orange-500",
- tab: "max-w-fit px-0 h-12",
- tabContent:
- "group-data-[selected=true]:text-pink-600 font-semibold",
- }}
- >
-
-
- {t("Overview")}
-
- }
- >
-
-
-
-
-
-
- {t("Tools")}
-
- {product.tools.length}
-
-
- }
- >
-
-
-
-
-
-
-
+
+ {/* Creative Product Header */}
+
+
+
+
+
+
- {/* Right side - Server Config */}
-
-
-
-
-
-
-
-
-
- {t("Configuration")}
-
-
- {/* Code Snippet */}
-
-
-
+
+ {/* Left side - Main content */}
+
+
+
+
+ setActiveTab(key as string)}
+ variant="underlined"
+ color="secondary"
+ className="px-6 pt-6"
+ classNames={{
+ tabList:
+ "gap-6 w-full relative rounded-none p-0 border-b border-pink-200/50",
+ cursor:
+ "w-full bg-gradient-to-r from-pink-500 via-red-500 to-orange-500",
+ tab: "max-w-fit px-0 h-12",
+ tabContent:
+ "group-data-[selected=true]:text-pink-600 font-semibold",
+ }}
+ >
+
+
+ {t("Overview")}
+
+ }
>
- {platformConfig?.name} MCP
-
-
-
- {`{
+
+
+
+
+
+
+ {t("Tools")}
+
+ {product.tools.length}
+
+
+ }
+ >
+
+ {product.tools.length > 0 ? (
+ product.tools.map((tool, index) => (
+
+
+
+ {tool.name}
+
+
+ {tool.description ||
+ t("No description available")}
+
+
+
+ ))
+ ) : (
+
+
+
+ {t("No tools available in this service.")}
+
+
+
+ )}
+
+
+
+
+
+
+
+ {/* Right side - Server Config */}
+
+
+
+
+
+
+
+
+
+ {t("Configuration")}
+
+
+ {/* Code Snippet */}
+
+
+
+
+ {platformConfig?.name} MCP
+
+
+
+
+
+ {`{
"mcpServers": {
- "${mcpName || "xpack-mcp-market"}": {
+ "${mcpName}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey=`}
- {`{Your-${platformConfig?.name}-API-Key}`}
- {`"
+ {`{Your-${platformConfig?.name}-API-Key}`}
+ {`"
}
}
}`}
-
-
-
-
-
-
+
+
+
+
+
+
+
-
- {/* SEO-friendly: Simple text content for search engines */}
-
-
+
+
+
);
};
diff --git a/frontend/src/components/theme/creative/Home.tsx b/frontend/src/components/theme/creative/Home.tsx
index 46bad2a..e2acc69 100644
--- a/frontend/src/components/theme/creative/Home.tsx
+++ b/frontend/src/components/theme/creative/Home.tsx
@@ -23,6 +23,7 @@ import {
import { Footer } from "./Footer";
import { Navigation } from "./Navigation";
import { NavigationItem } from "@/shared/components/Navigation";
+import { Faq } from "@/components/marketplace/Faq";
interface HomeProps {
// 状态
@@ -69,17 +70,17 @@ export const Home: React.FC = ({
{/* Creative Background decorative elements */}
- {/* 主要装饰圆圈 */}
+ {/* main decorative circles */}
- {/* 小装饰圆圈 */}
+ {/* small decorative circles */}
- {/* 微小装饰点 */}
+ {/* small decorative points */}
@@ -129,7 +130,7 @@ export const Home: React.FC = ({
placeholder={
searchSuggestions.length > 0
? t(searchSuggestions[0])
- : t("✨ 发现神奇的服务...")
+ : t("✨ Discover amazing services...")
}
value={searchQuery}
onChange={(e) => onSearchChange(e.target.value)}
@@ -170,9 +171,6 @@ export const Home: React.FC = ({
-
- ✨ 加载魔法中...
-
@@ -180,7 +178,7 @@ export const Home: React.FC = ({
{/* Creative Services Grid */}
-
+
{services.map((service, index) => {
const gradientBorders = [
"border-pink-200/50",
@@ -211,7 +209,7 @@ export const Home: React.FC = ({
= ({
hover:scale-105 hover:shadow-xl
transition-all duration-300 ease-out
group-hover:bg-white/90 relative
- h-[200px]
+ h-[200px] w-full
`}
>
- {/* 创意图标 */}
+ {/* creative icon */}
= ({
`}
>
- {/* 服务标题 */}
+ {/* service title */}
{service.name}
- {/* 服务描述 */}
-
- {service.short_description || "探索精彩服务"}
+ {/* service description */}
+
+ {service.short_description ||
+ t("No description available")}
- {/* 装饰性元素 */}
+ {/* decorative elements */}
@@ -265,6 +264,8 @@ export const Home: React.FC = ({
@@ -317,6 +318,7 @@ export const Home: React.FC = ({
`}
)}
+
);
diff --git a/frontend/src/components/theme/creative/Navigation.tsx b/frontend/src/components/theme/creative/Navigation.tsx
index f7a6f52..18efda2 100644
--- a/frontend/src/components/theme/creative/Navigation.tsx
+++ b/frontend/src/components/theme/creative/Navigation.tsx
@@ -52,7 +52,12 @@ export const Navigation: React.FC = ({ items }) => {
{items?.map((item) => (
-
+
{t(item.label)}
))}
diff --git a/frontend/src/components/theme/modern/Detail.tsx b/frontend/src/components/theme/modern/Detail.tsx
index b7ff790..91a3e2f 100644
--- a/frontend/src/components/theme/modern/Detail.tsx
+++ b/frontend/src/components/theme/modern/Detail.tsx
@@ -2,13 +2,13 @@
import React, { useState } from "react";
import { useTranslation } from "@/shared/lib/useTranslation";
-import { Tabs, Tab, Chip, Card, CardBody } from "@nextui-org/react";
+import { Tabs, Tab, Chip, Card, CardBody, Button } from "@nextui-org/react";
import { ServiceData } from "@/shared/types/marketplace";
import { ProductHeader } from "@/shared/components/marketplace/ProductHeader";
import { ProductOverview } from "@/shared/components/marketplace/ProductOverview";
import { ProductTools } from "@/shared/components/marketplace/ProductTools";
import { ProductNotFound } from "@/shared/components/marketplace/ProductNotFound";
-import { Monitor, Code, Settings } from "lucide-react";
+import { Monitor, Code, Settings, Copy } from "lucide-react";
import { Navigation } from "./Navigation";
import { Footer } from "./Footer";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
@@ -24,6 +24,7 @@ interface DetailProps {
mcpName?: string;
// navigation items
navItems?: NavigationItem[];
+ onCopy: () => void;
}
export const Detail: React.FC = ({
@@ -32,6 +33,7 @@ export const Detail: React.FC = ({
url,
mcpName,
navItems = [],
+ onCopy,
}) => {
const { t } = useTranslation();
const [activeTab, setActiveTab] = useState("overview");
@@ -138,18 +140,26 @@ export const Detail: React.FC = ({
{/* Code Snippet */}
-
- {platformConfig?.name} MCP
-
+
+
+ {platformConfig?.name} MCP
+
+
+
{`{
"mcpServers": {
- "${mcpName || "xpack-mcp-market"}": {
+ "${mcpName}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey=`}
diff --git a/frontend/src/components/theme/modern/Home.tsx b/frontend/src/components/theme/modern/Home.tsx
index 84741bf..323efce 100644
--- a/frontend/src/components/theme/modern/Home.tsx
+++ b/frontend/src/components/theme/modern/Home.tsx
@@ -25,6 +25,7 @@ import {
import { Navigation } from "./Navigation";
import { Footer } from "./Footer";
import { NavigationItem } from "@/shared/components/Navigation";
+import { Faq } from "@/components/marketplace/Faq";
interface HomeProps {
// 状态
@@ -106,7 +107,7 @@ export const Home: React.FC = ({
{/* Modern Search Bar */}
-
+
= ({
- {/* Service List Section */}
- {loading ? (
-
-
-
-
-
- ) : (
-
-
- {/* Services Grid */}
-
- {services.map((service) => (
-
-
-
- {/* Header */}
-
-
-
-
-
-
-
- {service.name}
-
-
-
-
-
-
- {/* Description */}
-
- {service.short_description ||
- t("No description available")}
-
-
-
- {/* Footer */}
-
-
- {/* Tools count */}
-
-
-
- {t("{{count}} Tools", {
- count: service.tools.length,
- })}
-
-
-
- {/* Price */}
-
-
-
-
-
-
-
- ))}
+
+ {/* Service List Section */}
+ {loading ? (
+
+
+
-
- {/* Pagination */}
- {totalPages > 1 && (
-
-
-
- )}
-
- )}
+ ) : (
+
+
+ {/* Services Grid */}
+
+ {services.map((service) => (
+
+
+
+ {/* Header */}
+
+
+
+
+
+
+
+ {service.name}
+
+
+
+
+
+
+ {/* Description */}
+
+ {service.short_description ||
+ t("No description available")}
+
+
+
+ {/* Footer */}
+
+
+ {/* Tools count */}
+
+
+
+ {t("{{count}} Tools", {
+ count: service.tools.length,
+ })}
+
+
+
+ {/* Price */}
+
+
+
+
+
+
+
+ ))}
+
+
+ {/* Pagination */}
+ {totalPages > 1 && (
+
+
+
+ )}
+
+
+ )}
+
+
diff --git a/frontend/src/components/theme/modern/Navigation.tsx b/frontend/src/components/theme/modern/Navigation.tsx
index a0f8eca..e2288be 100644
--- a/frontend/src/components/theme/modern/Navigation.tsx
+++ b/frontend/src/components/theme/modern/Navigation.tsx
@@ -48,7 +48,12 @@ export const Navigation: React.FC = ({ items }) => {
{items?.map((item) => (
-
+
{t(item.label)}
))}
diff --git a/frontend/src/components/theme/temu/Detail.tsx b/frontend/src/components/theme/temu/Detail.tsx
index e8ad3ba..d93d628 100644
--- a/frontend/src/components/theme/temu/Detail.tsx
+++ b/frontend/src/components/theme/temu/Detail.tsx
@@ -2,13 +2,12 @@
import React, { useState } from "react";
import { useTranslation } from "@/shared/lib/useTranslation";
-import { Tabs, Tab, Chip, Card, CardBody } from "@nextui-org/react";
+import { Tabs, Tab, Chip, Card, CardBody, Button } from "@nextui-org/react";
import { ServiceData } from "@/shared/types/marketplace";
import { ProductHeader } from "@/shared/components/marketplace/ProductHeader";
import { ProductOverview } from "@/shared/components/marketplace/ProductOverview";
-import { ProductTools } from "@/shared/components/marketplace/ProductTools";
import { ProductNotFound } from "@/shared/components/marketplace/ProductNotFound";
-import { FileText, Wrench, Cog } from "lucide-react";
+import { FileText, Wrench, Cog, Copy } from "lucide-react";
import { Navigation } from "./Navigation";
import { Footer } from "./Footer";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
@@ -24,6 +23,7 @@ interface DetailProps {
mcpName?: string;
// navigation items
navItems?: NavigationItem[];
+ onCopy: () => void;
}
export const Detail: React.FC = ({
@@ -32,6 +32,7 @@ export const Detail: React.FC = ({
url,
mcpName,
navItems = [],
+ onCopy,
}) => {
const { t } = useTranslation();
const [activeTab, setActiveTab] = useState("overview");
@@ -159,18 +160,26 @@ export const Detail: React.FC = ({
{/* Code Snippet */}
-
- {platformConfig?.name} MCP
-
+
+
+ {platformConfig?.name} MCP
+
+
+
{`{
"mcpServers": {
- "${mcpName || "xpack-mcp-market"}": {
+ "${mcpName}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey=`}
diff --git a/frontend/src/components/theme/temu/Home.tsx b/frontend/src/components/theme/temu/Home.tsx
index f1c301a..e530cf8 100644
--- a/frontend/src/components/theme/temu/Home.tsx
+++ b/frontend/src/components/theme/temu/Home.tsx
@@ -22,6 +22,7 @@ import {
import { Footer } from "./Footer";
import { Navigation } from "./Navigation";
import { NavigationItem } from "@/shared/components/Navigation";
+import { Faq } from "@/components/marketplace/Faq";
interface HomeProps {
// 状态
@@ -188,6 +189,8 @@ export const Home: React.FC = ({
@@ -212,6 +215,7 @@ export const Home: React.FC = ({
)}
>
)}
+
diff --git a/frontend/src/components/theme/temu/Navigation.tsx b/frontend/src/components/theme/temu/Navigation.tsx
index 6d8952f..1e1aea7 100644
--- a/frontend/src/components/theme/temu/Navigation.tsx
+++ b/frontend/src/components/theme/temu/Navigation.tsx
@@ -52,7 +52,9 @@ export const Navigation: React.FC = ({ items }) => {
{items?.map((item) => (
{t(item.label)}
diff --git a/frontend/src/components/user-management/AdminRechargeModal.tsx b/frontend/src/components/user-management/AdminRechargeModal.tsx
new file mode 100644
index 0000000..957b80b
--- /dev/null
+++ b/frontend/src/components/user-management/AdminRechargeModal.tsx
@@ -0,0 +1,131 @@
+import React, { useState } from "react";
+import {
+ Modal,
+ ModalContent,
+ ModalHeader,
+ ModalBody,
+ ModalFooter,
+ Button,
+ Input,
+} from "@nextui-org/react";
+import { useTranslation } from "@/shared/lib/useTranslation";
+import { User } from "@/types/user";
+
+interface AdminRechargeModalProps {
+ isOpen: boolean;
+ onClose: () => void;
+ user: User | null;
+ onRecharge: (id: string, amount: number) => Promise;
+}
+
+export const AdminRechargeModal: React.FC = ({
+ isOpen,
+ onClose,
+ user,
+ onRecharge,
+}) => {
+ const { t } = useTranslation();
+ const [amount, setAmount] = useState("");
+ const [error, setError] = useState("");
+ const [loading, setLoading] = useState(false);
+
+ const handleAmountChange = (e: React.ChangeEvent) => {
+ const value = e.target.value;
+ // 只允许输入数字和小数点
+ if (/^\d*\.?\d*$/.test(value) || value === "") {
+ setAmount(value);
+ setError("");
+ }
+ };
+
+ const handleRecharge = async () => {
+ const numAmount = parseFloat(amount);
+ if (isNaN(numAmount) || numAmount <= 0) {
+ setError(t("Please enter a valid amount"));
+ return;
+ }
+
+ if (numAmount < 1) {
+ setError(t("Minimum recharge amount is $1"));
+ return;
+ }
+
+ if (!user) {
+ setError(t("User not selected"));
+ return;
+ }
+
+ setLoading(true);
+ try {
+ const success = await onRecharge(user.id, numAmount);
+
+ if (success) {
+ handleClose();
+ }
+ } catch (error) {
+ setError(t("Network error, please try again"));
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const handleClose = () => {
+ setAmount("");
+ setError("");
+ onClose();
+ };
+
+ return (
+
+
+ {() => (
+ <>
+
+ {t("Recharge User")}
+
+
+ {user && (
+
+
+ {t("User")}: {user.email}
+
+
+ {t("Current Balance")}: ${user.balance.toFixed(2)}
+
+
+ )}
+
+ $
+
+ }
+ isInvalid={!!error}
+ errorMessage={error}
+ type="number"
+ />
+
+
+
+
+
+ >
+ )}
+
+
+ );
+};
diff --git a/frontend/src/components/user-management/UserManagement.tsx b/frontend/src/components/user-management/UserManagement.tsx
index 31108f5..11e8907 100644
--- a/frontend/src/components/user-management/UserManagement.tsx
+++ b/frontend/src/components/user-management/UserManagement.tsx
@@ -12,8 +12,14 @@ const UserManagement: React.FC = () => {
const { t } = useTranslation();
// use custom hook to manage user data
- const { users, loading, pagination, handleDeleteUser, setPage } =
- useUserManagement();
+ const {
+ users,
+ loading,
+ pagination,
+ handleDeleteUser,
+ setPage,
+ handleRechargeUser,
+ } = useUserManagement();
// Modal states
const [deleteModal, setDeleteModal] = useState({
@@ -47,6 +53,13 @@ const UserManagement: React.FC = () => {
setDeleteModal({ isOpen: false, user: null });
}, []);
+ const handleRecharge = useCallback(
+ async (id: string, amount: number): Promise => {
+ return await handleRechargeUser(id, amount);
+ },
+ [handleRechargeUser]
+ );
+
return (
{
users={users}
loading={loading}
onDelete={handleDeleteUserClick}
+ onRecharge={handleRecharge}
pagination={pagination}
onPageChange={setPage}
/>
diff --git a/frontend/src/components/user-management/UserTable.tsx b/frontend/src/components/user-management/UserTable.tsx
index 7bb185a..031f918 100644
--- a/frontend/src/components/user-management/UserTable.tsx
+++ b/frontend/src/components/user-management/UserTable.tsx
@@ -1,6 +1,6 @@
"use client";
-import React from 'react';
+import React from "react";
import {
Table,
TableHeader,
@@ -11,16 +11,18 @@ import {
Button,
Pagination,
Tooltip,
- Spinner
-} from '@nextui-org/react';
-import { useTranslation } from '@/shared/lib/useTranslation';
-import { User } from '@/types/user';
-import { Trash2 } from 'lucide-react';
+ Spinner,
+} from "@nextui-org/react";
+import { useTranslation } from "@/shared/lib/useTranslation";
+import { User } from "@/types/user";
+import { Trash2, CreditCard } from "lucide-react";
+import { AdminRechargeModal } from "@/components/user-management/AdminRechargeModal";
interface UserTableProps {
users: User[];
loading?: boolean;
onDelete: (user: User) => void;
+ onRecharge: (id: string, amount: number) => Promise;
pagination: {
page: number;
pageSize: number;
@@ -33,6 +35,7 @@ export const UserTable: React.FC = ({
users,
loading = false,
onDelete,
+ onRecharge,
pagination,
onPageChange,
}) => {
@@ -45,10 +48,25 @@ export const UserTable: React.FC = ({
// 直接显示传入的用户数据(已经是当前页的数据)
const items = users;
+ const [isRechargeModalOpen, setIsRechargeModalOpen] = React.useState(false);
+ const [selectedUser, setSelectedUser] = React.useState(null);
- const handleDelete = React.useCallback((user: User) => {
- onDelete(user);
- }, [onDelete]);
+ const handleDelete = React.useCallback(
+ (user: User) => {
+ onDelete(user);
+ },
+ [onDelete]
+ );
+
+ const handleRecharge = React.useCallback((user: User) => {
+ setSelectedUser(user);
+ setIsRechargeModalOpen(true);
+ }, []);
+
+ const handleRechargeClose = React.useCallback(() => {
+ setIsRechargeModalOpen(false);
+ setSelectedUser(null);
+ }, []);
if (loading && users.length === 0) {
return (
@@ -68,33 +86,50 @@ export const UserTable: React.FC = ({
removeWrapper
>
- {t('Email')}
- {t('Register Date')}
- {t('Balance')}
- {t('Actions')}
+ {t("Email")}
+ {t("Register Date")}
+ {t("Balance")}
+ {t("Actions")}
}
- emptyContent={t('No users found')}
+ emptyContent={t("No users found")}
>
{(user) => (
{user.email}
-
- {user.created_at || '-'}
-
-
- {user.balance.toFixed(2) || "-"}
-
+ {user.created_at || "-"}
+ {user.balance.toFixed(2) || "-"}
+
+
+
-
+
)}
+
+ {/* Admin Recharge Modal */}
+
);
-};
\ No newline at end of file
+};
diff --git a/frontend/src/hooks/useHomepageConfigManagement.ts b/frontend/src/hooks/useHomepageConfigManagement.ts
new file mode 100644
index 0000000..91174cf
--- /dev/null
+++ b/frontend/src/hooks/useHomepageConfigManagement.ts
@@ -0,0 +1,119 @@
+import { useState, useCallback, useEffect } from "react";
+import { HomepageConfig } from "@/services/homepageConfigService";
+import {
+ FaqItem,
+ TopNavigationItem,
+ EmbeddedHtmlConfig,
+} from "@/shared/types/system";
+import { homepageConfigService } from "@/services/homepageConfigService";
+import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
+import { revalidatePlatformConfig } from "@/app/actions/revalidate";
+
+export const useHomepageConfigManagement = () => {
+ const { updateClientConfig } = usePlatformConfig();
+
+ // homepage config state
+ const [homepageConfig, setHomepageConfig] = useState({
+ faq: [],
+ top_navigation: [],
+ embeded_html: {
+ is_enabled: false,
+ html: "",
+ },
+ });
+ const [loading, setLoading] = useState(false);
+ const [error, setError] = useState(null);
+
+ // load homepage config
+ const loadHomepageConfig = useCallback(async () => {
+ setLoading(true);
+ setError(null);
+ try {
+ const config = await homepageConfigService.getHomepageConfig();
+ setHomepageConfig(config);
+ } catch (err) {
+ const errorMessage =
+ err instanceof Error ? err.message : "Failed to load homepage config";
+ setError(errorMessage);
+ console.error("Failed to load homepage config:", err);
+ } finally {
+ setLoading(false);
+ }
+ }, []);
+
+ // save homepage config
+ const saveHomepageConfig = useCallback(
+ async (config: {
+ faq?: FaqItem[];
+ top_navigation?: TopNavigationItem[];
+ embeded_html?: EmbeddedHtmlConfig;
+ }): Promise => {
+ setLoading(true);
+ setError(null);
+ try {
+ const result = await homepageConfigService.updateHomepageConfig(config);
+ if (result) {
+ updateClientConfig(config);
+ await revalidatePlatformConfig();
+ }
+ return result;
+ } catch (err) {
+ const errorMessage =
+ err instanceof Error ? err.message : "Failed to save homepage config";
+ setError(errorMessage);
+ console.error("Failed to save homepage config:", err);
+ return false;
+ } finally {
+ setLoading(false);
+ }
+ },
+ []
+ );
+
+ // save FAQ data
+ const saveFaqConfig = useCallback(
+ async (faqs: FaqItem[]): Promise => {
+ return await saveHomepageConfig({ faq: faqs });
+ },
+ [saveHomepageConfig]
+ );
+
+ // save navigation data
+ const saveNavigationConfig = useCallback(
+ async (navigationItems: TopNavigationItem[]): Promise => {
+ return await saveHomepageConfig({ top_navigation: navigationItems });
+ },
+ [saveHomepageConfig]
+ );
+
+ // save embedded HTML data
+ const saveEmbeddedHtmlConfig = useCallback(
+ async (htmlData: EmbeddedHtmlConfig): Promise => {
+ return await saveHomepageConfig({ embeded_html: htmlData });
+ },
+ [saveHomepageConfig]
+ );
+
+ // clear error
+ const clearError = useCallback(() => setError(null), []);
+
+ // load config on init
+ useEffect(() => {
+ loadHomepageConfig();
+ }, [loadHomepageConfig]);
+
+ return {
+ // state
+ homepageConfig,
+ loading,
+ error,
+
+ // actions
+ loadHomepageConfig,
+ saveHomepageConfig,
+ saveFaqConfig,
+ saveNavigationConfig,
+ saveEmbeddedHtmlConfig,
+ clearError,
+ };
+};
diff --git a/frontend/src/hooks/usePaymentChannelManagement.ts b/frontend/src/hooks/usePaymentChannelManagement.ts
index 579ef86..2ad7167 100644
--- a/frontend/src/hooks/usePaymentChannelManagement.ts
+++ b/frontend/src/hooks/usePaymentChannelManagement.ts
@@ -2,22 +2,41 @@ import { useState, useEffect, useCallback } from "react";
import {
PaymentChannelApiItem,
StripeConfig,
+ AlipayConfig,
+ WechatConfig,
PaymentChannelTestResult,
} from "@/types/payment";
import { paymentChannelService } from "@/services/paymentChannelService";
+import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
+import { revalidatePlatformConfig } from "@/app/actions/revalidate";
export const usePaymentChannelManagement = () => {
+ const { updateClientConfig, paymentChannels } = usePlatformConfig();
const [channels, setChannels] = useState([]);
const [stripeConfig, setStripeConfig] = useState({
secret: "",
webhook_secret: "",
+ is_enabled: false,
+ });
+ const [alipayConfig, setAlipayConfig] = useState({
+ app_id: "",
+ app_private_key: "",
+ alipay_public_key: "",
+ is_enabled: false,
+ });
+ const [wechatConfig, setWechatConfig] = useState({
+ app_id: "",
+ mch_id: "",
+ is_enabled: false,
});
const [loading, setLoading] = useState(false);
const [error, setError] = useState(null);
const [testResult, setTestResult] = useState(
null
);
- const [isSaving, setIsSaving] = useState(false);
+ const [isWechatSaving, setIsWechatSaving] = useState(false);
+ const [isStripeSaving, setIsStripeSaving] = useState(false);
+ const [isAlipaySaving, setIsAlipaySaving] = useState(false);
// get payment channel list
const fetchChannels = useCallback(async () => {
@@ -29,12 +48,35 @@ export const usePaymentChannelManagement = () => {
setChannels(response.data);
- // find stripe channel and get config
+ // find channels and get configs
const stripeChannel = response.data.find(
(channel) => channel.id === "stripe"
);
if (stripeChannel) {
- setStripeConfig(stripeChannel.config);
+ setStripeConfig({
+ ...stripeChannel.config,
+ is_enabled: stripeChannel.is_enabled,
+ } as StripeConfig);
+ }
+
+ const alipayChannel = response.data.find(
+ (channel) => channel.id === "alipay"
+ );
+ if (alipayChannel) {
+ setAlipayConfig({
+ ...alipayChannel.config,
+ is_enabled: alipayChannel.is_enabled,
+ } as AlipayConfig);
+ }
+
+ const wechatChannel = response.data.find(
+ (channel) => channel.id === "wechat"
+ );
+ if (wechatChannel) {
+ setWechatConfig({
+ ...wechatChannel.config,
+ is_enabled: wechatChannel.is_enabled,
+ } as WechatConfig);
}
} catch (err) {
setError(
@@ -48,9 +90,103 @@ export const usePaymentChannelManagement = () => {
}
}, []);
+ // test alipay connection
+ const testAlipayConnection = useCallback(async (config: AlipayConfig) => {
+ setLoading(true);
+ setError(null);
+
+ try {
+ const result = await paymentChannelService.testAlipayConnection(config);
+ setTestResult(result);
+ return result;
+ } catch (err) {
+ const errorMessage =
+ err instanceof Error ? err.message : "Failed to test alipay connection";
+ const failedResult: PaymentChannelTestResult = {
+ success: false,
+ message: errorMessage,
+ };
+ setTestResult(failedResult);
+ setError(errorMessage);
+ return failedResult;
+ } finally {
+ setLoading(false);
+ }
+ }, []);
+
+ // test wechat connection
+ const testWechatConnection = useCallback(async (config: WechatConfig) => {
+ setLoading(true);
+ setError(null);
+
+ try {
+ const result = await paymentChannelService.testWechatConnection(config);
+ setTestResult(result);
+ return result;
+ } catch (err) {
+ const errorMessage =
+ err instanceof Error ? err.message : "Failed to test wechat connection";
+ const failedResult: PaymentChannelTestResult = {
+ success: false,
+ message: errorMessage,
+ };
+ setTestResult(failedResult);
+ setError(errorMessage);
+ return failedResult;
+ } finally {
+ setLoading(false);
+ }
+ }, []);
+
+ // save alipay config
+ const saveAlipayConfig = useCallback(async (config: AlipayConfig) => {
+ setIsAlipaySaving(true);
+ setError(null);
+
+ try {
+ const result = await paymentChannelService.saveAlipayConfig(config);
+ if (result) {
+ setAlipayConfig(config);
+ return true;
+ } else {
+ return false;
+ }
+ } catch (err) {
+ const errorMessage =
+ err instanceof Error ? err.message : "Failed to save alipay config";
+ setError(errorMessage);
+ return false;
+ } finally {
+ setIsAlipaySaving(false);
+ }
+ }, []);
+
+ // save wechat config
+ const saveWechatConfig = useCallback(async (config: WechatConfig) => {
+ setIsWechatSaving(true);
+ setError(null);
+
+ try {
+ const result = await paymentChannelService.saveWechatConfig(config);
+ if (result) {
+ setWechatConfig(config);
+ return true;
+ } else {
+ return false;
+ }
+ } catch (err) {
+ const errorMessage =
+ err instanceof Error ? err.message : "Failed to save wechat config";
+ setError(errorMessage);
+ return false;
+ } finally {
+ setIsWechatSaving(false);
+ }
+ }, []);
+
// save stripe config
const saveStripeConfig = useCallback(async (config: StripeConfig) => {
- setIsSaving(true);
+ setIsStripeSaving(true);
setError(null);
try {
@@ -67,7 +203,7 @@ export const usePaymentChannelManagement = () => {
setError(errorMessage);
return false;
} finally {
- setIsSaving(false);
+ setIsStripeSaving(false);
}
}, []);
@@ -102,16 +238,25 @@ export const usePaymentChannelManagement = () => {
setError(null);
try {
- await paymentChannelService.enablePaymentChannel(channelId);
- await fetchChannels(); // re-fetch list
- return { success: true };
+ const result =
+ await paymentChannelService.enablePaymentChannel(channelId);
+ if (result) {
+ updateClientConfig({
+ payment_channels: [
+ ...paymentChannels,
+ { id: channelId, name: channelId },
+ ],
+ });
+ await revalidatePlatformConfig();
+ }
+ return result;
} catch (err) {
const errorMessage =
err instanceof Error
? err.message
: "Failed to enable payment channel";
setError(errorMessage);
- return { success: false, message: errorMessage };
+ return false;
} finally {
setLoading(false);
}
@@ -126,16 +271,24 @@ export const usePaymentChannelManagement = () => {
setError(null);
try {
- await paymentChannelService.disablePaymentChannel(channelId);
- await fetchChannels(); // re-fetch list
- return { success: true };
+ const result =
+ await paymentChannelService.disablePaymentChannel(channelId);
+ if (result) {
+ updateClientConfig({
+ payment_channels: paymentChannels.filter(
+ (channel) => channel.id !== channelId
+ ),
+ });
+ await revalidatePlatformConfig();
+ }
+ return result;
} catch (err) {
const errorMessage =
err instanceof Error
? err.message
: "Failed to disable payment channel";
setError(errorMessage);
- return { success: false, message: errorMessage };
+ return false;
} finally {
setLoading(false);
}
@@ -161,13 +314,21 @@ export const usePaymentChannelManagement = () => {
return {
channels,
stripeConfig,
- isSaving,
+ alipayConfig,
+ wechatConfig,
+ isWechatSaving,
+ isStripeSaving,
+ isAlipaySaving,
loading,
error,
testResult,
fetchChannels,
saveStripeConfig,
+ saveAlipayConfig,
+ saveWechatConfig,
testStripeConnection,
+ testAlipayConnection,
+ testWechatConnection,
enableChannel,
disableChannel,
clearTestResult,
diff --git a/frontend/src/hooks/useSystemConfigManagement.ts b/frontend/src/hooks/useSystemConfigManagement.ts
index 187e5b9..64d250d 100644
--- a/frontend/src/hooks/useSystemConfigManagement.ts
+++ b/frontend/src/hooks/useSystemConfigManagement.ts
@@ -1,5 +1,13 @@
import { useState, useCallback, useEffect } from "react";
-import { PlatformConfig, LoginConfig, EmailMode } from "@/shared/types/system";
+import {
+ PlatformConfig,
+ LoginConfig,
+ EmailMode,
+ FaqItem,
+ TopNavigationItem,
+ EmbeddedHtmlConfig,
+ PaymentChannel
+} from "@/shared/types/system";
import { systemConfigService } from "@/services/systemConfigService";
import { AdminConfig, EmailConfig } from "@/types/system";
import { md5Encrypt } from "@/shared/utils/crypto";
@@ -49,6 +57,29 @@ export const useSystemConfigManagement = () => {
const [loginLoading, setLoginLoading] = useState(false);
const [loginError, setLoginError] = useState(null);
+ // faq config
+ const [faqItems, setFaqItems] = useState([]);
+ const [faqLoading, setFaqLoading] = useState(false);
+ const [faqError, setFaqError] = useState(null);
+
+ // top navigation config
+ const [topNavigation, setTopNavigation] = useState([]);
+ const [navigationLoading, setNavigationLoading] = useState(false);
+ const [navigationError, setNavigationError] = useState(null);
+
+ // embedded html config
+ const [embeddedHtml, setEmbeddedHtml] = useState(null);
+ const [embeddedHtmlLoading, setEmbeddedHtmlLoading] = useState(false);
+ const [embeddedHtmlError, setEmbeddedHtmlError] = useState(null);
+
+ // payment channels config
+ const [paymentChannels, setPaymentChannels] = useState([]);
+ const [paymentLoading, setPaymentLoading] = useState(false);
+ const [paymentError, setPaymentError] = useState(null);
+
+ // installation status
+ const [isInstalled, setIsInstalled] = useState(false);
+
// global loading
const [isLoading, setIsLoading] = useState(false);
@@ -80,6 +111,11 @@ export const useSystemConfigManagement = () => {
mode: EmailMode.PASSWORD,
},
});
+ setFaqItems(response.faq || []);
+ setTopNavigation(response.top_navigation || []);
+ setEmbeddedHtml(response.embeded_html || null);
+ setPaymentChannels(response.payment_channels || []);
+ setIsInstalled(response.is_installed || false);
} catch (error) {
console.error("Failed to load configurations:", error);
} finally {
@@ -160,11 +196,71 @@ export const useSystemConfigManagement = () => {
return result;
}, []);
+ // save faq config
+ const saveFaqConfig = useCallback(async (items: FaqItem[]) => {
+ setFaqLoading(true);
+ setFaqError(null);
+ const result = await systemConfigService.updateSystemConfig({
+ faq: items,
+ }, "faq");
+ if (result) {
+ setFaqItems(items);
+ }
+ setFaqLoading(false);
+ return result;
+ }, []);
+
+ // save top navigation config
+ const saveTopNavigationConfig = useCallback(async (items: TopNavigationItem[]) => {
+ setNavigationLoading(true);
+ setNavigationError(null);
+ const result = await systemConfigService.updateSystemConfig({
+ top_navigation: items,
+ }, "navigation");
+ if (result) {
+ setTopNavigation(items);
+ }
+ setNavigationLoading(false);
+ return result;
+ }, []);
+
+ // save embedded html config
+ const saveEmbeddedHtmlConfig = useCallback(async (config: EmbeddedHtmlConfig) => {
+ setEmbeddedHtmlLoading(true);
+ setEmbeddedHtmlError(null);
+ const result = await systemConfigService.updateSystemConfig({
+ embeded_html: config,
+ }, "embedded_html");
+ if (result) {
+ setEmbeddedHtml(config);
+ }
+ setEmbeddedHtmlLoading(false);
+ return result;
+ }, []);
+
+ // save payment channels config
+ const savePaymentChannelsConfig = useCallback(async (channels: PaymentChannel[]) => {
+ setPaymentLoading(true);
+ setPaymentError(null);
+ const result = await systemConfigService.updateSystemConfig({
+ payment_channels: channels,
+ }, "payment");
+ if (result) {
+ setPaymentChannels(channels);
+ }
+ setPaymentLoading(false);
+ return result;
+ }, []);
+
// clear errors
const clearPlatformError = useCallback(() => setPlatformError(null), []);
const clearAdminError = useCallback(() => setAdminError(null), []);
const clearEmailError = useCallback(() => setEmailError(null), []);
const clearLoginError = useCallback(() => setLoginError(null), []);
+ const clearFaqError = useCallback(() => setFaqError(null), []);
+ const clearNavigationError = useCallback(() => setNavigationError(null), []);
+ const clearEmbeddedHtmlError = useCallback(() => setEmbeddedHtmlError(null), []);
+ const clearPaymentError = useCallback(() => setPaymentError(null), []);
// load configs on init
useEffect(() => {
@@ -217,6 +313,42 @@ export const useSystemConfigManagement = () => {
saveLoginConfig,
clearLoginError,
+ // faq config
+ faqItems,
+ setFaqItems,
+ faqLoading,
+ faqError,
+ saveFaqConfig,
+ clearFaqError,
+
+ // top navigation config
+ topNavigation,
+ setTopNavigation,
+ navigationLoading,
+ navigationError,
+ saveTopNavigationConfig,
+ clearNavigationError,
+
+ // embedded html config
+ embeddedHtml,
+ setEmbeddedHtml,
+ embeddedHtmlLoading,
+ embeddedHtmlError,
+ saveEmbeddedHtmlConfig,
+ clearEmbeddedHtmlError,
+
+ // payment channels config
+ paymentChannels,
+ setPaymentChannels,
+ paymentLoading,
+ paymentError,
+ savePaymentChannelsConfig,
+ clearPaymentError,
+
+ // installation status
+ isInstalled,
+ setIsInstalled,
+
// image upload
uploadImage,
diff --git a/frontend/src/hooks/useUserManagement.ts b/frontend/src/hooks/useUserManagement.ts
index 7bacf71..8c12b65 100644
--- a/frontend/src/hooks/useUserManagement.ts
+++ b/frontend/src/hooks/useUserManagement.ts
@@ -1,6 +1,6 @@
import { useState, useEffect, useCallback } from "react";
import { User } from "@/types/user";
-import { getUserList, deleteUser } from "@/services/userService";
+import { getUserList, deleteUser, rechargeUser } from "@/services/userService";
interface PaginationInfo {
page: number;
@@ -67,6 +67,28 @@ export const useUserManagement = () => {
},
[fetchUsers]
);
+ const handleRechargeUser = async (
+ userId: string,
+ amount: number
+ ): Promise => {
+ try {
+ const result = await rechargeUser(userId, amount);
+ if (result) {
+ // after recharge, fetch users again
+ setUsers((prevUsers: User[]) =>
+ prevUsers.map((user: User) =>
+ user.id === userId
+ ? { ...user, balance: user.balance + amount }
+ : user
+ )
+ );
+ return true;
+ }
+ } catch (err) {
+ setError(err instanceof Error ? err.message : "Recharge user failed");
+ }
+ return false;
+ };
const setSearch = useCallback((search: string) => {
setSearchQuery(search);
@@ -88,6 +110,7 @@ export const useUserManagement = () => {
return {
users,
+ handleRechargeUser,
loading,
error,
searchQuery,
diff --git a/frontend/src/services/homepageConfigService.ts b/frontend/src/services/homepageConfigService.ts
new file mode 100644
index 0000000..bc88ea6
--- /dev/null
+++ b/frontend/src/services/homepageConfigService.ts
@@ -0,0 +1,56 @@
+import { fetchAdminAPI } from "@/rpc/admin-api";
+import i18n from "@/shared/lib/i18n";
+import {
+ EmbeddedHtmlConfig,
+ FaqItem,
+ TopNavigationItem,
+} from "@/shared/types/system";
+import toast from "react-hot-toast";
+
+export interface HomepageConfig {
+ faq: FaqItem[];
+ top_navigation: TopNavigationItem[];
+ embeded_html: EmbeddedHtmlConfig;
+}
+
+export class HomepageConfigService {
+ // get homepage config
+ async getHomepageConfig(): Promise {
+ const response = await fetchAdminAPI(
+ "/api/sysconfig/homepage",
+ {
+ method: "GET",
+ }
+ );
+
+ if (!response.success) {
+ throw new Error(
+ response.error_message || "Failed to fetch homepage config"
+ );
+ }
+ return response.data;
+ }
+
+ // update homepage config
+ async updateHomepageConfig(config: {
+ faq?: FaqItem[];
+ top_navigation?: TopNavigationItem[];
+ embeded_html?: EmbeddedHtmlConfig;
+ }): Promise {
+ const response = await fetchAdminAPI("/api/sysconfig/homepage", {
+ method: "PUT",
+ body: config as unknown as BodyInit,
+ });
+
+ if (!response.success) {
+ toast.error(
+ response.error_message || i18n.t("Failed to update homepage config")
+ );
+ return false;
+ }
+ toast.success(i18n.t("Homepage config updated successfully"));
+ return true;
+ }
+}
+
+export const homepageConfigService = new HomepageConfigService();
diff --git a/frontend/src/services/paymentChannelService.ts b/frontend/src/services/paymentChannelService.ts
index 313b177..484a298 100644
--- a/frontend/src/services/paymentChannelService.ts
+++ b/frontend/src/services/paymentChannelService.ts
@@ -1,5 +1,7 @@
import {
StripeConfig,
+ AlipayConfig,
+ WechatConfig,
PaymentChannelApiItem,
PaymentChannelListResponse,
PaymentChannelTestResult,
@@ -52,50 +54,74 @@ export class PaymentChannelService {
return response.data;
}
- // Save Stripe configuration
- async saveStripeConfig(config: StripeConfig): Promise {
- const response = await fetchAdminAPI(
- "/api/payment_channel/info",
- {
- method: "PUT",
- body: {
- id: "stripe",
- config: config,
- } as unknown as BodyInit,
- }
- );
+ // Generic method to save payment channel configuration
+ async savePaymentChannelConfig(
+ channelId: string,
+ config: T,
+ channelName: string
+ ): Promise {
+ const response = await fetchAdminAPI("/api/payment_channel/info", {
+ method: "PUT",
+ body: {
+ id: channelId,
+ config: {
+ ...config,
+ is_enabled: undefined,
+ },
+ } as unknown as BodyInit,
+ });
if (!response.success) {
toast.error(
- response.error_message || i18n.t("Failed to save Stripe config")
+ response.error_message ||
+ i18n.t("Failed to save {{channelName}} config", { channelName })
);
return false;
}
- toast.success(i18n.t("Stripe config saved successfully"));
+ toast.success(
+ i18n.t("{{channelName}} config saved successfully", { channelName })
+ );
return true;
}
- // Test Stripe connection
- async testStripeConnection(
- config: StripeConfig
+ // Save Stripe configuration
+ async saveStripeConfig(config: StripeConfig): Promise {
+ return this.savePaymentChannelConfig("stripe", config, "Stripe");
+ }
+
+ // Generic method to test payment channel connection
+ async testPaymentChannelConnection(
+ channelId: string,
+ config: T,
+ channelName: string
): Promise {
try {
- const response = await fetchAdminAPI("/api/payment_channel/info", {
- method: "PUT",
- body: JSON.stringify(config),
+ const response = await fetchAdminAPI("/api/payment_channel/test", {
+ method: "POST",
+ body: {
+ id: channelId,
+ config: {
+ ...config,
+ is_enabled: undefined,
+ },
+ } as unknown as BodyInit,
});
if (!response.success) {
return {
success: false,
- message: response.error_message || "Stripe connection test failed",
+ message:
+ response.error_message ||
+ i18n.t("{{channelName}} connection test failed", { channelName }),
details: response.data,
};
}
return {
success: true,
- message: "Stripe connection test successful",
+ message: i18n.t("{{channelName}} connection test successful", {
+ channelName,
+ }),
details: response.data,
};
} catch (error) {
@@ -106,36 +132,73 @@ export class PaymentChannelService {
}
}
+ // Test Stripe connection
+ async testStripeConnection(
+ config: StripeConfig
+ ): Promise {
+ return this.testPaymentChannelConnection("stripe", config, "Stripe");
+ }
+
// enable payment channel
- async enablePaymentChannel(id: string): Promise {
+ async enablePaymentChannel(id: string): Promise {
const response = await fetchAdminAPI("/api/payment_channel/enable", {
- method: "POST",
+ method: "PUT",
body: {
id,
} as unknown as BodyInit,
});
if (!response.success) {
- throw new Error(
- response.error_message || "Failed to enable payment channel"
+ toast.error(
+ response.error_message || i18n.t("Failed to enable payment channel")
);
+ return false;
}
+ toast.success(i18n.t("Payment channel enabled successfully"));
+ return true;
}
// disable payment channel
- async disablePaymentChannel(id: string): Promise {
+ async disablePaymentChannel(id: string): Promise {
const response = await fetchAdminAPI("/api/payment_channel/disable", {
- method: "POST",
+ method: "PUT",
body: {
id,
} as unknown as BodyInit,
});
if (!response.success) {
- throw new Error(
- response.error_message || "Failed to disable payment channel"
+ toast.error(
+ response.error_message || i18n.t("Failed to disable payment channel")
);
+ return false;
}
+ toast.success(i18n.t("Payment channel disabled successfully"));
+ return true;
+ }
+
+ // Save Alipay configuration
+ async saveAlipayConfig(config: AlipayConfig): Promise {
+ return this.savePaymentChannelConfig("alipay", config, "Alipay");
+ }
+
+ // Save WeChat configuration
+ async saveWechatConfig(config: WechatConfig): Promise {
+ return this.savePaymentChannelConfig("wechat", config, "WeChat");
+ }
+
+ // Test Alipay connection
+ async testAlipayConnection(
+ config: AlipayConfig
+ ): Promise {
+ return this.testPaymentChannelConnection("alipay", config, "Alipay");
+ }
+
+ // Test WeChat connection
+ async testWechatConnection(
+ config: WechatConfig
+ ): Promise {
+ return this.testPaymentChannelConnection("wechat", config, "WeChat");
}
// validate stripe config
diff --git a/frontend/src/services/platformConfigService.ts b/frontend/src/services/platformConfigService.ts
index d7eae21..56c5aa6 100644
--- a/frontend/src/services/platformConfigService.ts
+++ b/frontend/src/services/platformConfigService.ts
@@ -37,10 +37,26 @@ export class PlatformConfigService {
console.error(response.error_message);
return {
platform: _DefaultPlatformConfig,
+ login: undefined,
+ faq: [],
+ top_navigation: [],
+ embeded_html: undefined,
+ payment_channels: [],
+ is_installed: false,
};
}
- return response.data;
+ // 确保返回的数据结构正确
+ const data = response.data;
+ return {
+ platform: data.platform || _DefaultPlatformConfig,
+ login: data.login,
+ faq: data.faq || [],
+ top_navigation: data.top_navigation || [],
+ embeded_html: data.embeded_html,
+ payment_channels: data.payment_channels || [],
+ is_installed: data.is_installed || false,
+ };
}
}
diff --git a/frontend/src/services/systemConfigService.ts b/frontend/src/services/systemConfigService.ts
index bd27320..de43170 100644
--- a/frontend/src/services/systemConfigService.ts
+++ b/frontend/src/services/systemConfigService.ts
@@ -1,6 +1,13 @@
import { fetchAdminAPI } from "@/rpc/admin-api";
import i18n from "@/shared/lib/i18n";
-import { PlatformConfig, LoginConfig } from "@/shared/types/system";
+import {
+ PlatformConfig,
+ LoginConfig,
+ FaqItem,
+ TopNavigationItem,
+ EmbeddedHtmlConfig,
+ PaymentChannel
+} from "@/shared/types/system";
import { AdminConfig, EmailConfig, SystemConfigApiData } from "@/types/system";
import toast from "react-hot-toast";
@@ -29,8 +36,13 @@ export class SystemConfigService {
account?: AdminConfig;
email?: EmailConfig;
login?: LoginConfig;
+ faq?: FaqItem[];
+ top_navigation?: TopNavigationItem[];
+ embeded_html?: EmbeddedHtmlConfig;
+ payment_channels?: PaymentChannel[];
+ is_installed?: boolean;
},
- key?: "theme" | "about"
+ key?: "theme" | "about" | "faq" | "navigation" | "embedded_html" | "payment"
): Promise {
const response = await fetchAdminAPI("/api/sysconfig/info", {
method: "PUT",
@@ -50,6 +62,18 @@ export class SystemConfigService {
case "about":
toast.success(i18n.t("About page saved successfully"));
break;
+ case "faq":
+ toast.success(i18n.t("FAQ updated successfully"));
+ break;
+ case "navigation":
+ toast.success(i18n.t("Navigation updated successfully"));
+ break;
+ case "embedded_html":
+ toast.success(i18n.t("Embedded HTML updated successfully"));
+ break;
+ case "payment":
+ toast.success(i18n.t("Payment channels updated successfully"));
+ break;
default: {
toast.success(i18n.t("System config updated successfully"));
break;
diff --git a/frontend/src/services/userService.ts b/frontend/src/services/userService.ts
index 4db7f0f..32af8b2 100644
--- a/frontend/src/services/userService.ts
+++ b/frontend/src/services/userService.ts
@@ -3,6 +3,7 @@ import { User } from "@/types/user";
import { fetchAdminAPI } from "@/rpc/admin-api";
import toast from "react-hot-toast";
import i18n from "@/shared/lib/i18n";
+import { md5Encrypt, sha256Encrypt } from "@/shared/utils/crypto";
// user list API response interface (according to API document xpack-response-array format)
export interface UserListApiResponse extends ApiArrayResponse {}
@@ -63,3 +64,42 @@ export const deleteUser = async (userId: string): Promise => {
toast.success(i18n.t("User deleted successfully"));
return true;
};
+
+/**
+ * recharge user balance
+ */
+export const rechargeUser = async (
+ userId: string,
+ amount: number
+): Promise => {
+ // Create request body
+ const body = {
+ user_id: userId,
+ balance: amount,
+ type: "incr",
+ };
+
+ // Generate timestamp
+ const timestamp = Date.now().toString();
+
+ // Generate signature: sha256(md5((x-xpack-timestamp){body}))
+ // For this implementation, we're using a simplified approach
+ // In a real implementation, you would use actual crypto functions
+ const bodyString = JSON.stringify(body);
+ const signature = sha256Encrypt(md5Encrypt(`${timestamp}${bodyString}`));
+ const response = await fetchAdminAPI(`/api/user_manager/balance/recharge`, {
+ method: "POST",
+ headers: {
+ "x-xpack-timestamp": timestamp,
+ "x-xpack-sign": signature,
+ },
+ body: body as unknown as BodyInit,
+ });
+
+ if (!response.success) {
+ toast.error(response.error_message || i18n.t("Failed to recharge user"));
+ return false;
+ }
+ toast.success(i18n.t("User recharged successfully"));
+ return true;
+};
diff --git a/frontend/src/shared/components/marketplace/Price.tsx b/frontend/src/shared/components/marketplace/Price.tsx
index 262aa65..5fb16aa 100644
--- a/frontend/src/shared/components/marketplace/Price.tsx
+++ b/frontend/src/shared/components/marketplace/Price.tsx
@@ -9,9 +9,16 @@ import React from "react";
interface PriceProps {
price?: string;
charge_type?: ChargeType;
+ input_token_price?: string;
+ output_token_price?: string;
}
-export const Price: React.FC = ({ price, charge_type }) => {
+export const Price: React.FC = ({
+ price,
+ charge_type,
+ input_token_price,
+ output_token_price,
+}) => {
const { t } = useTranslation();
if (!charge_type) {
return null;
@@ -37,13 +44,24 @@ export const Price: React.FC = ({ price, charge_type }) => {
);
} else {
+ const inputPrice = parseFloat(input_token_price || "0");
+ const outputPrice = parseFloat(output_token_price || "0");
return (
-
-
-
- ${priceText.toFixed(2)}
-
- /{t("token")}
+
+
+ {t("Input")}:
+
+ ${inputPrice.toFixed(2)}
+
+ /{t("1M tokens")}
+
+
+ {t("Output")}:
+
+ ${outputPrice.toFixed(2)}
+
+ /{t("1M tokens")}
+
);
}
diff --git a/frontend/src/shared/components/marketplace/ProductDetail.tsx b/frontend/src/shared/components/marketplace/ProductDetail.tsx
index 347bbfb..350b857 100644
--- a/frontend/src/shared/components/marketplace/ProductDetail.tsx
+++ b/frontend/src/shared/components/marketplace/ProductDetail.tsx
@@ -14,15 +14,17 @@ interface ProductDetailClientProps {
product: ServiceData;
breadcrumbs?: {
link: string;
- name: string
+ name: string;
}[];
mcpName?: string;
+ url?: string;
}
export const ProductDetailClient: React.FC = ({
product,
breadcrumbs,
- mcpName
+ mcpName,
+ url,
}) => {
const { t } = useTranslation();
@@ -30,52 +32,58 @@ export const ProductDetailClient: React.FC = ({
return (
- {product ? (<>
-
+ {product ? (
+ <>
+
-
- {/* Left side - Main content */}
-
- setActiveTab(key as string)}
- variant="underlined"
- color="primary"
- >
-
-
-
-
- {t("Tools")}
- {product.tools.length}
- }>
-
-
-
+
+ {/* Left side - Main content */}
+
+ setActiveTab(key as string)}
+ variant="underlined"
+ color="primary"
+ >
+
+
+
+
+ {t("Tools")}
+
+ {" "}
+ {product.tools.length}
+
+
+ }
+ >
+
+
+
+
+
+ {/* Right side - Server Config */}
+
- {/* Right side - Server Config */}
-
-
-
- {/* SEO-friendly: Simple text content for search engines */}
-
- >
- ) : ( )}
-
+ {/* SEO-friendly: Simple text content for search engines */}
+
+ >
+ ) : (
+
+ )}
);
};
diff --git a/frontend/src/shared/components/marketplace/ProductHeader.tsx b/frontend/src/shared/components/marketplace/ProductHeader.tsx
index 4208e31..4da53e1 100644
--- a/frontend/src/shared/components/marketplace/ProductHeader.tsx
+++ b/frontend/src/shared/components/marketplace/ProductHeader.tsx
@@ -73,7 +73,12 @@ export const ProductHeader: React.FC = ({
{product.charge_type && (
{t("Price")}:
-
+
)}
diff --git a/frontend/src/shared/components/marketplace/ServerConfig.tsx b/frontend/src/shared/components/marketplace/ServerConfig.tsx
index 43db7b1..dcc0082 100644
--- a/frontend/src/shared/components/marketplace/ServerConfig.tsx
+++ b/frontend/src/shared/components/marketplace/ServerConfig.tsx
@@ -1,29 +1,48 @@
"use client";
-import React, { useEffect, useState } from "react";
-import { ServiceData } from "@/shared/types/marketplace";
-import { Card, Chip } from "@nextui-org/react";
+import React from "react";
+import { Card, Chip, Button } from "@nextui-org/react";
import { FlipButton } from "@/shared/components/FlipButton";
import { useAuth } from "@/shared/lib/useAuth";
import { useTranslation } from "react-i18next";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
+import { Copy } from "lucide-react";
+import { copyToClipboard } from "@/shared/utils/clipboard";
+import toast from "react-hot-toast";
interface ServerConfigProps {
- product: ServiceData;
mcpName?: string;
+ url?: string;
}
-export const ServerConfig: React.FC = ({ product, mcpName }) => {
-
+export const ServerConfig: React.FC = ({
+ mcpName,
+ url = process.env.NEXT_PUBLIC_MCP_URL,
+}) => {
const { t } = useTranslation();
const { handleLogin } = useAuth();
const { platformConfig } = usePlatformConfig();
- const [url, setUrl] = useState(process.env.NEXT_PUBLIC_MCP_URL || "");
- useEffect(() => {
- if (url || !product.slug_name) return
- setUrl(`${window.location.protocol}//${window.location.hostname}:8002/mcp/${product.slug_name}`);
- }, [product.slug_name]);
+ const getCodeContent = () => {
+ return `{
+ "mcpServers": {
+ "${mcpName || "xpack-mcp-market"}": {
+ "type": "sse",
+ "autoApprove":"all",
+ "url": "${url}?apikey={Your-${platformConfig?.name}-API-Key}"
+ }
+ }
+}`;
+ };
+
+ const handleCopy = async () => {
+ const result = await copyToClipboard(getCodeContent());
+ if (result.success) {
+ toast.success(t("Copied to clipboard"));
+ } else {
+ toast.error(t("Copy failed, please copy manually"));
+ }
+ };
return (
@@ -38,9 +57,21 @@ export const ServerConfig: React.FC = ({ product, mcpName })
{/* Code Snippet */}
-
- {platformConfig?.name} MCP
-
+
+
+ {platformConfig?.name} MCP
+
+
+
{`{
@@ -60,4 +91,4 @@ export const ServerConfig: React.FC = ({ product, mcpName })
);
-};
\ No newline at end of file
+};
diff --git a/frontend/src/shared/components/marketplace/ServiceCard.tsx b/frontend/src/shared/components/marketplace/ServiceCard.tsx
index 650c25d..bf399b7 100644
--- a/frontend/src/shared/components/marketplace/ServiceCard.tsx
+++ b/frontend/src/shared/components/marketplace/ServiceCard.tsx
@@ -17,7 +17,10 @@ export const ServiceCard: React.FC = ({ service }) => {
const { t } = useTranslation();
return (
-
+
= ({ service }) => {
{t("{{count}} Tools", { count: service.tools.length })}
-
+
diff --git a/frontend/src/shared/components/marketplace/ServiceListSection.tsx b/frontend/src/shared/components/marketplace/ServiceListSection.tsx
index 19af4b7..dbdec73 100644
--- a/frontend/src/shared/components/marketplace/ServiceListSection.tsx
+++ b/frontend/src/shared/components/marketplace/ServiceListSection.tsx
@@ -25,7 +25,7 @@ export const ServiceListSection: React.FC = ({
return (
{/* Services Grid */}
-
+
{services.map((service) => (
))}
@@ -46,4 +46,4 @@ export const ServiceListSection: React.FC = ({
)}
);
-};
\ No newline at end of file
+};
diff --git a/frontend/src/shared/components/modal/RechargeModal.tsx b/frontend/src/shared/components/modal/RechargeModal.tsx
index 085c1f2..2353375 100644
--- a/frontend/src/shared/components/modal/RechargeModal.tsx
+++ b/frontend/src/shared/components/modal/RechargeModal.tsx
@@ -1,4 +1,4 @@
-import React, { useState } from "react";
+import React, { useEffect, useState } from "react";
import {
Modal,
ModalContent,
@@ -7,11 +7,14 @@ import {
ModalFooter,
Button,
Input,
+ RadioGroup,
+ Radio,
} from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { fetchAPI } from "@/shared/rpc/common-function";
import toast from "react-hot-toast";
import { ConfirmPurchaseModal } from "./ConfirmPurchaseModal";
+import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
interface RechargeModalProps {
isOpen: boolean;
@@ -23,13 +26,16 @@ export const RechargeModal: React.FC = ({
onClose,
}) => {
const { t } = useTranslation();
+ const { paymentChannels } = usePlatformConfig();
const [amount, setAmount] = useState("");
const [error, setError] = useState("");
+ const [selectedPaymentChannel, setSelectedPaymentChannel] = useState(
+ paymentChannels[0]?.id || ""
+ );
const [paymentId, setPaymentId] = useState("");
const [isConfirmOpen, setIsConfirmOpen] = useState(false);
-
const handlePurchase = async () => {
const numAmount = parseFloat(amount);
if (isNaN(numAmount) || numAmount <= 0) {
@@ -41,10 +47,17 @@ export const RechargeModal: React.FC = ({
setError(t("Minimum recharge amount is $1"));
return;
}
+
+ if (!selectedPaymentChannel) {
+ setError(t("Please select a payment method"));
+ return;
+ }
+
const response = await fetchAPI("/api/payment/create_payment_link", {
method: "POST",
body: {
amount: numAmount,
+ payment_channel: selectedPaymentChannel,
success_url: window.location.origin + "/pay_success",
} as unknown as BodyInit,
});
@@ -93,6 +106,7 @@ export const RechargeModal: React.FC = ({
const handleClose = () => {
setAmount("");
setError("");
+ setSelectedPaymentChannel(paymentChannels[0]?.id || "");
onClose();
};
@@ -119,23 +133,54 @@ export const RechargeModal: React.FC = ({
}
type="text"
variant="bordered"
- isInvalid={!!error}
- errorMessage={error}
+ isInvalid={!!error && !error.includes("payment method")}
+ errorMessage={
+ error && !error.includes("payment method") ? error : ""
+ }
+ labelPlacement="outside"
onKeyDown={(e) => {
if (e.key === "Enter") {
handlePurchase();
}
}}
/>
-
- {t("Funds will be added to your account balance")}
-
+ {/**coming soon : select payment channel*/}
+
+ {/* {paymentChannels.length > 0 && (
+
+
+
+ {paymentChannels.map((channel) => (
+
+ {channel.name}
+
+ ))}
+
+
+ )} */}
-
@@ -144,7 +189,6 @@ export const RechargeModal: React.FC = ({
-
{/**Confirm Purchase Modal */}
= ({
/>
>
);
-};
\ No newline at end of file
+};
diff --git a/frontend/src/shared/contexts/PlatformConfigContext.tsx b/frontend/src/shared/contexts/PlatformConfigContext.tsx
index 41181af..c2b4754 100644
--- a/frontend/src/shared/contexts/PlatformConfigContext.tsx
+++ b/frontend/src/shared/contexts/PlatformConfigContext.tsx
@@ -6,6 +6,10 @@ import {
PlatformConfigResponse,
Theme,
LoginConfig,
+ FaqItem,
+ TopNavigationItem,
+ EmbeddedHtmlConfig,
+ PaymentChannel,
} from "@/shared/types/system";
export const _DefaultPlatformConfig: PlatformConfig = {
name: "XPack",
@@ -17,10 +21,18 @@ export const _DefaultPlatformConfig: PlatformConfig = {
subheadline:
"Open‑source MCP marketplace — publish or consume APIs in minutes.",
theme: Theme.DEFAULT,
+ domain: "",
+ is_showcased: false,
+ mcp_server_prefix: "",
};
interface PlatformConfigContextType {
platformConfig: PlatformConfig;
loginConfig: LoginConfig | null;
+ faqItems: FaqItem[];
+ topNavigation: TopNavigationItem[];
+ embeddedHtml: EmbeddedHtmlConfig | null;
+ paymentChannels: PaymentChannel[];
+ isInstalled: boolean;
updateClientConfig: (config: PlatformConfigResponse) => void;
}
@@ -43,13 +55,41 @@ export const PlatformConfigProvider: React.FC = ({
const [loginConfig, setLoginConfig] = useState(
initConfig?.login || null
);
+ const [faqItems, setFaqItems] = useState(initConfig?.faq || []);
+ const [topNavigation, setTopNavigation] = useState(
+ initConfig?.top_navigation || []
+ );
+ const [embeddedHtml, setEmbeddedHtml] = useState(
+ initConfig?.embeded_html || null
+ );
+ const [paymentChannels, setPaymentChannels] = useState(
+ initConfig?.payment_channels || []
+ );
+ const [isInstalled, setIsInstalled] = useState(
+ initConfig?.is_installed || false
+ );
+
const updateClientConfig = (config: PlatformConfigResponse) => {
if (config.platform) setPlatformConfig(config.platform);
if (config.login) setLoginConfig(config.login);
+ if (config.faq) setFaqItems(config.faq);
+ if (config.top_navigation) setTopNavigation(config.top_navigation);
+ if (config.embeded_html) setEmbeddedHtml(config.embeded_html);
+ if (config.payment_channels) setPaymentChannels(config.payment_channels);
+ if (config.is_installed !== undefined) setIsInstalled(config.is_installed);
};
return (
{children}
diff --git a/frontend/src/shared/types/dashboard.ts b/frontend/src/shared/types/dashboard.ts
index 62ec7fc..95e687b 100644
--- a/frontend/src/shared/types/dashboard.ts
+++ b/frontend/src/shared/types/dashboard.ts
@@ -11,16 +11,28 @@ export enum TabKey {
ACCOUNT = "account",
}
+export interface SidebarSubItem {
+ key: string;
+ label: string;
+ description?: string;
+}
+
export interface SidebarItem {
key: TabKey;
icon: React.ReactNode;
label: string;
description: string;
+ subItems?: SidebarSubItem[];
+}
+
+export interface SidebarItemWithActive extends SidebarItem {
+ isExpanded?: boolean;
}
export interface DashboardSidebarProps {
activeTab: TabKey;
- onTabNavigate?: (tab: TabKey) => void;
+ activeSubTab?: string;
+ onTabNavigate?: (tab: TabKey, subTab?: string) => void;
onLogout: () => void;
bottomPanel?: React.ReactNode;
sidebarItems: SidebarItem[];
diff --git a/frontend/src/shared/types/marketplace.ts b/frontend/src/shared/types/marketplace.ts
index 5180805..b1ecffa 100644
--- a/frontend/src/shared/types/marketplace.ts
+++ b/frontend/src/shared/types/marketplace.ts
@@ -8,6 +8,8 @@ export interface ServiceData {
tags?: string[];
price?: string;
charge_type?: ChargeType;
+ input_token_price?: string;
+ output_token_price?: string;
}
export interface ToolData {
diff --git a/frontend/src/shared/types/system.ts b/frontend/src/shared/types/system.ts
index 1a9990c..3de0973 100644
--- a/frontend/src/shared/types/system.ts
+++ b/frontend/src/shared/types/system.ts
@@ -21,12 +21,48 @@ export interface PlatformConfig {
subheadline?: string; // homepage subheadline
theme?: Theme; // platform theme for homepage and marketplace templates
about_page?: string; // about page content (markdown)
+ domain?: string; // platform domain
+ is_showcased?: boolean; // whether to showcase in xpack official case list
+ mcp_server_prefix?: string; // MCP server domain prefix for API calls
}
export type ThemeType = Theme;
+// FAQ item
+export interface FaqItem {
+ question: string;
+ answer: string;
+}
+export enum TopNavigationTargetEnum {
+ SELF = "_self",
+ BLANK = "_blank",
+}
+// Top navigation item
+export interface TopNavigationItem {
+ title: string;
+ link: string;
+ target: TopNavigationTargetEnum;
+}
+
+// Embedded HTML config
+export interface EmbeddedHtmlConfig {
+ is_enabled: boolean;
+ html: string;
+}
+
+// Payment channel
+export interface PaymentChannel {
+ id: string;
+ name: string;
+}
+
export interface PlatformConfigResponse {
- platform: PlatformConfig;
+ platform?: PlatformConfig;
login?: LoginConfig;
+ faq?: FaqItem[];
+ top_navigation?: TopNavigationItem[];
+ embeded_html?: EmbeddedHtmlConfig;
+ payment_channels?: PaymentChannel[];
+ is_installed?: boolean;
}
// google auth config
diff --git a/frontend/src/types/mcp-service.ts b/frontend/src/types/mcp-service.ts
index 49d56e9..dabf23e 100644
--- a/frontend/src/types/mcp-service.ts
+++ b/frontend/src/types/mcp-service.ts
@@ -19,6 +19,8 @@ export interface BaseMCPService {
long_description?: string;
charge_type: ChargeType;
price?: string;
+ input_token_price?: string;
+ output_token_price?: string;
apis: MCPServiceAPIItem[];
tags?: string[];
}
@@ -34,6 +36,7 @@ export interface MCPServiceAPIItem {
id: string;
name: string;
description?: string;
+ url?: string;
}
// form data interface, used to create and edit service
@@ -48,6 +51,8 @@ export interface MCPServiceFormData {
auth_token?: string;
charge_type: ChargeType;
price?: string;
+ input_token_price?: string; // Price for input tokens when charge_type is PerToken
+ output_token_price?: string; // Price for output tokens when charge_type is PerToken
enabled: EnabledEnum; // API requires string type
apis: MCPServiceAPIItem[];
tags?: string[];
@@ -89,41 +94,6 @@ export interface ServiceDeleteRequest {
id: string;
}
-// predefined auth methods
-export const AUTH_METHODS = [
- { value: "free", label: "free" },
- { value: "apikey", label: "API key" },
-] as const;
-
-// predefined charge types
-export const CHARGE_TYPES = [
- { value: "free", label: "free" },
- { value: "per_call", label: "per call" },
- { value: "per_token", label: "per token" },
-] as const;
-
-// predefined service categories
-export const SERVICE_CATEGORIES = [
- "Web Services",
- "Database",
- "AI/ML",
- "Authentication",
- "Payment",
- "Communication",
- "Analytics",
- "Storage",
- "Security",
- "Development Tools",
- "Financial",
- "Logistics & Transportation",
- "E-commerce",
- "Social Media",
- "Content Management",
- "Other",
-] as const;
-
-export type ServiceCategory = (typeof SERVICE_CATEGORIES)[number];
-
// tool function: convert frontend form data to API data
export function convertFormToAPI(
formData: MCPServiceFormData
@@ -138,6 +108,8 @@ export function convertFormToAPI(
auth_token: formData.auth_token,
charge_type: formData.charge_type,
price: formData.price,
+ input_token_price: formData.input_token_price,
+ output_token_price: formData.output_token_price,
enabled: formData.enabled,
apis: formData.apis,
tags: formData.tags,
diff --git a/frontend/src/types/payment.ts b/frontend/src/types/payment.ts
index 6139107..4b839d9 100644
--- a/frontend/src/types/payment.ts
+++ b/frontend/src/types/payment.ts
@@ -1,18 +1,37 @@
// payment channel type
-export type PaymentChannelType = "stripe";
+export type PaymentChannelType = "stripe" | "alipay" | "wechat";
// stripe config - admin need to configure
export interface StripeConfig {
secret: string;
webhook_secret: string;
+ is_enabled?: boolean;
}
+// alipay config - admin need to configure
+export interface AlipayConfig {
+ app_id: string;
+ app_private_key: string;
+ alipay_public_key: string;
+ is_enabled?: boolean;
+}
+
+// wechat config - admin need to configure
+export interface WechatConfig {
+ app_id: string;
+ mch_id: string;
+ is_enabled?: boolean;
+}
+
+// union type for all payment configs
+export type PaymentConfig = StripeConfig | AlipayConfig | WechatConfig;
+
// API return payment channel item structure
export interface PaymentChannelApiItem {
id: PaymentChannelType;
name: string;
is_enabled: boolean;
- config: StripeConfig;
+ config: PaymentConfig;
update_time: string;
}
diff --git a/frontend/src/types/system.ts b/frontend/src/types/system.ts
index e9d61c4..76dfd5d 100644
--- a/frontend/src/types/system.ts
+++ b/frontend/src/types/system.ts
@@ -4,6 +4,10 @@ import {
GoogleAuthConfig,
PlatformConfig,
LoginConfig,
+ FaqItem,
+ TopNavigationItem,
+ EmbeddedHtmlConfig,
+ PaymentChannel,
} from "@/shared/types/system";
// API return system config data structure
@@ -12,6 +16,11 @@ export interface SystemConfigApiData {
account: AdminConfig;
email: EmailConfig;
login: LoginConfig;
+ faq?: FaqItem[];
+ top_navigation?: TopNavigationItem[];
+ embeded_html?: EmbeddedHtmlConfig;
+ payment_channels?: PaymentChannel[];
+ is_installed?: boolean;
}
// admin config
export interface AdminConfig {