diff --git a/.gitignore b/.gitignore index 8cf8a5a..a41c756 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,6 @@ local_settings.py /.secrets /uploads/ /.vercel/ + +# Local deployment data +mysql-data/ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b6f9f2a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,62 @@ +version: '3' +services: + xpack-mysql: + image: mysql:8.0.37 + privileged: true + restart: always + container_name: xpack-mysql + hostname: xpack-mysql + command: + - "--character-set-server=utf8mb4" + - "--collation-server=utf8mb4_unicode_ci" + ports: + - "33306:3306" + environment: + - MYSQL_ROOT_PASSWORD=mysql_ZTdhRB + - MYSQL_DATABASE=xpack + volumes: + - /vol3/1000/HD3/docker/xpack-mcp/mysql-data:/var/lib/mysql + networks: + - xpack + xpack-mcp-market: + image: xpackai/xpack-mcp-market:zhcn + container_name: xpack-mcp-market + privileged: true + restart: always + networks: + - xpack + ports: + - "8010:80" + depends_on: + - xpack-mysql + - xpack-redis + - xpack-rabbitmq + xpack-redis: + container_name: xpack-redis + image: redis:7.2.4 + hostname: xpack-redis + privileged: true + restart: always + command: + - bash + - -c + - "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass redis_6sJZDm" + networks: + - xpack + xpack-rabbitmq: + container_name: xpack-rabbitmq + image: rabbitmq:4.1.2-alpine + privileged: true + restart: always + environment: + - RABBITMQ_DEFAULT_USER=rabbitmq + - RABBITMQ_DEFAULT_PASS=rabbitmq_Gs123dA + networks: + - xpack +networks: + xpack: + driver: bridge + ipam: + driver: default + config: + - subnet: 172.101.0.0/24 \ No newline at end of file diff --git a/frontend/public/locales/en/translation.json b/frontend/public/locales/en/translation.json index 8e0a741..1984410 100644 --- a/frontend/public/locales/en/translation.json +++ b/frontend/public/locales/en/translation.json @@ -483,7 +483,6 @@ "Enter server ID": "Enter server ID", "Modifying the ID will affect the MCP access URL. Please modify with caution.": "Modifying the ID will affect the MCP access URL. Please modify with caution.", "You have modified the Server ID. This will affect the MCP access URL and may break existing integrations. Are you sure you want to continue?": "You have modified the Server ID. This will affect the MCP access URL and may break existing integrations. Are you sure you want to continue?", - "The header name for the API key (e.g., X-API-Key, Authorization)": "The header name for the API key (e.g., X-API-Key, Authorization)", "Enter API key": "Enter API key", "Enter bearer token": "Enter bearer token", @@ -891,5 +890,17 @@ "Auth key name \"{{name}}\" already exists": "Auth key name \"{{name}}\" already exists", "Start date must be before end date": "Start date must be before end date", "Start date cannot be earlier than 30 days ago": "Start date cannot be earlier than 30 days ago", - "Resource Groups": "Resource Groups" -} + "Resource Groups": "Resource Groups", + "Daily call limit per user": "Daily call limit per user", + "Max calls per user per day (Beijing time). Leave blank or 0 for unlimited": "Max calls per user per day (Beijing time). Leave blank or 0 for unlimited", + "e.g. 50": "e.g. 50", + "Free Call Limits": "Free Call Limits", + "Global daily call cap for free services": "Global daily call cap for free services", + "Platform-wide daily call limit per user": "Platform-wide daily call limit per user", + "Applies to every free service, leave blank or 0 for unlimited": "Applies to every free service, leave blank or 0 for unlimited", + "If a service also has its own limit, the smaller number wins": "If a service also has its own limit, the smaller number wins", + "Example 100": "Example 100", + "Enter a non-negative integer": "Enter a non-negative integer", + "Free call limit saved": "Free call limit saved", + "Failed to save free call limit": "Failed to save free call limit" +} \ No newline at end of file diff --git a/frontend/public/locales/zh-CN/translation.json b/frontend/public/locales/zh-CN/translation.json index f7d6ec1..c480386 100644 --- a/frontend/public/locales/zh-CN/translation.json +++ b/frontend/public/locales/zh-CN/translation.json @@ -485,7 +485,6 @@ "Enter server ID": "输入服务器ID", "Modifying the ID will affect the MCP access URL. Please modify with caution.": "修改ID会影响MCP的访问地址,需要谨慎修改。", "You have modified the Server ID. This will affect the MCP access URL and may break existing integrations. Are you sure you want to continue?": "您已修改了服务器ID。这将影响MCP访问地址,可能会破坏现有的集成。您确定要继续吗?", - "The header name for the API key (e.g., X-API-Key, Authorization)": "API密钥的头部名称(例如:X-API-Key, Authorization)", "Enter API key": "输入API密钥", "Enter bearer token": "输入Bearer令牌", @@ -957,5 +956,17 @@ "Resource group name \"{{name}}\" already exists": "资源组名称 \"{{name}}\" 已存在", "Auth key name \"{{name}}\" already exists": "认证密钥 \"{{name}}\" 已存在", "Start date must be before end date": "开始日期必须早于结束日期", - "Start date cannot be earlier than 30 days ago": "开始日期不能早于30天前" -} + "Start date cannot be earlier than 30 days ago": "开始日期不能早于30天前", + "Daily call limit per user": "每用户每日调用上限", + "Max calls per user per day (Beijing time). Leave blank or 0 for unlimited": "每个用户每天最多调用次数(北京时间)。留空或填 0 表示不限", + "e.g. 50": "如 50", + "Free Call Limits": "免费调用限制", + "Global daily call cap for free services": "免费服务的全局每日调用上限", + "Platform-wide daily call limit per user": "全站每用户每日调用上限", + "Applies to every free service, leave blank or 0 for unlimited": "对所有免费服务生效,留空或填 0 表示不限", + "If a service also has its own limit, the smaller number wins": "若单个服务也设置了上限,两者取更小值", + "Example 100": "如 100", + "Enter a non-negative integer": "请输入非负整数", + "Free call limit saved": "免费调用上限已保存", + "Failed to save free call limit": "保存免费调用上限失败" +} \ No newline at end of file diff --git a/frontend/src/app/admin/submissions/page.tsx b/frontend/src/app/admin/submissions/page.tsx new file mode 100644 index 0000000..c96057f --- /dev/null +++ b/frontend/src/app/admin/submissions/page.tsx @@ -0,0 +1,55 @@ +"use client"; +import React, { useEffect, useState } from "react"; + +export default function AdminSubmissionsPage() { + const [list, setList] = useState([]); + const [status, setStatus] = useState("pending"); + + const load = async () => { + const res = await fetch(`/api/submission/admin/submissions?status=${status}`, { credentials: "include" }); + const data = await res.json(); + setList(data?.data || []); + }; + + useEffect(() => { load(); }, [status]); + + const approve = async (id: string) => { + await fetch(`/api/submission/admin/submission/${id}/approve`, { method: "PUT", credentials: "include" }); + load(); + }; + const reject = async (id: string) => { + await fetch(`/api/submission/admin/submission/${id}/reject`, { method: "PUT", credentials: "include", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ note: "rejected" }) }); + load(); + }; + + return ( +
+

提交审核

+ + + + + {list.map((s: any) => ( + + + + + + + ))} + +
名称类型状态操作
{s.name}{s.type}{s.status} + {s.status === "pending" && ( + <> + + + + )} +
+
+ ); +} diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 7c88e76..70d3584 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -27,12 +27,12 @@ export default async function RootLayout({ const platformConfig = await getCachedPlatformConfig(); return ( - +