Compare commits

...
109 Commits
Author SHA1 Message Date
Dot.L d725e9d896 Merge pull request #64 from xpack-ai/feature/mcp
Check if base_url is valid
2025-12-08 10:17:17 +08:00
riverLethe 68c4b2fcc2 Merge branch 'main' of https://github.com/xpack-ai/XPack-MCP-Market 2025-12-08 09:08:25 +08:00
riverLethe 96db00418c feat:Add more constraints for server name, server ID, and api endpoint. 2025-12-08 09:08:09 +08:00
Liujian 2def6457fe Merge remote-tracking branch 'origin/main' into feature/mcp 2025-12-07 15:54:19 +08:00
Liujian b9123d68a0 Check if base_url is valid 2025-12-07 15:51:32 +08:00
Dot.L ebbf9b22da Merge pull request #63 from xpack-ai/feature/mcp
Bug fixes and improved prompts
2025-12-07 14:09:15 +08:00
Liujian eace543d74 Check if the price is a positive number. 2025-12-07 14:03:32 +08:00
Liujian 73cd1a01a0 Fix: Issue where billing continued even after calling the mcp tool failed. 2025-12-07 13:46:21 +08:00
Liujian 8186b4c0b5 fix: User Dashboard - AuthKey Analytics: display Total spending discrepancy 2025-12-06 00:50:36 +09:00
Liujian 5023e4494c fix: The balance field has an incorrect data type; it should be Decimal. 2025-12-05 23:50:41 +09:00
Liujian e2d360d5de fix: Balance Doubled When Depositing Funds 2025-12-05 22:57:44 +09:00
Liujian 948046948a fix:Relate to transaction_id value when admin recharge for user 2025-12-05 21:50:48 +09:00
Liujian 4e3fd1afaf fix: login failed 2025-12-05 12:17:49 +09:00
Liujian e2ae502b48 fix bug:Admin upload image should support format GIF, SVG to update logo 2025-12-05 11:02:07 +09:00
Liujian 6561435a38 Merge remote-tracking branch 'origin/main' into feature/mcp 2025-12-05 10:59:48 +09:00
Liujian 1846aafc1e fix bug:
1. Service_type do not set after add server
2. Issue relate pricing when "Update from OpenAPI"
3. Failed to set SQLAlchemy cache for key Error
4. Request Body Logging in Internal Service
5. Deleted API Key Remains Valid for 5 Minutes
2025-12-05 10:27:19 +09:00
riverLethe 54654b386d feat: Upgrade Next.js and refine password/amount restrictions
This commit addresses several key updates and fixes:

1.  **Security Update:** Upgraded Next.js to fix the vulnerability identified as **CVE-2025-55182**.
2.  **Password Policy:** Globally adjusted the password requirement for "change password" operations to a minimum length of **6 characters**.
3.  **Validation Improvement:** Enhanced validation logic for amount fields during MCP (Multi-Currency Purchase/Payment, assuming this acronym) creation to ensure proper limits and constraints are applied.
2025-12-04 17:43:59 +08:00
Dot.L 755d48a2f8 Merge pull request #61 from xpack-ai/feature/mcp
Update client IP acquisition logic
2025-11-26 18:02:54 +08:00
Liujian 284880a170 Update client IP acquisition logic 2025-11-26 18:02:10 +08:00
Dot.L 950b516081 Merge pull request #60 from xpack-ai/feature/mcp
Email captcha rate limiting fix && CORS tightening via configuration
2025-11-26 17:08:41 +08:00
Liujian 0088a7b447 Merge remote-tracking branch 'origin/main' into feature/mcp 2025-11-26 17:00:29 +08:00
Liujian 19f646c318 Email captcha rate limiting fix && CORS tightening via configuration 2025-11-26 16:58:54 +08:00
Dot.L 115ac5caf7 Merge pull request #59 from xpack-ai/feature/mcp
repairing potential risks
2025-11-26 16:39:29 +08:00
Liujian 798082934e Merge remote-tracking branch 'origin/main' into feature/mcp 2025-11-26 16:21:40 +08:00
Liujian a017b0fa93 repairing potential risks 2025-11-26 16:16:23 +08:00
Liujian 877dbb6a4e MCP session keys use client fingerprints to distinguish requests from different clients. 2025-11-26 15:09:35 +08:00
Dot.L 523265e550 Merge pull request #58 from xpack-ai/feature/mcp
Payment information encryption and  wait for the initial connection to initialize successfully before processing the request
2025-11-14 18:11:01 +08:00
Liujian 5d2db84d75 update env example 2025-11-14 17:47:31 +08:00
Liujian 4826859152 Payment information encryption 2025-11-14 16:58:08 +08:00
Liujian 92f8b68f0e A new connection recovery mechanism has been added in the event of a network outage. 2025-11-14 15:50:39 +08:00
Liujian 87a4b6e2de Wait for the initial connection to initialize successfully before processing the request. 2025-11-14 15:50:00 +08:00
Dot.L 58d30344f5 Merge pull request #57 from xpack-ai/feature/mcp
Completed: OutputSchema functionality added to the MCP tools list.
2025-11-07 17:23:54 +08:00
Liujian a6064035bd Completed: OutputSchema functionality added to the MCP tools list. 2025-11-07 17:23:24 +08:00
Dot.L 141fb4758f Merge pull request #56 from xpack-ai/feature/mcp
fix bug: API enabled status error when updating service Swagger docum…
2025-11-07 16:56:07 +08:00
Liujian 5450027bbc fix bug: API enabled status error when updating service Swagger documentation 2025-11-07 16:53:25 +08:00
riverLethe 721a213bbf fix:hidden server length in marketpalce card panel 2025-11-07 14:03:38 +08:00
Dot.L 9ce81f5012 Merge pull request #55 from xpack-ai/feature/mcp
MCP tool list response adds outputSchema
2025-11-07 10:32:07 +08:00
Liujian a28f3bb680 MCP tool list response adds outputSchema 2025-11-07 10:31:29 +08:00
Dot.L 14e45235b4 Merge pull request #54 from xpack-ai/feature/synchronize_saas
update mcp session gc logic
2025-10-23 17:55:51 +08:00
Liujian 6a69d678fd update mcp session gc logic 2025-10-23 17:55:24 +08:00
Dot.L 48ba7ffd96 Merge pull request #53 from xpack-ai/feature/synchronize_saas
Translate Chinese into English
2025-10-22 23:21:23 +08:00
Liujian faa1f552e6 Translate Chinese into English 2025-10-22 23:20:57 +08:00
riverLethe b2bd2e30dd feat/ui:The server configuration allows switching between Streamable HTTP and SSE. 2025-10-22 19:59:49 +08:00
Dot.L e25e119ba1 Merge pull request #52 from xpack-ai/feature/synchronize_saas
support streamable http
2025-10-22 19:14:26 +08:00
Liujian eb1811fa3a support streamable http 2025-10-22 19:01:11 +08:00
Dot.L ee65da1665 Merge pull request #51 from xpack-ai/feature/synchronize_saas
Update Deployment Tutorial
2025-10-20 18:22:42 +08:00
Liujian bda95f756a Update Deployment Tutorial 2025-10-20 17:15:03 +08:00
Liujian ae7b6d20e4 Update Deployment Tutorial 2025-10-20 17:11:52 +08:00
Liujian 0d1dff05d6 Merge remote-tracking branch 'origin/main' into feature/synchronize_saas 2025-10-20 15:17:02 +08:00
riverLethe 434518b2b3 feat/op:uploads path use rewrite 2025-10-20 14:57:33 +08:00
Dot.L 3321efc3d4 Merge pull request #50 from xpack-ai/feature/synchronize_saas
Update Deployment Tutorial
2025-10-20 13:42:35 +08:00
Liujian 0313ced503 Update Deployment Tutorial 2025-10-20 09:19:15 +08:00
riverLethe d17e5e95dd feat/ui:concole stats top server support to show deleted item 2025-10-17 19:11:35 +08:00
Dot.L 41f9d74c5e Merge pull request #49 from xpack-ai/feature/synchronize_saas
fix drop service bug
2025-10-17 18:53:49 +08:00
Liujian 7f17b22896 fix drop service bug 2025-10-17 18:53:15 +08:00
Dot.L 186ba8ca81 Merge pull request #48 from xpack-ai/feature/synchronize_saas
Feature/synchronize saas
2025-10-17 18:38:51 +08:00
Liujian 777649f82b Delete service using software deletion 2025-10-17 18:36:58 +08:00
Liujian f042cdf911 Add annotations and translate Chinese into English 2025-10-17 16:26:14 +08:00
Liujian 7c75c07216 fix: redis cache bug 2025-10-17 15:26:01 +08:00
riverLethe 33549167d9 fix/op:if user not input api endpoint when update mcp server,need to disable save 2025-10-17 15:04:21 +08:00
Liujian 0ae689f9fe Merge remote-tracking branch 'origin/main' into feature/synchronize_saas 2025-10-17 13:47:47 +08:00
Dot.L 21c72f17ba Merge pull request #47 from xpack-ai/feature/synchronize_saas
update billing message logic
2025-10-17 13:38:22 +08:00
Liujian 76e8dbc083 update billing message logic 2025-10-17 13:37:58 +08:00
Dot.L 96abfc2752 Merge pull request #46 from xpack-ai/feature/synchronize_saas
fix mcp bug
2025-10-17 11:46:29 +08:00
Liujian a992866058 fix mcp bug 2025-10-17 11:46:08 +08:00
Dot.L 39db3d9a94 Merge pull request #45 from xpack-ai/feature/synchronize_saas
fix mcp bug
2025-10-17 10:37:45 +08:00
Liujian c71a416046 fix mcp bug 2025-10-17 10:36:24 +08:00
Dot.L 9a605cc9f0 Merge pull request #44 from xpack-ai/feature/synchronize_saas
Feature/synchronize saas
2025-10-17 10:27:21 +08:00
Liujian e8aaeefe85 update mcp param key 2025-10-17 10:13:19 +08:00
riverLethe 51d41bc3d4 feat/ui:update translation json 2025-10-17 10:04:49 +08:00
Liujian c1b224af46 Merge remote-tracking branch 'origin/main' into feature/synchronize_saas 2025-10-16 17:44:14 +08:00
riverLethe 521c1b7a07 feat:1.1 UI/UX 2025-10-16 17:35:45 +08:00
Dot.L 3c9b037ba7 Merge pull request #43 from xpack-ai/feature/synchronize_saas
Feature/synchronize saas
2025-10-16 16:55:30 +08:00
Liujian f3a1107838 update create user bug 2025-10-16 16:55:09 +08:00
Liujian d53fe311a3 update sql 2025-10-16 15:54:20 +08:00
Dot.L 407081adfc Merge pull request #42 from xpack-ai/feature/synchronize_saas
fix system config bug
2025-10-16 15:29:27 +08:00
Liujian 09704af14a fix system config bug 2025-10-16 15:28:52 +08:00
Dot.L 46d5040068 Merge pull request #41 from xpack-ai/feature/synchronize_saas
fix stats analystic bug
2025-10-16 14:52:14 +08:00
Liujian 3faa35e970 fix stats analystic bug 2025-10-16 14:51:47 +08:00
Dot.L a0e7662f76 Merge pull request #40 from xpack-ai/feature/synchronize_saas
finish stats analytics api
2025-10-16 11:17:08 +08:00
Liujian d49144afe9 finish stats analytics api 2025-10-16 11:16:41 +08:00
Dot.L 81637440d6 Merge pull request #39 from xpack-ai/feature/synchronize_saas
fix  bug
2025-10-16 10:03:37 +08:00
Liujian c949aac528 fix bug 2025-10-16 10:03:10 +08:00
Dot.L 5e08cd2ff5 Merge pull request #38 from xpack-ai/feature/synchronize_saas
Synchronize mcp service api
2025-10-15 14:50:30 +08:00
Liujian c790fbef51 Synchronize mcp service api 2025-10-15 14:49:20 +08:00
Dot.L bb9dd11869 Merge pull request #37 from xpack-ai/feature/synchronize_saas
Feature/synchronize saas
2025-10-14 18:04:42 +08:00
Liujian a0b827b32e Synchronize system configuration related APIs 2025-10-14 18:04:02 +08:00
riverLethe 7e135f4949 fix:fetch platform config error will influence project build bug 2025-10-09 09:15:36 +08:00
Dot.L 4d230db82b Merge pull request #36 from xpack-ai/feature/ui-1.0.2
feat/ui-1.0.2:when about page content is empty,need to hide about nav…
2025-10-07 09:05:51 +08:00
riverLethe 4b773063a0 feat/ui-1.0.2:when about page content is empty,need to hide about navigation 2025-09-28 14:20:04 +08:00
riverLethe 92aa83cb71 feat/ui-1.0.2:when about page content is empty,need to hide about navigation 2025-09-28 14:19:29 +08:00
Dot.L f98ff6bf44 Update admin user login address in README 2025-09-17 13:43:43 +08:00
JackLiu 22aa1c34c7 Update README-zh-tw.md for clarity in billing section 2025-08-28 11:30:08 +09:00
JackLiu 680ae27dd1 Update language links in README-zh-tw.md 2025-08-28 11:29:28 +09:00
JackLiu 4bb91c38ae Add language links to README-zh-cn.md 2025-08-28 11:29:18 +09:00
JackLiu 6cdcb98dd5 Update Korean README with additional language links 2025-08-28 11:28:52 +09:00
JackLiu d0e48f8ae2 Update language links in README-ja.md 2025-08-28 11:28:35 +09:00
JackLiu 3693d984c5 Update language links in README-fr.md 2025-08-28 11:28:22 +09:00
JackLiu 4782b2ee8f Update language links in README-es.md 2025-08-28 11:27:58 +09:00
JackLiu c2c64a2d29 Update language links in README-de.md 2025-08-28 11:27:43 +09:00
JackLiu 2734841b2a Update README.md 2025-08-28 11:27:00 +09:00
JackLiu 86344c5bc0 new lang readme 2025-08-28 11:25:44 +09:00
JackLiu a3ab01cc46 Update README.md 2025-08-15 09:32:03 +08:00
JackLiu 265ed78835 Update README.md 2025-08-06 10:54:53 +08:00
Liujian ead0689b81 add wxpay 2025-08-01 18:27:19 +08:00
Liujian 5f621308ea add wxpay 2025-08-01 18:26:40 +08:00
lethe 49627d2449 fix/ui-1.0.0:api fetch error need to throw 2025-07-31 18:06:01 +08:00
Liujian 31e3b6b0a8 Change the frequency count to amount count 2025-07-31 17:25:23 +08:00
lethe 695580d844 feat/ui-1.0.0:dashboard analysis change times to amount 2025-07-31 17:16:41 +08:00
258 changed files with 15054 additions and 4117 deletions

No files matched your search

+8 -2
View File
@@ -6,7 +6,7 @@ MYSQL_PASSWORD=mysql_ZTdhRB
MYSQL_DB=xpack
# 服务端口配置
API_PORT=8000
API_PORT=8002
ADMIN_PORT=8001
# 调试配置
@@ -24,4 +24,10 @@ RABBITMQ_HOST=xpack-rabbitmq
RABBITMQ_PORT=5672
RABBITMQ_USER=rabbitmq
RABBITMQ_PASSWORD=rabbitmq_Gs123dA
RABBITMQ_VHOST=/
RABBITMQ_VHOST=/
# Payment config encryption key (Base64-encoded 32-byte random value for AES-GCM)
# Quick generation: python -c "import os,base64; print(base64.b64encode(os.urandom(32)).decode())"
PAYMENT_CONFIG_SECRET_KEY=uyyhfMJ+xpEE+IC5mPigpscekkR2ucz6Sj7sHYLhJQA=
# Optional: key ID used to support key rotation identification
PAYMENT_CONFIG_KEY_ID=default
+328
View File
@@ -0,0 +1,328 @@
# XPack
![b1](https://github.com/user-attachments/assets/3d50cd9a-9d28-4ec8-bb5f-d3668475b49e)
<p align="center">
<a href="/README.md">English</a>
|
<a href="/README-fr.md">Français</a>
|
<a href="/README-de.md">Deutsch</a>
|
<a href="/README-es.md">Español</a>
|
<a href="/README-ja.md">日本語</a>
|
<a href="/README-ko.md">한국어</a>
|
<a href="/README-zh-tw.md">繁體中文</a>
|
<a href="/README-zh-cn.md">简体中文</a>
</p>
**XPack** ist der erste Open‑Source‑MCP‑Marktplatz der Welt – damit erstellen und verkaufen Sie Ihre MCP‑Services in wenigen Minuten.
<br>
✨ Was XPack bietet
- ✅ **OpenAPI → MCP‑Servicekonfiguration per One‑Click**
- 🧾 **SEO‑optimierte Startseite & Service‑Seiten**
- 💳 **Integriertes Billing (pro Aufruf oder nach Token‑Verbrauch)**
- 👥 **Benutzerkontenverwaltung**
- 🛠 **Unterstützung für Stripe‑Zahlungen**
- 🔐 **Anmeldung via E‑Mail & Google OAuth**
Alles ist Open Source unter **Apache 2.0** – bereit für den kommerziellen Einsatz.
<br>
# ✨ Schnellstart
😍 Die Bereitstellung ist extrem einfach. Mit **einem einzigen Befehl** ist Ihr MCP‑Marktplatz in 10 Minuten online.
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
[![In 10 Minuten Ihren MCP‑Marktplatz deployen](https://github.com/user-attachments/assets/8881d724-b6aa-47b7-bbd7-b587ef541957)](https://www.youtube.com/watch?v=XHJXyvDevd8)
<br>
# 📸 Funktionen
![b2](https://github.com/user-attachments/assets/c8cc89a4-ab5f-4c90-8c97-9207b5c9f5c1)
![b3](https://github.com/user-attachments/assets/16f74c8a-b35e-40a7-8471-a5736de8e904)
![b4](https://github.com/user-attachments/assets/fc76c215-7544-4267-bc6f-22a719edec00)
![b5](https://github.com/user-attachments/assets/db40ea77-58c3-472d-ba94-35dc9716a980)
<br>
## 🖥️ Systemanforderungen
### ✅ Empfohlene Hardware
- **CPU**: 8 Kerne
- **Arbeitsspeicher**: 16 GB
- **Speicher**: 200 GB
- **Betriebssystem**: Linux
- **Architektur**: AMD64
### ✅ Mindestanforderungen
- **CPU**: 2 Kerne
- **Arbeitsspeicher**: 4 GB
- **Speicher**: 200 GB
- **Betriebssystem**: Linux / macOS
- **Architektur**: AMD64 / ARM64
<br>
## 📦 Laufzeitabhängigkeiten
Für **XPack‑MCP‑Market** werden folgende Dienste benötigt (selbst gehostet oder containerisiert):
| Komponente | Mindestversion |
|---|---|
| **MySQL** | ≥ 5.7.x |
| **Redis** | ≥ 6.2.x |
| **RabbitMQ**| ≥ 4.0 |
Stellen Sie sicher, dass diese Dienste verfügbar und korrekt konfiguriert sind, bevor Sie das Backend starten.
<br>
## 💿 Bereitstellung
😍 So einfach: Mit **einem Befehl** ist Ihr MCP‑Marktplatz in 10 Minuten bereit.
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
<details>
<summary><h4>🔖 Docker‑Compose‑Bereitstellung</h4></summary>
Für diese Methode benötigen Sie [Docker](https://docs.docker.com/engine/install/) und [Docker Compose](https://docs.docker.com/compose/install/standalone/).
1. `docker-compose.yml` bearbeiten
```
vi docker-compose.yml
```
<br>
2. Konfiguration anpassen (Beispiel: [docker-compose.yml](https://github.com/xpack-ai/XPack-MCP-Market/blob/main/scripts/docker-compose.yml))
```
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:
- /var/lib/xpack/mysql:/var/lib/mysql
networks:
- xpack
xpack-mcp-market:
image: xpackai/xpack-mcp-market
container_name: xpack-mcp-market
privileged: true
restart: always
networks:
- xpack
ports:
- "8000: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
ports:
- 6379:6379
command:
- bash
- -c
- "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass redis_6sJZDm"
networks:
- xpack
xpack-rabbitmq:
image: rabbitmq:4.1.2-alpine
container_name: xpack-rabbitmq
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
```
<br>
3. XPack‑MCP‑Market starten
```
docker-compose up -d
```
<br>
4. Im Browser über Port 8000 öffnen
* **Admin‑Login**: http://{IP}:8000/admin-signin
* **Benutzer**: admin
* **Passwort**: 123456789
</details>
<details>
<summary><h4>🔖 Build</h4></summary>
1. Repository klonen
```
git clone https://github.com/xpack-ai/XPack-MCP-Market.git
```
2. Projektordner öffnen
```
cd XPack-MCP-Market
```
### Frontend‑Build
> Voraussetzungen:
> - Node >= 22.x
> - Pnpm >= 10.x
1. Build‑Skript ausführen
```
cd scripts && ./frontend_build.sh && cd ../
```
Der Frontend‑Code wird nach `frontend/out` gebaut.
2. UI starten
```
cd frontend/out && node server.js
```
### Backend‑Build
> Voraussetzungen:
> - Python >= 3.11
#### Mit `uv` (empfohlen)
1. Virtuelle Umgebung erstellen
```
uv venv
```
2. Aktivieren
```
source .venv/bin/activate
```
3. Abhängigkeiten installieren
```
uv pip install -r requirements.txt
```
4. Umgebungsdatei kopieren
```
cp .env.example .env
```
5. Variablen anpassen
```
vi .env
```
6. Admin‑Backend starten
**Vordergrund**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload
```
**Hintergrund**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload &
```
7. API‑→‑MCP‑Service starten
**Vordergrund**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload
```
**Hintergrund**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload &
```
### Docker‑Build
```
docker build -t xpack-mcp-market --build-arg APP=xpack-mcp-market --build-arg VERSION=1.0.0 -f ./scripts/Dockerfile ./
```
</details>
# 📸 Screenshots
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/5f71bfcf-c128-42ab-8077-3f2ede549f80" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/d7c0b40d-182e-47a6-bcdf-bd36970f5ee6" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/ae40f659-87ad-42d4-8379-b47a48eb6a29" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/1049f4e5-ec3f-4520-8480-6d6432d6f5d2" />
<br>
# 🧾 Lizenz
XPack‑MCP‑Market steht unter der **Apache‑2.0‑Lizenz**.
Details finden Sie in der Datei [LICENSE](./LICENSE).
<br>
# 📬 Kontakt
- 🌐 Website: [https://xpack.ai](https://xpack.ai)
- 📧 E‑Mail: [contact@xpack.com](mailto:contact@xpack.com)
- 💬 Discord: [Link](https://discord.gg/cyZfcdCXkW)
<br>
# 🤝 Partner
- [Cursor](https://www.cursor.com/): KI‑gestützter Code‑Editor mit Vorschlägen für die nächste Änderung, tiefem Codeverständnis und Bearbeitung in natürlicher Sprache – für mehr Produktivität.
- [Dify](https://dify.ai/): Führende agentische KI‑Plattform mit Workflows, RAG, Integrationen und Observability; unterstützt zahlreiche LLMs und Plugins.
- [Trae](https://www.trae.ai/): KI‑native IDE mit Chat‑Interface, die „The Real AI Engineer“ verkörpert – erleichtert Code‑Generierung und ‑Assistenz, steigert Qualität und Effizienz.
- [Windsurf](https://windsurf.com/): Neues IDE‑Konzept mit KI‑Features wie „Cascade“, „Windsurf Tab“ und „Memories“ für tiefes Codeverständnis und reibungslosen Flow.
- [Coze](https://www.coze.com/): Nächste Generation der No‑Code‑Plattform von ByteDance für KI‑Apps und Chatbots – mit Workflows, proprietären Daten, Plugins und Wissensbasen.
- [Claude Code](https://www.anthropic.com/claude-code): CLI‑Tool von Anthropic mit Claude Opus 4 direkt im Terminal; Datei‑/Projekt‑übergreifende Änderungen, Befehlsausführung, IDE‑Integration.
- [Flowith](https://flowith.io/): Canvas‑basierter KI‑Arbeitsraum für Produktivität und Deep Work mit Multi‑Thread‑Agenten.
- [OpenManus](https://github.com/FoundationAgents/OpenManus): Open‑Source‑Framework zum Aufbau allgemeiner KI‑Agenten; Multi‑Agent‑Fähigkeiten, LLM‑APIs und Browser‑Automatisierung integriert.
- [Fellou](https://fellou.ai/): „Agentic Browser“, der im Auftrag des Nutzers handelt – automatisiert Recherche und Erkenntnisse, mit Integrationen wie Notion/LinkedIn.
- [Genspark](https://www.genspark.ai/): All‑in‑One‑KI‑Begleiter (AI Slides, Sheets, Chat) mit personalisierten Tools und AI Pods zur Inhaltsgenerierung aus vielfältigen Quellen.
- [TEN](https://github.com/TEN-framework/ten-framework): Open‑Source‑Framework für Echtzeit, multimodale Sprach‑Agenten – inkl. Avatar, MCP‑Integration, Hardware‑Kommunikation und Bildschirmfreigabe‑Erkennung.
- [APIPark](https://apipark.com/): Open‑Source‑Entwicklerportal und All‑in‑One‑LLM‑Gateway – einheitliche APIs, Load‑Balancing, Traffic‑Kontrolle, semantischer Cache, Prompt‑Management und Data Masking.
- [ChatGPT](https://chatgpt.com/): Von OpenAI entwickelter KI‑Chatbot auf Basis großer Sprachmodelle – kontextbewusste Dialoge, Follow‑ups, Integrationen und Produktivitätsfunktionen.
- [LangChain](https://www.langchain.com/): Plattform für robuste Agenten‑/LLM‑Apps (LangGraph, LangSmith, LangGraph Platform) – Code‑Generierung, Automatisierung und AI Search.
- [LEMON AI](https://lemonai.cc/): Erster Full‑Stack, Open‑Source, agentischer KI‑Framework – inkl. integriertem Code‑Interpreter‑VM‑Sandbox für sichere Ausführung.
- [LobeChat](https://lobehub.com/): Persönliches LLM‑Produktivitätstool zum Aufbau persönlicher Agenten und Profi‑Teams; reiches Plugin‑Ökosystem, Wissensbasis, Bild/Audio‑Funktionen.
- [VS Code](https://code.visualstudio.com/): Weit verbreiteter, kostenloser Open‑Source‑Editor mit großer Erweiterbarkeit und KI‑Funktionen wie „Agent Mode“ und intelligenten Edit‑Vorschlägen.
- [XRoute](https://xroute.ai): Vereinheitlichte Schnittstelle für LLMs – bessere Preise, höhere Durchsätze, kein Abo nötig.
- [MemU](https://github.com/NevaMind-AI/memU): Open‑Source‑Memory‑Framework für KI‑Companions.
+329
View File
@@ -0,0 +1,329 @@
# XPack
![b1](https://github.com/user-attachments/assets/3d50cd9a-9d28-4ec8-bb5f-d3668475b49e)
<p align="center">
<a href="/README.md">English</a>
|
<a href="/README-fr.md">Français</a>
|
<a href="/README-de.md">Deutsch</a>
|
<a href="/README-es.md">Español</a>
|
<a href="/README-ja.md">日本語</a>
|
<a href="/README-ko.md">한국어</a>
|
<a href="/README-zh-tw.md">繁體中文</a>
|
<a href="/README-zh-cn.md">简体中文</a>
</p>
**XPack** es el primer marketplace MCP de código abierto del mundo: crea y vende tus propios servicios MCP en cuestión de minutos.
<br>
✨ Con XPack puedes:
- ✅ **Generar con un clic la configuración OpenAPI → MCP**
- 🧾 **Portada y páginas de servicio optimizadas para SEO**
- 💳 **Facturación integrada (por llamada o por uso de tokens)**
- 👥 **Gestión de cuentas de usuario**
- 🛠 **Pagos con Stripe**
- 🔐 **Inicio de sesión con correo y Google OAuth**
Todo es open source bajo **Apache 2.0**, listo para uso comercial.
<br>
# ✨ Inicio rápido
😍 Poner XPack en marcha es facilísimo. Con **un solo comando** tendrás tu marketplace MCP online en 10 minutos.
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
[![Cómo desplegar tu marketplace MCP en 10 minutos](https://github.com/user-attachments/assets/8881d724-b6aa-47b7-bbd7-b587ef541957)](https://www.youtube.com/watch?v=XHJXyvDevd8)
<br>
# 📸 Funcionalidades
![b2](https://github.com/user-attachments/assets/c8cc89a4-ab5f-4c90-8c97-9207b5c9f5c1)
![b3](https://github.com/user-attachments/assets/16f74c8a-b35e-40a7-8471-a5736de8e904)
![b4](https://github.com/user-attachments/assets/fc76c215-7544-4267-bc6f-22a719edec00)
![b5](https://github.com/user-attachments/assets/db40ea77-58c3-472d-ba94-35dc9716a980)
<br>
## 🖥️ Requisitos del sistema
### ✅ Hardware recomendado
- **CPU**: 8 núcleos
- **Memoria**: 16 GB
- **Almacenamiento**: 200 GB
- **Sistema operativo**: Linux
- **Arquitectura**: AMD64
### ✅ Mínimos
- **CPU**: 2 núcleos
- **Memoria**: 4 GB
- **Almacenamiento**: 200 GB
- **Sistema operativo**: Linux / macOS
- **Arquitectura**: AMD64 / ARM64
<br>
## 📦 Dependencias de ejecución
**XPack-MCP-Market** requiere los siguientes servicios (autogestionados o en contenedores):
| Componente | Versión mínima |
|---|---|
| **MySQL** | ≥ 5.7.x |
| **Redis** | ≥ 6.2.x |
| **RabbitMQ**| ≥ 4.0 |
Asegúrate de que estos servicios estén disponibles y correctamente configurados antes de arrancar el backend.
<br>
## 💿 Despliegue
😍 Así de simple: con **un comando** tendrás tu marketplace MCP listo en 10 minutos.
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
<details>
<summary><h4>🔖 Despliegue con Docker-Compose</h4></summary>
Para este método, instala [Docker](https://docs.docker.com/engine/install/) y [Docker Compose](https://docs.docker.com/compose/install/standalone/).
1. Edita `docker-compose.yml`
```
vi docker-compose.yml
```
<br>
2. Ajusta la configuración (archivo de referencia: [docker-compose.yml](https://github.com/xpack-ai/XPack-MCP-Market/blob/main/scripts/docker-compose.yml))
```
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:
- /var/lib/xpack/mysql:/var/lib/mysql
networks:
- xpack
xpack-mcp-market:
image: xpackai/xpack-mcp-market
container_name: xpack-mcp-market
privileged: true
restart: always
networks:
- xpack
ports:
- "8000: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
ports:
- 6379:6379
command:
- bash
- -c
- "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass redis_6sJZDm"
networks:
- xpack
xpack-rabbitmq:
image: rabbitmq:4.1.2-alpine
container_name: xpack-rabbitmq
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
```
<br>
3. Arranca XPack-MCP-Market
```
docker-compose up -d
```
<br>
4. Accede por el puerto 3000 en el navegador
* **Inicio de sesión admin**: http://{IP}:3000/admin-signin
* **Usuario**: admin
* **Contraseña**: 123456789
</details>
<details>
<summary><h4>🔖 Compilación (Build)</h4></summary>
1. Clona el repositorio
```
git clone https://github.com/xpack-ai/XPack-MCP-Market.git
```
2. Entra al proyecto
```
cd XPack-MCP-Market
```
### Build del frontend
> Requisitos:
> - Node >= 22.x
> - Pnpm >= 10.x
1. Ejecuta el script de build
```
cd scripts && ./frontend_build.sh && cd ../
```
El código compilado quedará en `frontend/out`.
2. Inicia la interfaz
```
cd frontend/out && node server.js
```
### Build del backend
> Requisitos:
> - Python >= 3.11
#### Con `uv` (recomendado)
1. Crea el entorno virtual
```
uv venv
```
2. Actívalo
```
source .venv/bin/activate
```
3. Instala dependencias
```
uv pip install -r requirements.txt
```
4. Copia el archivo de entorno
```
cp .env.example .env
```
5. Edita las variables
```
vi .env
```
6. Inicia el servicio de administración
**Primer plano**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload
```
**Segundo plano**
````
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload &
```
7. Inicia el servicio API → MCP
**Primer plano**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload
```
**Segundo plano**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload &
```
### Build de Docker
```
docker build -t xpack-mcp-market --build-arg APP=xpack-mcp-market --build-arg VERSION=1.0.0 -f ./scripts/Dockerfile ./
```
</details>
# 📸 Capturas
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/5f71bfcf-c128-42ab-8077-3f2ede549f80" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/d7c0b40d-182e-47a6-bcdf-bd36970f5ee6" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/ae40f659-87ad-42d4-8379-b47a48eb6a29" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/1049f4e5-ec3f-4520-8480-6d6432d6f5d2" />
<br>
# 🧾 Licencia
XPack-MCP-Market se publica bajo **Apache 2.0**.
Consulta [LICENSE](./LICENSE) para más detalles.
<br>
# 📬 Contacto
- 🌐 Sitio web: [https://xpack.ai](https://xpack.ai)
- 📧 Correo: [contact@xpack.com](mailto:contact@xpack.com)
- 💬 Discord: [Link](https://discord.gg/cyZfcdCXkW)
<br>
# 🤝 Socios
- [Cursor](https://www.cursor.com/): editor de código con IA integrada en el flujo de trabajo; sugerencias contextuales, comprensión profunda del repositorio y edición en lenguaje natural.
- [Dify](https://dify.ai/): plataforma líder para desarrollo de IA agentica; cubre flujos de agentes, RAG, integraciones y observabilidad; compatible con múltiples LLMs y plugins.
- [Trae](https://www.trae.ai/): IDE nativo de IA que apunta a “The Real AI Engineer”; interfaz conversacional con generación y asistencia de código para mejorar calidad y eficiencia.
- [Windsurf](https://windsurf.com/): nuevo IDE impulsado por IA con “Cascade”, “Windsurf Tab” y “Memories” para un entendimiento profundo del código y un flujo continuo.
- [Coze](https://www.coze.com/): plataforma de ByteDance para crear apps y chatbots con IA sin código; workflows, datos propios, plugins y bases de conocimiento.
- [Claude Code](https://www.anthropic.com/claude-code): herramienta CLI de Anthropic que integra Claude Opus 4 en la terminal; edición multiarchivo, ejecución de comandos e integración con IDEs y test.
- [Flowith](https://flowith.io/): espacio de trabajo de creación con interfaz de lienzo y agentes avanzados; optimiza productividad y trabajo profundo.
- [OpenManus](https://github.com/FoundationAgents/OpenManus): framework open source para construir agentes generales; multiactor y con integración de APIs LLM y automatización de navegador.
- [Fellou](https://fellou.ai/): “navegador agéntico” que actúa por ti; automatiza la recolección de información y entrega de insights; integra con Notion/LinkedIn.
- [Genspark](https://www.genspark.ai/): compañero de IA todo en uno (AI Slides, Sheets, Chat); herramientas personalizadas y AI Pods para generar contenido desde múltiples fuentes.
- [TEN](https://github.com/TEN-framework/ten-framework): framework open source para agentes de voz multimodales en tiempo real; avatar, integración MCP, comunicación hardware y detección de pantalla.
- [APIPark](https://apipark.com/): portal de desarrolladores API open source y pasarela LLM todo en uno; API unificadas, balanceo de carga, control de tráfico, caché semántico, gestión de prompts y enmascaramiento de datos.
- [ChatGPT](https://chatgpt.com/): chatbot de OpenAI basado en LLMs; diálogo natural, comprensión de contexto, seguimiento de conversación e integración con múltiples plataformas.
- [LangChain](https://www.langchain.com/): plataforma para desarrollar agentes y apps LLM confiables (LangGraph, LangSmith, LangGraph Platform); generación de código, automatización y búsqueda con IA.
- [LEMON AI](https://lemonai.cc/): primer framework agentico full‑stack, open source; incluye sandbox VM del intérprete de código para ejecución segura.
- [LobeChat](https://lobehub.com/): herramienta de productividad LLM personal; permite crear agentes personales y equipos profesionales; plugins, base de conocimiento, visión y voz.
- [VS Code](https://code.visualstudio.com/): editor de código open source extensible, con funciones de IA como sugerencias inteligentes y “modo agente”.
- [XRoute](https://xroute.ai): interfaz unificada para LLMs; mejores precios, mejor throughput, sin suscripción.
- [MemU](https://github.com/NevaMind-AI/memU): framework de memoria open source para compañeros de IA.
+328
View File
@@ -0,0 +1,328 @@
# XPack
![b1](https://github.com/user-attachments/assets/3d50cd9a-9d28-4ec8-bb5f-d3668475b49e)
<p align="center">
<a href="/README.md">English</a>
|
<a href="/README-fr.md">Français</a>
|
<a href="/README-de.md">Deutsch</a>
|
<a href="/README-es.md">Español</a>
|
<a href="/README-ja.md">日本語</a>
|
<a href="/README-ko.md">한국어</a>
|
<a href="/README-zh-tw.md">繁體中文</a>
|
<a href="/README-zh-cn.md">简体中文</a>
</p>
**XPack** est le premier marketplace MCP open‑source au monde. Créez et vendez vos services MCP en quelques minutes.
<br>
✨ Avec XPack, vous pouvez :
- ✅ **Générer en un clic la configuration OpenAPI → MCP**
- 🧾 **Page d’accueil et pages service optimisées pour le SEO**
- 💳 **Facturation intégrée (par appel ou à l’usage de jetons)**
- 👥 **Gestion des comptes utilisateurs**
- 🛠 **Prise en charge des paiements Stripe**
- 🔐 **Connexion via e‑mail et Google OAuth**
Tout est open source sous **Apache 2.0**, prêt pour un usage commercial.
<br>
# ✨ Démarrage rapide
😍 Déployer XPack est ultra simple. **Une seule commande** suffit pour mettre votre marketplace MCP en ligne en 10 minutes.
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
[![Déployer votre marketplace MCP en 10 minutes](https://github.com/user-attachments/assets/8881d724-b6aa-47b7-bbd7-b587ef541957)](https://www.youtube.com/watch?v=XHJXyvDevd8)
<br>
# 📸 Fonctionnalités
![b2](https://github.com/user-attachments/assets/c8cc89a4-ab5f-4c90-8c97-9207b5c9f5c1)
![b3](https://github.com/user-attachments/assets/16f74c8a-b35e-40a7-8471-a5736de8e904)
![b4](https://github.com/user-attachments/assets/fc76c215-7544-4267-bc6f-22a719edec00)
![b5](https://github.com/user-attachments/assets/db40ea77-58c3-472d-ba94-35dc9716a980)
<br>
## 🖥️ Configuration système requise
### ✅ Configuration recommandée
- **CPU** : 8 cœurs
- **Mémoire** : 16 Go
- **Stockage** : 200 Go
- **Système** : Linux
- **Architecture** : AMD64
### ✅ Configuration minimale
- **CPU** : 2 cœurs
- **Mémoire** : 4 Go
- **Stockage** : 200 Go
- **Système** : Linux / macOS
- **Architecture** : AMD64 / ARM64
<br>
## 📦 Dépendances d’exécution
**XPack‑MCP‑Market** nécessite les services suivants (auto‑hébergés ou en conteneur) :
| Composant | Version minimale |
|---|---|
| **MySQL** | ≥ 5.7.x |
| **Redis** | ≥ 6.2.x |
| **RabbitMQ**| ≥ 4.0 |
Assurez‑vous que ces services sont disponibles et correctement configurés avant de lancer le backend.
<br>
## 💿 Déploiement
😍 Tellement simple : **une commande** pour déployer votre marketplace MCP en 10 minutes.
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
<details>
<summary><h4>🔖 Déploiement avec Docker‑Compose</h4></summary>
Pour cette méthode, installez [Docker](https://docs.docker.com/engine/install/) et [Docker Compose](https://docs.docker.com/compose/install/standalone/).
1. Éditez `docker-compose.yml`
```
vi docker-compose.yml
```
<br>
2. Modifiez la configuration (exemple de référence : [docker-compose.yml](https://github.com/xpack-ai/XPack-MCP-Market/blob/main/scripts/docker-compose.yml))
```
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:
- /var/lib/xpack/mysql:/var/lib/mysql
networks:
- xpack
xpack-mcp-market:
image: xpackai/xpack-mcp-market
container_name: xpack-mcp-market
privileged: true
restart: always
networks:
- xpack
ports:
- "8000: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
ports:
- 6379:6379
command:
- bash
- -c
- "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass redis_6sJZDm"
networks:
- xpack
xpack-rabbitmq:
image: rabbitmq:4.1.2-alpine
container_name: xpack-rabbitmq
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
```
<br>
3. Démarrez XPack‑MCP‑Market
```
docker-compose up -d
```
<br>
4. Accédez à l’interface sur le port 8000
* **Connexion admin** : http://{IP}:8000/admin-signin
* **Utilisateur** : admin
* **Mot de passe** : 123456789
</details>
<details>
<summary><h4>🔖 Build</h4></summary>
1. Clonez le dépôt
```
git clone https://github.com/xpack-ai/XPack-MCP-Market.git
```
2. Ouvrez le projet
```
cd XPack-MCP-Market
```
### Build frontend
> Prérequis :
> - Node >= 22.x
> - Pnpm >= 10.x
1. Lancez le script de build
```
cd scripts && ./frontend_build.sh && cd ../
```
Le frontend compilé est disponible dans `frontend/out`.
2. Démarrez l’interface
```
cd frontend/out && node server.js
```
### Build backend
> Prérequis :
> - Python >= 3.11
#### Avec `uv` (recommandé)
1. Créez l’environnement virtuel
```
uv venv
```
2. Activez‑le
```
source .venv/bin/activate
```
3. Installez les dépendances
```
uv pip install -r requirements.txt
```
4. Copiez le fichier d’environnement
```
cp .env.example .env
```
5. Modifiez les variables
```
vi .env
```
6. Démarrez le service d’administration
**Premier plan**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload
```
**Arrière‑plan**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload &
```
7. Démarrez le service API → MCP
**Premier plan**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload
```
**Arrière‑plan**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload &
```
### Build Docker
```
docker build -t xpack-mcp-market --build-arg APP=xpack-mcp-market --build-arg VERSION=1.0.0 -f ./scripts/Dockerfile ./
```
</details>
# 📸 Captures d’écran
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/5f71bfcf-c128-42ab-8077-3f2ede549f80" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/d7c0b40d-182e-47a6-bcdf-bd36970f5ee6" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/ae40f659-87ad-42d4-8379-b47a48eb6a29" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/1049f4e5-ec3f-4520-8480-6d6432d6f5d2" />
<br>
# 🧾 Licence
XPack‑MCP‑Market est publié sous **Apache 2.0**.
Pour plus d’informations, consultez le fichier [LICENSE](./LICENSE).
<br>
# 📬 Contact
- 🌐 Site web : [https://xpack.ai](https://xpack.ai)
- 📧 E‑mail : [contact@xpack.com](mailto:contact@xpack.com)
- 💬 Discord : [Link](https://discord.gg/cyZfcdCXkW)
<br>
# 🤝 Partenaires
- [Cursor](https://www.cursor.com/) : éditeur de code propulsé par l’IA, intégré au flux de travail, avec propositions d’édition, compréhension profonde du code et édition en langage naturel.
- [Dify](https://dify.ai/) : principale plateforme de développement d’IA agentique, couvrant workflows d’agents, RAG, intégrations et observabilité, avec prise en charge de nombreux LLM et plugins.
- [Trae](https://www.trae.ai/) : IDE natif IA visant “The Real AI Engineer”, interface conversationnelle, génération et assistance de code pour améliorer qualité et productivité.
- [Windsurf](https://windsurf.com/) : IDE nouvelle génération exploitant l’IA avec “Cascade”, “Windsurf Tab” et “Memories” pour une compréhension profonde et un flux ininterrompu.
- [Coze](https://www.coze.com/) : plateforme ByteDance pour créer des chatbots et apps IA sans code, avec workflows, données propriétaires, plugins, bases de connaissances et modèles prêts à l’emploi.
- [Claude Code](https://www.anthropic.com/claude-code) : outil CLI d’Anthropic intégrant Claude Opus 4 dans le terminal, avec édition multi‑fichiers, exécution de commandes et intégration IDE/tests.
- [Flowith](https://flowith.io/) : espace de création basé sur un canvas multi‑fils, optimisé pour la productivité et le deep work via des agents avancés.
- [OpenManus](https://github.com/FoundationAgents/OpenManus) : framework open‑source pour bâtir des agents IA généraux, multi‑agents, intégrable avec des API LLM et l’automatisation navigateur.
- [Fellou](https://fellou.ai/) : “navigateur agentique” qui agit pour l’utilisateur, automatisant la collecte d’infos et la synthèse, avec intégrations Notion/LinkedIn.
- [Genspark](https://www.genspark.ai/) : compagnon IA tout‑en‑un (AI Slides, Sheets, Chat), outils personnalisés et AI Pods pour générer du contenu à partir de multiples sources.
- [TEN](https://github.com/TEN-framework/ten-framework) : framework open‑source pour agents vocaux multimodaux en temps réel, avec avatar, intégration MCP, communication matérielle et détection d’écran.
- [APIPark](https://apipark.com/) : portail développeur API open‑source et passerelle LLM tout‑en‑un, avec API unifiées, répartition de charge, contrôle de trafic, cache sémantique, gestion de prompts et masquage de données.
- [ChatGPT](https://chatgpt.com/) : chatbot d’OpenAI fondé sur des LLM, dialogues naturels, compréhension du contexte, intégrations variées et fonctions avancées de productivité.
- [LangChain](https://www.langchain.com/) : plateforme robuste pour développer agents et apps LLM (LangGraph, LangSmith, LangGraph Platform), pour génération de code, automatisation et recherche IA.
- [LEMON AI](https://lemonai.cc/) : premier framework IA agentique full‑stack open‑source, avec bac à sable VM d’interpréteur de code pour une exécution sécurisée.
- [LobeChat](https://lobehub.com/) : outil de productivité LLM personnel, pour créer des agents personnels/équipes, avec vaste écosystème de plugins, base de connaissances et fonctions image/voix.
- [VS Code](https://code.visualstudio.com/) : éditeur de code open‑source très populaire et extensible, compatible avec de nombreuses langues et doté de fonctions IA comme le “mode agent”.
- [XRoute](https://xroute.ai) : interface unifiée pour les LLM, meilleurs prix, meilleur débit, sans abonnement.
- [MemU](https://github.com/NevaMind-AI/memU) : framework mémoire open‑source pour compagnons IA.
+328
View File
@@ -0,0 +1,328 @@
# XPack
![b1](https://github.com/user-attachments/assets/3d50cd9a-9d28-4ec8-bb5f-d3668475b49e)
<p align="center">
<a href="/README.md">English</a>
|
<a href="/README-fr.md">Français</a>
|
<a href="/README-de.md">Deutsch</a>
|
<a href="/README-es.md">Español</a>
|
<a href="/README-ja.md">日本語</a>
|
<a href="/README-ko.md">한국어</a>
|
<a href="/README-zh-tw.md">繁體中文</a>
|
<a href="/README-zh-cn.md">简体中文</a>
</p>
**XPack** は世界初のオープンソース MCP マーケットプレイスです。数分で自分の MCP サービスを作成して販売できます。
<br>
✨ XPack でできること
- ✅ **OpenAPI → MCP サービス設定をワンクリック生成**
- 🧾 **SEO に強いトップページ + MCP サービスページ**
- 💳 **内蔵課金(リクエスト数 / トークン消費ベース)**
- 👥 **ユーザーアカウント管理**
- 🛠 **Stripe 決済対応**
- 🔐 **Email & Google OAuth サインイン対応**
すべて **Apache 2.0** のオープンソース。商用利用も安心です。
<br>
# ✨ クイックスタート
😍 導入はとても簡単。**1 行のコマンド**で、10 分であなたの MCP マーケットを立ち上げられます。
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
[![10分で MCP マーケットをデプロイする方法](https://github.com/user-attachments/assets/8881d724-b6aa-47b7-bbd7-b587ef541957)](https://www.youtube.com/watch?v=XHJXyvDevd8)
<br>
# 📸 機能
![b2](https://github.com/user-attachments/assets/c8cc89a4-ab5f-4c90-8c97-9207b5c9f5c1)
![b3](https://github.com/user-attachments/assets/16f74c8a-b35e-40a7-8471-a5736de8e904)
![b4](https://github.com/user-attachments/assets/fc76c215-7544-4267-bc6f-22a719edec00)
![b5](https://github.com/user-attachments/assets/db40ea77-58c3-472d-ba94-35dc9716a980)
<br>
## 🖥️ システム要件
### ✅ 推奨ハードウェア
- **CPU**: 8 コア
- **メモリ**: 16 GB
- **ストレージ**: 200 GB
- **OS**: Linux
- **アーキテクチャ**: AMD64
### ✅ 最低要件
- **CPU**: 2 コア
- **メモリ**: 4 GB
- **ストレージ**: 200 GB
- **OS**: Linux / macOS
- **アーキテクチャ**: AMD64 / ARM64
<br>
## 📦 実行時依存関係
**XPack-MCP-Market** を実行するには、以下のサービス(セルフホストまたはコンテナ)が必要です。
| コンポーネント | 最低バージョン |
|---|---|
| **MySQL** | ≥ 5.7.x |
| **Redis** | ≥ 6.2.x |
| **RabbitMQ**| ≥ 4.0 |
これらのサービスが利用可能で、正しく設定されていることを確認してください。
<br>
## 💿 デプロイ
😍 導入はとても簡単。**1 行のコマンド**で、10 分であなたの MCP マーケットを立ち上げられます。
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
<details>
<summary><h4>🔖 Docker-Compose デプロイ</h4></summary>
この方法でインストールするには、[Docker](https://docs.docker.com/engine/install/) と [Docker Compose](https://docs.docker.com/compose/install/standalone/) が必要です。
1. `docker-compose.yml` を編集
```
vi docker-compose.yml
```
<br>
2. 設定を変更します。元のファイルは [docker-compose.yml](https://github.com/xpack-ai/XPack-MCP-Market/blob/main/scripts/docker-compose.yml) を参照してください。
```
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:
- /var/lib/xpack/mysql:/var/lib/mysql
networks:
- xpack
xpack-mcp-market:
image: xpackai/xpack-mcp-market
container_name: xpack-mcp-market
privileged: true
restart: always
networks:
- xpack
ports:
- "8000: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
ports:
- 6379:6379
command:
- bash
- -c
- "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass redis_6sJZDm"
networks:
- xpack
xpack-rabbitmq:
image: rabbitmq:4.1.2-alpine
container_name: xpack-rabbitmq
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
```
<br>
3. XPack-MCP-Market を起動
```
docker-compose up -d
```
<br>
4. ブラウザでポート 8000 にアクセス
* **管理画面ログイン**: http://{IP}:8000/admin-signin
* **管理ユーザー**: admin
* **管理パスワード**: 123456789
</details>
<details>
<summary><h4>🔖 ビルド</h4></summary>
1. リポジトリをクローン
```
git clone https://github.com/xpack-ai/XPack-MCP-Market.git
```
2. プロジェクトへ移動
```
cd XPack-MCP-Market
```
### フロントエンドビルド
> 要件:
> - Node >= 22.x
> - Pnpm >= 10.x
1. ビルドスクリプトを実行
```
cd scripts && ./frontend_build.sh && cd ../
```
ビルド後、フロントエンドは `frontend/out` に出力されます。
2. UI を起動
```
cd frontend/out && node server.js
```
### バックエンドビルド
> 要件:
> - Python >= 3.11
#### `uv` を使用(推奨)
1. 仮想環境を作成
```
uv venv
```
2. 仮想環境を有効化
```
source .venv/bin/activate
```
3. 依存関係をインストール
```
uv pip install -r requirements.txt
```
4. 環境変数ファイルをコピー
```
cp .env.example .env
```
5. 環境変数を編集
```
vi .env
```
6. 管理用バックエンドサービスを起動
**フォアグラウンド**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload
```
**バックグラウンド**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload &
```
7. API → MCP サービスを起動
**フォアグラウンド**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload
```
**バックグラウンド**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload &
```
### Docker ビルド
```
docker build -t xpack-mcp-market --build-arg APP=xpack-mcp-market --build-arg VERSION=1.0.0 -f ./scripts/Dockerfile ./
```
</details>
# 📸 スクリーンショット
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/5f71bfcf-c128-42ab-8077-3f2ede549f80" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/d7c0b40d-182e-47a6-bcdf-bd36970f5ee6" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/ae40f659-87ad-42d4-8379-b47a48eb6a29" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/1049f4e5-ec3f-4520-8480-6d6432d6f5d2" />
<br>
# 🧾 ライセンス
XPack-MCP-Market は **Apache 2.0** ライセンスで提供されています。
詳細は [LICENSE](./LICENSE) をご覧ください。
<br>
# 📬 お問い合わせ
- 🌐 Website: [https://xpack.ai](https://xpack.ai)
- 📧 Email: [contact@xpack.com](mailto:contact@xpack.com)
- 💬 Discord:[Link](https://discord.gg/cyZfcdCXkW)
<br>
# 🤝 パートナー
- [Cursor](https://www.cursor.com/): Cursor は AI をエディタに統合し、次の編集候補、コードベースの深い理解、自然言語での編集などを提供する AI コードエディタです。開発効率を高めます。
- [Dify](https://dify.ai/): Dify はエージェンティック AI 開発プラットフォームのリーダーで、エージェントワークフロー、RAG、各種統合、可観測性など、AI アプリ構築に必要な一式を提供します。多数の LLM とプラグインに対応。
- [Trae](https://www.trae.ai/): Trae は「真の AI エンジニア」を体現することを目指した AI ネイティブ IDE。チャットベースの UI でコード生成や支援を行い、品質と生産性を向上させます。
- [Windsurf](https://windsurf.com/): Windsurf は AI を活用した新しい IDE。深いコード理解のための「Cascade」、賢い補完「Windsurf Tab」、コードベースの記憶「Memories」などを備え、開発の流れを途切れさせません。
- [Coze](https://www.coze.com/): Coze は ByteDance の次世代 AI アプリ/チャットボット開発プラットフォーム。ノーコードのビルダー、ワークフロー、独自データ接続、プラグイン/ナレッジベースで簡単に強力なボットを作成できます。
- [Claude Code](https://www.anthropic.com/claude-code): Claude Code は Anthropic の CLI ツール。ターミナルに Claude Opus 4 を組み込み、リポジトリ横断編集、コマンド実行、IDE 連携、テスト連携などを実現します。
- [Flowith](https://flowith.io/): Flowith はキャンバス型 UI の AI ワークスペース。マルチスレッドのエージェント体験で知識変換と深い作業に最適化し、従来のチャット型を越える体験を提供します。
- [OpenManus](https://github.com/FoundationAgents/OpenManus): OpenManus は汎用 AI エージェント構築のための OSS フレームワーク。複数エージェントに対応し、LLM API やブラウザ自動化ツールと統合可能です。
- [Fellou](https://fellou.ai/): Fellou は行動まで担う「エージェンティックブラウザ」。情報収集から洞察提示までを自動化し、Notion/LinkedIn などとも連携します。
- [Genspark](https://www.genspark.ai/): Genspark は AI Slides / Sheets / Chat などを備えたオールインワンの AI コンパニオン。AI Pods による多様なコンテンツ生成が可能です。
- [TEN](https://github.com/TEN-framework/ten-framework): TEN(The Embodied Narrator)はリアルタイム・マルチモーダル音声エージェントの OSS。アバター、MCP 連携、ハードウェア通信、画面共有検出などを備えます。
- [APIPark](https://apipark.com/): APIPark は OSS のエンタープライズ API デベロッパーポータルかつオールインワン LLM ゲートウェイ。統一 API、負荷分散、トラフィック制御、セマンティックキャッシュ、プロンプト管理、マスキング等で安全・安定運用を実現。
- [ChatGPT](https://chatgpt.com/): ChatGPT は OpenAI の対話型 AI。高度な言語理解と生成で、追質問対応や各種プラットフォーム統合を通じて生産性を高めます。
- [LangChain](https://www.langchain.com/): LangChain は堅牢なエージェント/LLM アプリ開発プラットフォーム。LangGraph / LangSmith / LangGraph Platform により、コード生成、自動化、AI 検索を横断的に支援します。
- [LEMON AI](https://lemonai.cc/): Lemon AI はフルスタックなオープンソース・エージェンティック AI フレームワーク。安全な実行のための組み込み Code Interpreter VM サンドボックスを備えます。
- [LobeChat](https://lobehub.com/): LobeHub の LobeChat は個人向け LLM 生産性ツール。個人エージェント/チーム構築、豊富なプラグイン、知識ベース、画像/音声対応などを提供します。
- [VS Code](https://code.visualstudio.com/): Visual Studio Code は拡張性が高い OSS エディタ。多言語対応と AI 機能(次の編集候補、エージェントモード等)を備えます。
- [XRoute](https://xroute.ai): 複数 LLM を単一インターフェースで扱えるゲートウェイ。より良い価格とスループット、サブスクリプション不要を提供します。
- [MemU](https://github.com/NevaMind-AI/memU): MemU は AI コンパニオン向けのオープンソース記憶フレームワークです。
+328
View File
@@ -0,0 +1,328 @@
# XPack
![b1](https://github.com/user-attachments/assets/3d50cd9a-9d28-4ec8-bb5f-d3668475b49e)
<p align="center">
<a href="/README.md">English</a>
|
<a href="/README-fr.md">Français</a>
|
<a href="/README-de.md">Deutsch</a>
|
<a href="/README-es.md">Español</a>
|
<a href="/README-ja.md">日本語</a>
|
<a href="/README-ko.md">한국어</a>
|
<a href="/README-zh-tw.md">繁體中文</a>
|
<a href="/README-zh-cn.md">简体中文</a>
</p>
**XPack** 는 세계 최초의 오픈 소스 MCP 마켓플레이스입니다. 몇 분 만에 나만의 MCP 서비스를 만들고 판매하세요.
<br>
✨ XPack으로 할 수 있는 일
- ✅ **OpenAPI → MCP 서비스 설정을 원클릭으로 생성**
- 🧾 **SEO 친화적 홈페이지 + 서비스 상세 페이지**
- 💳 **내장 과금(요청 수 / 토큰 사용량 기준)**
- 👥 **사용자 계정 관리**
- 🛠 **Stripe 결제 지원**
- 🔐 **이메일 & Google OAuth 로그인 지원**
모든 코드는 **Apache 2.0** 라이선스로 공개되어 있으며, 상업적 사용이 가능합니다.
<br>
# ✨ 빠른 시작
😍 정말 간단합니다. **한 줄 명령어**로 10분 만에 MCP 마켓을 배포할 수 있습니다.
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
[![10분 만에 MCP 마켓 배포하기](https://github.com/user-attachments/assets/8881d724-b6aa-47b7-bbd7-b587ef541957)](https://www.youtube.com/watch?v=XHJXyvDevd8)
<br>
# 📸 기능
![b2](https://github.com/user-attachments/assets/c8cc89a4-ab5f-4c90-8c97-9207b5c9f5c1)
![b3](https://github.com/user-attachments/assets/16f74c8a-b35e-40a7-8471-a5736de8e904)
![b4](https://github.com/user-attachments/assets/fc76c215-7544-4267-bc6f-22a719edec00)
![b5](https://github.com/user-attachments/assets/db40ea77-58c3-472d-ba94-35dc9716a980)
<br>
## 🖥️ 시스템 요구 사항
### ✅ 권장 하드웨어
- **CPU**: 8코어
- **메모리**: 16 GB
- **스토리지**: 200 GB
- **운영체제**: Linux
- **아키텍처**: AMD64
### ✅ 최소 사양
- **CPU**: 2코어
- **메모리**: 4 GB
- **스토리지**: 200 GB
- **운영체제**: Linux / macOS
- **아키텍처**: AMD64 / ARM64
<br>
## 📦 런타임 의존성
**XPack-MCP-Market** 실행에는 다음 서비스가 필요합니다(셀프 호스팅 또는 컨테이너).
| 구성 요소 | 최소 버전 |
|---|---|
| **MySQL** | ≥ 5.7.x |
| **Redis** | ≥ 6.2.x |
| **RabbitMQ**| ≥ 4.0 |
실행 전에 위 서비스가 준비되어 있고 올바르게 설정되었는지 확인하세요.
<br>
## 💿 배포
😍 **한 줄 명령어**로 10분 만에 MCP 마켓을 배포할 수 있습니다.
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
<details>
<summary><h4>🔖 Docker-Compose 배포</h4></summary>
이 방법을 사용하려면 [Docker](https://docs.docker.com/engine/install/) 와 [Docker Compose](https://docs.docker.com/compose/install/standalone/) 가 필요합니다.
1. `docker-compose.yml` 편집
```
vi docker-compose.yml
```
<br>
2. 설정 변경(원본 예시는 [docker-compose.yml](https://github.com/xpack-ai/XPack-MCP-Market/blob/main/scripts/docker-compose.yml) 참고)
```
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:
- /var/lib/xpack/mysql:/var/lib/mysql
networks:
- xpack
xpack-mcp-market:
image: xpackai/xpack-mcp-market
container_name: xpack-mcp-market
privileged: true
restart: always
networks:
- xpack
ports:
- "8000: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
ports:
- 6379:6379
command:
- bash
- -c
- "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass redis_6sJZDm"
networks:
- xpack
xpack-rabbitmq:
image: rabbitmq:4.1.2-alpine
container_name: xpack-rabbitmq
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
```
<br>
3. XPack-MCP-Market 시작
```
docker-compose up -d
```
<br>
4. 브라우저에서 8000 포트로 접속
* **관리자 로그인 주소**: http://{IP}:8000/admin-signin
* **관리자 계정**: admin
* **관리자 비밀번호**: 123456789
</details>
<details>
<summary><h4>🔖 빌드</h4></summary>
1. 리포지토리 클론
```
git clone https://github.com/xpack-ai/XPack-MCP-Market.git
```
2. 프로젝트 디렉토리로 이동
```
cd XPack-MCP-Market
```
### 프런트엔드 빌드
> 요구 사항:
> - Node >= 22.x
> - Pnpm >= 10.x
1. 빌드 스크립트 실행
```
cd scripts && ./frontend_build.sh && cd ../
```
빌드가 완료되면 `frontend/out` 디렉터리에 생성됩니다.
2. UI 서버 시작
```
cd frontend/out && node server.js
```
### 백엔드 빌드
> 요구 사항:
> - Python >= 3.11
#### `uv` 사용(권장)
1. 가상 환경 생성
```
uv venv
```
2. 가상 환경 활성화
```
source .venv/bin/activate
```
3. 의존성 설치
```
uv pip install -r requirements.txt
```
4. 환경 변수 파일 복사
```
cp .env.example .env
```
5. 환경 변수 편집
```
vi .env
```
6. 관리자 백엔드 서비스 시작
**포그라운드**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload
```
**백그라운드**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload &
```
7. API → MCP 서비스 시작
**포그라운드**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload
```
**백그라운드**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload &
```
### Docker 빌드
```
docker build -t xpack-mcp-market --build-arg APP=xpack-mcp-market --build-arg VERSION=1.0.0 -f ./scripts/Dockerfile ./
```
</details>
# 📸 스크린샷
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/5f71bfcf-c128-42ab-8077-3f2ede549f80" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/d7c0b40d-182e-47a6-bcdf-bd36970f5ee6" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/ae40f659-87ad-42d4-8379-b47a48eb6a29" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/1049f4e5-ec3f-4520-8480-6d6432d6f5d2" />
<br>
# 🧾 라이선스
XPack-MCP-Market 는 **Apache 2.0** 라이선스로 배포됩니다.
자세한 내용은 [LICENSE](./LICENSE) 를 확인하세요.
<br>
# 📬 문의
- 🌐 Website: [https://xpack.ai](https://xpack.ai)
- 📧 Email: [contact@xpack.com](mailto:contact@xpack.com)
- 💬 Discord: [Link](https://discord.gg/cyZfcdCXkW)
<br>
# 🤝 파트너
- [Cursor](https://www.cursor.com/): Cursor는 AI를 에디터에 직접 통합하여 다음 편집 제안, 코드베이스 심층 이해, 자연어 편집 등을 제공하는 AI 코드 에디터입니다.
- [Dify](https://dify.ai/): Dify는 에이전틱 AI 개발 플랫폼으로, 에이전트 워크플로우, RAG, 통합, 가시성 등 AI 앱 구축에 필요한 모든 것을 제공합니다. 다양한 LLM과 플러그인을 지원합니다.
- [Trae](https://www.trae.ai/): Trae는 “The Real AI Engineer”를 표방하는 AI 네이티브 IDE로, 챗 기반 인터페이스로 코드 생성/도움을 제공하며 품질과 효율을 높입니다.
- [Windsurf](https://windsurf.com/): Windsurf는 AI 기반의 새로운 IDE입니다. 깊은 코드 이해를 위한 “Cascade”, 지능형 자동완성 “Windsurf Tab”, 코드 기억 “Memories” 등을 제공합니다.
- [Coze](https://www.coze.com/): Coze는 ByteDance의 차세대 AI 애플리케이션/챗봇 개발 플랫폼으로, 노코드 빌더와 워크플로우, 독자 데이터 연동, 플러그인·지식베이스로 손쉽게 강력한 봇을 만들 수 있습니다.
- [Claude Code](https://www.anthropic.com/claude-code): Claude Code는 터미널에 Claude Opus 4를 내장하는 CLI 도구로, 파일 편집/명령 실행/다중 파일 변경/IDE 통합을 지원합니다.
- [Flowith](https://flowith.io/): Flowith는 캔버스 기반 UI의 AI 작업 공간으로, 멀티 스레드형 에이전트 경험을 통해 지식 변환과 몰입 작업을 최적화합니다.
- [OpenManus](https://github.com/FoundationAgents/OpenManus): OpenManus는 범용 AI 에이전트 구축을 위한 오픈소스 프레임워크입니다. 다중 에이전트와 LLM/브라우저 자동화를 통합할 수 있습니다.
- [Fellou](https://fellou.ai/): Fellou는 사용자 대신 행동하는 “에이전틱 브라우저”로, 정보 수집부터 인사이트 제공까지 자동화하며 Notion/LinkedIn 등과도 연동됩니다.
- [Genspark](https://www.genspark.ai/): Genspark는 AI Slides/Sheets/Chat을 포함한 올인원 AI 동반자 제품으로, AI Pods를 통해 다양한 소스에서 콘텐츠를 생성합니다.
- [TEN](https://github.com/TEN-framework/ten-framework): TEN(The Embodied Narrator)은 실시간 멀티모달 음성 에이전트를 위한 오픈소스 프레임워크로, 아바타, MCP 연동, 하드웨어 통신, 화면 공유 감지 등을 제공합니다.
- [APIPark](https://apipark.com/): APIPark는 오픈소스 엔터프라이즈 API 개발자 포털이자 올인원 LLM 게이트웨이로, 통합 API 시그니처, 로드밸런싱, 트래픽 제어, 의미적 캐시, 프롬프트 관리, 데이터 마스킹 등을 지원합니다.
- [ChatGPT](https://chatgpt.com/): ChatGPT는 OpenAI가 개발한 대화형 AI로, 맥락 이해와 생성 능력을 바탕으로 후속 질문 처리와 다양한 플랫폼 통합을 지원합니다.
- [LangChain](https://www.langchain.com/): LangChain은 신뢰성 있는 에이전트/LLM 앱 개발 플랫폼으로, LangGraph/LangSmith/LangGraph Platform을 통해 코드 생성, 자동화, AI 검색을 지원합니다.
- [LEMON AI](https://lemonai.cc/): Lemon AI는 풀스택 오픈소스 에이전틱 AI 프레임워크로, 안전한 실행을 위한 내장 Code Interpreter VM 샌드박스를 제공합니다.
- [LobeChat](https://lobehub.com/): LobeChat은 개인 LLM 생산성 도구로, 개인 에이전트/전문 팀 구축, 플러그인 생태계, 지식 베이스, 이미지/음성 기능 등을 제공합니다.
- [VS Code](https://code.visualstudio.com/): Visual Studio Code는 확장성이 뛰어난 오픈소스 코드 에디터로, 다양한 언어를 지원하고 지능형 다음 편집 제안 및 “에이전트 모드” 같은 AI 기능을 갖추고 있습니다.
- [XRoute](https://xroute.ai): 여러 LLM을 단일 인터페이스로 제공하는 게이트웨이로, 더 나은 가격/처리량을 제공하며 구독이 필요 없습니다.
- [MemU](https://github.com/NevaMind-AI/memU): MemU는 AI 컴패니언을 위한 오픈소스 메모리 프레임워크입니다.
+14 -2
View File
@@ -4,6 +4,18 @@
<p align="center">
<a href="/README.md">English</a>
|
<a href="/README-fr.md">Français</a>
|
<a href="/README-de.md">Deutsch</a>
|
<a href="/README-es.md">Español</a>
|
<a href="/README-ja.md">日本語</a>
|
<a href="/README-ko.md">한국어</a>
|
<a href="/README-zh-tw.md">繁體中文</a>
|
<a href="/README-zh-cn.md">简体中文</a>
</p>
@@ -88,7 +100,7 @@ curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
支持系统包括:
- CentOS 7.9 / 8.5
- Ubuntu 20.04 / 22.04
- Ubuntu 20.04 / 22.04 / 24.04
- Debian 12.4
- 阿里云 Linux 2.1903 / 3.2104
@@ -113,7 +125,7 @@ curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
docker-compose up -d
```
4. 打开浏览器访问 `http://localhost:3000` 使用平台
4. 打开浏览器访问 `http://localhost:8000` 使用平台
</details>
+329
View File
@@ -0,0 +1,329 @@
# XPack
![b1](https://github.com/user-attachments/assets/3d50cd9a-9d28-4ec8-bb5f-d3668475b49e)
<p align="center">
<a href="/README.md">English</a>
|
<a href="/README-fr.md">Français</a>
|
<a href="/README-de.md">Deutsch</a>
|
<a href="/README-es.md">Español</a>
|
<a href="/README-ja.md">日本語</a>
|
<a href="/README-ko.md">한국어</a>
|
<a href="/README-zh-tw.md">繁體中文</a>
|
<a href="/README-zh-cn.md">简体中文</a>
</p>
**XPack** 是全球首個開源的 MCP 市集,讓你在幾分鐘內就能建立並販售自己的 MCP 服務。
<br>
✨ 使用 XPack 你可以:
- ✅ **一鍵將 OpenAPI 轉為 MCP 服務**
- 🧾 **SEO 友善的首頁與服務頁**
- 💳 **內建計費(按调用次數或 Token 使用量)**
- 👥 **使用者帳號管理**
- 🛠 **支援 Stripe 金流**
- 🔐 **支援 Email 與 Google OAuth 登入**
所有原始碼皆採用 **Apache 2.0** 授權,商用無虞。
<br>
# ✨ 快速開始
😍 部署非常簡單,以 **一行指令** 即可在 10 分鐘內架起你的 MCP 市集。
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
[![10 分鐘部署你的 MCP 市集](https://github.com/user-attachments/assets/8881d724-b6aa-47b7-bbd7-b587ef541957)](https://www.youtube.com/watch?v=XHJXyvDevd8)
<br>
# 📸 功能
![b2](https://github.com/user-attachments/assets/c8cc89a4-ab5f-4c90-8c97-9207b5c9f5c1)
![b3](https://github.com/user-attachments/assets/16f74c8a-b35e-40a7-8471-a5736de8e904)
![b4](https://github.com/user-attachments/assets/fc76c215-7544-4267-bc6f-22a719edec00)
![b5](https://github.com/user-attachments/assets/db40ea77-58c3-472d-ba94-35dc9716a980)
<br>
## 🖥️ 系統需求
### ✅ 建議硬體
- **CPU**:8 核心
- **記憶體**:16 GB
- **儲存空間**:200 GB
- **作業系統**:Linux
- **架構**:AMD64
### ✅ 最低需求
- **CPU**:2 核心
- **記憶體**:4 GB
- **儲存空間**:200 GB
- **作業系統**:Linux / macOS
- **架構**:AMD64 / ARM64
<br>
## 📦 執行相依
**XPack-MCP-Market** 需要以下服務(自架或容器化):
| 元件 | 最低版本 |
|---|---|
| **MySQL** | ≥ 5.7.x |
| **Redis** | ≥ 6.2.x |
| **RabbitMQ**| ≥ 4.0 |
請先確保上述服務已可用且設定正確,再啟動後端。
<br>
## 💿 部署
😍 就這麼簡單:用 **一行指令**,10 分鐘內完成部署。
```bash
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
<details>
<summary><h4>🔖 以 Docker-Compose 部署</h4></summary>
使用此方法前,請先安裝 [Docker](https://docs.docker.com/engine/install/) 與 [Docker Compose](https://docs.docker.com/compose/install/standalone/)。
1. 編輯 `docker-compose.yml`
```
vi docker-compose.yml
```
<br>
2. 修改設定,可參考原始檔 [docker-compose.yml](https://github.com/xpack-ai/XPack-MCP-Market/blob/main/scripts/docker-compose.yml)
```
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:
- /var/lib/xpack/mysql:/var/lib/mysql
networks:
- xpack
xpack-mcp-market:
image: xpackai/xpack-mcp-market
container_name: xpack-mcp-market
privileged: true
restart: always
networks:
- xpack
ports:
- "8000: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
ports:
- 6379:6379
command:
- bash
- -c
- "redis-server --protected-mode yes --logfile redis.log --appendonly no --port 6379 --requirepass redis_6sJZDm"
networks:
- xpack
xpack-rabbitmq:
image: rabbitmq:4.1.2-alpine
container_name: xpack-rabbitmq
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
```
<br>
3. 啟動 XPack-MCP-Market
```
docker-compose up -d
```
<br>
4. 瀏覽器透過 8000 埠連線
* **管理員登入**:http://{IP}:8000/admin-signin
* **帳號**:admin
* **密碼**:123456789
</details>
<details>
<summary><h4>🔖 建置</h4></summary>
1. 取得原始碼
```
git clone https://github.com/xpack-ai/XPack-MCP-Market.git
```
2. 進入專案資料夾
```
cd XPack-MCP-Market
```
### 前端建置
> 需求:
> - Node >= 22.x
> - Pnpm >= 10.x
1. 執行建置腳本
```
cd scripts && ./frontend_build.sh && cd ../
```
完成後產出於 `frontend/out`。
2. 啟動 UI
```
cd frontend/out && node server.js
```
### 後端建置
> 需求:
> - Python >= 3.11
#### 使用 `uv`(建議)
1. 建立虛擬環境
```
uv venv
```
2. 啟用虛擬環境
```
source .venv/bin/activate
```
3. 安裝相依
```
uv pip install -r requirements.txt
```
4. 複製環境變數檔
```
cp .env.example .env
```
5. 編輯環境變數
```
vi .env
```
6. 啟動管理後端服務
**前景**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload
```
**背景**
```
uvicorn services.admin_service.main:app --host 0.0.0.0 --port 8001 --reload &
```
7. 啟動 API → MCP 服務
**前景**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload
```
**背景**
```
uvicorn services.api_service.main:app --host 0.0.0.0 --port 8002 --reload &
```
### Docker 建置
```
docker build -t xpack-mcp-market --build-arg APP=xpack-mcp-market --build-arg VERSION=1.0.0 -f ./scripts/Dockerfile ./
```
</details>
# 📸 螢幕截圖
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/5f71bfcf-c128-42ab-8077-3f2ede549f80" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/d7c0b40d-182e-47a6-bcdf-bd36970f5ee6" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/ae40f659-87ad-42d4-8379-b47a48eb6a29" />
<img width="1415" height="797" alt="image" src="https://github.com/user-attachments/assets/1049f4e5-ec3f-4520-8480-6d6432d6f5d2" />
<br>
# 🧾 授權
XPack-MCP-Market 以 **Apache 2.0** 授權釋出。
詳情請見 [LICENSE](./LICENSE)。
<br>
# 📬 聯絡方式
- 🌐 Website: [https://xpack.ai](https://xpack.ai)
- 📧 Email: [contact@xpack.com](mailto:contact@xpack.com)
- 💬 Discord:[Link](https://discord.gg/cyZfcdCXkW)
<br>
# 🤝 合作夥伴
- [Cursor](https://www.cursor.com/): Cursor 是一款將 AI 深度整合進編輯器的工具,提供下一步編輯建議、對程式碼庫的深度理解與自然語言編輯,顯著提升生產力。
- [Dify](https://dify.ai/): Dify 為領先的代理式(Agentic)AI 開發平台,涵蓋代理流程、RAG、整合與可觀測性等完整能力,支援多種 LLM 與外掛。
- [Trae](https://www.trae.ai/): Trae 是 AI 原生 IDE,以對話式介面協助產生與改寫程式碼,提升品質與效率。
- [Windsurf](https://windsurf.com/): Windsurf 為新一代 AI IDE,具備「Cascade」深度理解、「Windsurf Tab」智慧補全與「Memories」程式碼記憶等功能。
- [Coze](https://www.coze.com/): Coze 是 ByteDance 推出的次世代 AI 應用/聊天機器人平台,透過無程式碼工作流、外掛與知識庫,輕鬆建立強大的 Bot。
- [Claude Code](https://www.anthropic.com/claude-code): Claude Code 是 Anthropic 的 CLI 工具,將 Claude Opus 4 直接帶到終端機,可跨檔案編輯、執行指令並與 IDE/測試整合。
- [Flowith](https://flowith.io/): Flowith 是以畫布為核心的 AI 工作空間,透過多執行緒代理體驗,優化知識轉換與深度工作。
- [OpenManus](https://github.com/FoundationAgents/OpenManus): OpenManus 是用於構建通用 AI 代理的開源框架,支援多代理與 LLM API、瀏覽器自動化整合。
- [Fellou](https://fellou.ai/): Fellou 是能主動代辦任務的「Agentic Browser」,自動化資料蒐集與洞察產出,並和 Notion/LinkedIn 等常用工具整合。
- [Genspark](https://www.genspark.ai/): Genspark 是全方位 AI 夥伴(AI Slides、Sheets、Chat),以個人化工具與 AI Pods 從多來源生成內容。
- [TEN](https://github.com/TEN-framework/ten-framework): TEN(The Embodied Narrator)為即時多模態語音代理的開源框架,支援虛擬分身、MCP 整合、硬體通訊與畫面偵測。
- [APIPark](https://apipark.com/): APIPark 是開源企業級 API 開發者入口與整合式 LLM 閘道,提供統一 API 介面、負載平衡、流量控制、語意快取、提示管理與資料遮罩。
- [ChatGPT](https://chatgpt.com/): ChatGPT 是 OpenAI 的對話式 AI,具備進階語言理解與生成能力,支援追問、情境保留與多平台整合。
- [LangChain](https://www.langchain.com/): LangChain 是開發可靠代理與 LLM 應用的平台,涵蓋 LangGraph、LangSmith 與 LangGraph Platform 等產品。
- [LEMON AI](https://lemonai.cc/): Lemon AI 是首個全端、開源的 Agentic AI 框架,內建 Code Interpreter VM 沙盒以確保安全執行。
- [LobeChat](https://lobehub.com/): LobeChat 為個人 LLM 生產力工具,支援個人/團隊代理、外掛生態、知識庫與影像/語音功能。
- [VS Code](https://code.visualstudio.com/): Visual Studio Code 是高延展性的開源編輯器,支援多語言並內建多項 AI 功能(如下一步編輯建議與代理模式)。
- [XRoute](https://xroute.ai): 提供統一介面的 LLM 閘道,具更佳價格與吞吐量,無需訂閱。
- [MemU](https://github.com/NevaMind-AI/memU): MemU 是面向 AI 夥伴的開源記憶框架。
+68 -8
View File
@@ -3,6 +3,18 @@
<p align="center">
<a href="/README.md">English</a>
|
<a href="/README-fr.md">Français</a>
|
<a href="/README-de.md">Deutsch</a>
|
<a href="/README-es.md">Español</a>
|
<a href="/README-ja.md">日本語</a>
|
<a href="/README-ko.md">한국어</a>
|
<a href="/README-zh-tw.md">繁體中文</a>
|
<a href="/README-zh-cn.md">简体中文</a>
</p>
@@ -31,7 +43,7 @@ Everything is open-source and licensed under **Apache 2.0** — ready for commer
curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
[![Learn how to deploy your mcp market in 10 minutes](https://github.com/user-attachments/assets/8881d724-b6aa-47b7-bbd7-b587ef541957)](https://www.youtube.com/watch?v=Ut4mbFXWbFs)
[![Learn how to deploy your mcp market in 10 minutes](https://github.com/user-attachments/assets/8881d724-b6aa-47b7-bbd7-b587ef541957)](https://www.youtube.com/watch?v=XHJXyvDevd8)
<br>
@@ -129,8 +141,7 @@ curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
networks:
- xpack
ports:
- "3000:3000"
- "8002:8002"
- "8000:80" # Map port 8000 of the container to port 80 of the host, if you want to access XPack-MCP-Market in your browser at port 8000
depends_on:
- xpack-mysql
- xpack-redis
@@ -178,9 +189,9 @@ curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
<br>
4. Access `XPack-MCP-Market` in your browser at port 3000
4. Access `XPack-MCP-Market` in your browser at port 8000
* **Admin User Login Address**: http://{IP}:3000/admin-signin
* **Admin User Login Address**: http://{IP}:8000/admin
* **Admin User**: admin
* **Admin Password**: 123456789
</details>
@@ -201,8 +212,16 @@ curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
> Requirements:
> - Node >= 22.x
> - Pnpm >= 10.x
1. Execute the frontend build script
1. Configure environment variable NEXT_PUBLIC_API_URL:
```
vi frontend/.env
```
File content:
```
NEXT_PUBLIC_API_URL=http://127.0.0.1:8001
```
2. Execute the frontend build script
```
cd scripts && ./frontend_build.sh && cd ../
```
@@ -258,7 +277,7 @@ curl -sSO https://xpack.ai/install/quick-start.sh; bash quick-start.sh
```
### Docker Build
```
docker build -t xpack-mcp-market --build-arg APP=xpack-mcp-market --build-arg VERSION=1.0.0 -f ./scripts/Dockerfile ./
docker build -t xpack-mcp-market --build-arg APP=xpack-mcp-market --build-arg VERSION=1.1.0 -f ./scripts/Dockerfile ./
```
</details>
@@ -283,3 +302,44 @@ For details, please see the [LICENSE](./LICENSE) file.
- 🌐 Website: [https://xpack.ai](https://xpack.ai)
- 📧 Email: [contact@xpack.com](mailto:contact@xpack.com)
- 💬 Discord:[Link](https://discord.gg/cyZfcdCXkW)
<br>
# 🤝 Partner
- [Cursor](https://www.cursor.com/): Cursor is an AI-powered code editor that integrates artificial intelligence directly into the coding workflow, offering features like intelligent next edit suggestions, deep codebase understanding for relevant answers, and natural language editing to streamline development tasks and boost developer productivity.
- [Dify](https://dify.ai/): Dify is a leading Agentic AI Development Platform that provides a comprehensive suite of tools for building and extending AI applications, offering everything needed for agentic workflows, RAG pipelines, integrations, and observability, while allowing users to amplify their applications with various global Large Language Models (LLMs) and versatile plugins.
- [Trae](https://www.trae.ai/): Trae is an AI-native Integrated Development Environment (IDE) product that aims to embody the concept of “The Real AI Engineer” through intelligent productivity, seamlessly integrating into the development process to enhance quality and efficiency, featuring a chat-based interaction interface and supporting code generation and assistance.
- [Windsurf](https://windsurf.com/): Windsurf is an AI code editor designed to provide a seamless and limitless flow for developers, introducing a new purpose-built IDE that leverages AI to enhance coding with features like "Cascade" for deep codebase understanding, "Windsurf Tab" for intelligent autocompletion, and "Memories" for remembering important aspects of the codebase.
- [Coze](https://www.coze.com/): Coze is a next-generation AI application and chatbot development platform by ByteDance, empowering users to easily create and deploy powerful AI chatbots across various platforms with a no-code bot builder, integrated workflow logic, access to proprietary data, and simplified creation through pre-built plugins, knowledge bases, and workflows.
- [Claude Code](https://www.anthropic.com/claude-code): Claude Code is a command-line AI tool by Anthropic that embeds the Claude Opus 4 model directly into the user’s terminal, providing deep codebase awareness, the ability to edit files and execute commands, and making coordinated changes across multiple files, all while integrating seamlessly with popular IDEs and leveraging existing test suites.
- [Flowith](https://flowith.io/): Flowith is an AI creation workspace designed to revolutionize productivity and deep work by transforming knowledge and streamlining tasks through a multi-thread interface powered by advanced AI agents, offering an intuitive canvas-based user experience unlike traditional chat-based AI tools, and including a 24/7 operational version for complex tasks.
- [OpenManus](https://github.com/FoundationAgents/OpenManus): OpenManus is an open-source framework dedicated to building general AI agents, aiming to provide a platform where users can create and deploy their own agents without an invite code, supporting multi-agent capabilities, and requiring configuration for Large Language Model (LLM) APIs while integrating with browser automation tools.
- [Fellou](https://fellou.ai/): Fellou is an innovative Agentic Browser designed to transcend traditional web browsing by actively performing actions on behalf of the user, automating the entire process of information gathering and insight delivery, and excelling in in-depth research with seamless integrations with popular tools like Notion and LinkedIn.
- [Genspark](https://www.genspark.ai/): Genspark is an ultimate all-in-one AI companion offering a comprehensive suite of tools like AI Slides, AI Sheets, and AI Chat, designed to enhance various aspects of productivity and content creation, with personalized tools and AI Pods for generating content from diverse sources.
- [TEN](https://github.com/TEN-framework/ten-framework): TEN (The Embodied Narrator) is an open-source framework for building real-time, multimodal conversational voice AI agents, including components like TEN Framework, TEN Turn Detection, TEN Agent, TMAN Designer, and TEN Portal, offering features like Real-time Avatar, seamless MCP integration, real-time hardware communication, and vision/screenshare detection.
- [APIPark](https://apipark.com/): APIPark is an open-source enterprise API developer portal and an all-in-one LLM gateway, providing fine-grained, visual management of LLMs in production environments with features like unified API signatures, load balancing, traffic control, intelligent semantic caching, flexible prompt management, and data masking, ensuring safer and more stable LLM calls.
- [ChatGPT](https://chatgpt.com/): ChatGPT is an AI chatbot developed by OpenAI, built upon large language models like GPT-3.5 and GPT-4, designed to generate human-like conversational dialogue, understand context, answer follow-up questions, and integrate with various platforms for enhanced productivity through advanced language understanding, generation, and multilingual capabilities.
- [LangChain](https://www.langchain.com/): LangChain is a robust platform engineered for the development of reliable agents and Large Language Model (LLM) applications, offering a comprehensive product suite that seamlessly integrates various tools across the entire application development lifecycle, including LangGraph, LangSmith, and the LangGraph Platform, with functionalities for code generation, automation, and AI Search.
- [LEMON AI](https://lemonai.cc/): Lemon AI is the first Full-stack, Open-source, Agentic AI framework, offering a fully local alternative to platforms like Manus & Genspark AI. It features an integrated Code Interpreter VM sandbox for safe execution.
- [LobeChat](https://lobehub.com/): LobeHub offers LobeChat, a personal LLM productivity tool designed to elevate the user experience beyond traditional chatbots by empowering individuals to build personal AI agents and professional teams, supporting a wide array of LLMs, offering a simple chat interface, visual recognition, voice interaction, a rich plugin ecosystem, and knowledge base functionalities.
- [VS Code](https://code.visualstudio.com/): Visual Studio Code (VS Code) is a widely popular, free, and open-source code editor by Microsoft, renowned for its extensibility and customization, supporting vast programming languages, and integrating AI capabilities like intelligent next edit suggestions and an advanced “agent mode” for complex tasks, with broad compatibility with various AI models.
- [XRoute](https://xroute.ai): The Unified Interface For LLMs, provides better prices, better throughput, and no subscription.
- [MemU](https://github.com/NevaMind-AI/memU): MemU is an open-source memory framework for AI companions
+7 -7
View File
@@ -14,7 +14,7 @@ XPack WebUI is the flagship frontend interface for the MCP Store ecosystem, desi
### ✨ Key Features
- **🛍️ Comprehensive Marketplace**: Browse, search, and discover MCP services across multiple categories
- **🛍️ Comprehensive Marketplace**: Browse, search, and discover MCP servers across multiple categories
- **👤 Multi-tier Authentication**: Secure user and admin authentication systems
- **⚙️ Advanced Admin Console**: Complete service management, user administration, and revenue tracking
- **🌐 Full Internationalization**: Native support for English and Chinese with extensible i18n framework
@@ -110,7 +110,7 @@ src/
│ ├── console/ # Admin console components
│ ├── dashboard/ # User dashboard components
│ ├── marketplace/ # Marketplace components
│ ├── mcp-services/ # MCP service management
│ ├── mcp-services/ # MCP server management
│ ├── user-management/ # User administration
│ ├── revenue-management/# Revenue tracking
│ ├── system-setting/ # System configuration
@@ -129,7 +129,7 @@ src/
│ └── utils/ # Utility functions
├── services/ # Backend API integration
│ ├── marketplaceService.ts # Marketplace API
│ ├── mcpService.ts # MCP service API
│ ├── mcpService.ts # MCP server API
│ ├── userService.ts # User management API
│ ├── revenueService.ts # Revenue tracking API
│ ├── paymentChannelService.ts # Payment API
@@ -139,7 +139,7 @@ src/
├── hooks/ # App-specific hooks
│ ├── useAdminLogin.tsx # Admin authentication
│ ├── useLogin.tsx # User authentication
│ ├── useMCPServicesList.ts # MCP services data
│ ├── useMCPServicesList.ts # MCP servers data
│ ├── useMCPServiceDetail.ts # Service details
│ ├── useUserManagement.ts # User management
│ ├── useRevenueManagement.ts # Revenue data
@@ -150,7 +150,7 @@ src/
├── types/ # TypeScript type definitions
│ ├── admin.ts # Admin types
│ ├── dashboard.ts # Dashboard types
│ ├── mcp-service.ts # MCP service types
│ ├── mcp-service.ts # MCP server types
│ ├── payment.ts # Payment types
│ ├── revenue.ts # Revenue types
│ ├── system.ts # System types
@@ -166,7 +166,7 @@ src/
### Marketplace Experience
- **Service Discovery**: Advanced search and filtering capabilities for MCP services
- **Service Discovery**: Advanced search and filtering capabilities for MCP servers
- **Service Catalog**: Browse services by categories with detailed information
- **Service Details**: Comprehensive service documentation and API specifications
- **Installation Guides**: Step-by-step integration instructions for developers
@@ -178,7 +178,7 @@ src/
### Admin Console
- **MCP Services Management**: Complete CRUD operations for MCP services
- **MCP Servers Management**: Complete CRUD operations for MCP servers
- Service creation and editing with OpenAPI generator
- OpenAPI document parsing from files or URLs
- Service status management (enabled/disabled)
+2 -2
View File
@@ -47,7 +47,7 @@ const result = await rpcClient.call("marketplace.getServices", {
Located in `src/services/marketplaceService.ts`:
```typescript
// Fetch all MCP services
// Fetch all MCP servers
export async function fetchServices(): Promise<ServiceData[]>;
// Fetch service by ID
@@ -352,7 +352,7 @@ function ServicesPage() {
### Public Endpoints
- `GET /api/web/mcp_services` - List all MCP services
- `GET /api/web/mcp_services` - List all MCP servers
- `POST /api/web/mcp_service_info` - Get service details by ID
- `GET /api/web/categories` - List service categories
- `POST /api/auth/login` - User login
+4 -4
View File
@@ -58,7 +58,7 @@ src/
│ ├── console/ # Console management
│ ├── dashboard/ # Dashboard components
│ ├── marketplace/ # Marketplace components
│ ├── mcp-services/ # MCP service management
│ ├── mcp-services/ # MCP server management
│ ├── revenue-management/# Revenue tracking
│ ├── system-setting/ # System configuration
│ ├── user-management/ # User administration
@@ -77,7 +77,7 @@ src/
│ └── utils/ # Utility functions
├── services/ # Backend API integration
│ ├── marketplaceService.ts # Marketplace API
│ ├── mcpService.ts # MCP service API
│ ├── mcpService.ts # MCP server API
│ ├── userService.ts # User management API
│ ├── revenueService.ts # Revenue tracking API
│ ├── paymentChannelService.ts # Payment API
@@ -87,7 +87,7 @@ src/
├── hooks/ # App-specific hooks
│ ├── useAdminLogin.tsx # Admin authentication
│ ├── useLogin.tsx # User authentication
│ ├── useMCPServicesList.ts # MCP services data
│ ├── useMCPServicesList.ts # MCP servers data
│ ├── useMCPServiceDetail.ts # Service details
│ ├── useUserManagement.ts # User management
│ ├── useRevenueManagement.ts # Revenue data
@@ -98,7 +98,7 @@ src/
├── types/ # TypeScript type definitions
│ ├── admin.ts # Admin types
│ ├── dashboard.ts # Dashboard types
│ ├── mcp-service.ts # MCP service types
│ ├── mcp-service.ts # MCP server types
│ ├── payment.ts # Payment types
│ ├── revenue.ts # Revenue types
│ ├── system.ts # System types
+159 -152
View File
@@ -16,34 +16,34 @@ XPack WebUI supports multiple languages using react-i18next. This guide covers h
The i18n system is configured in `src/shared/lib/i18n.ts`:
```typescript
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
import Backend from 'i18next-http-backend'
import LanguageDetector from 'i18next-browser-languagedetector'
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import Backend from "i18next-http-backend";
import LanguageDetector from "i18next-browser-languagedetector";
i18n
.use(Backend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
fallbackLng: 'en',
debug: process.env.NODE_ENV === 'development',
fallbackLng: "en",
debug: process.env.NODE_ENV === "development",
interpolation: {
escapeValue: false,
},
backend: {
loadPath: '/locales/{{lng}}/{{ns}}.json',
},
detection: {
order: ['localStorage', 'navigator', 'htmlTag'],
caches: ['localStorage'],
},
})
export default i18n
backend: {
loadPath: "/locales/{{lng}}/{{ns}}.json",
},
detection: {
order: ["localStorage", "navigator", "htmlTag"],
caches: ["localStorage"],
},
});
export default i18n;
```
### Translation Files Structure
@@ -73,7 +73,7 @@ import { useTranslation } from '@/shared/lib/useTranslation'
function MyComponent() {
const { t } = useTranslation()
return (
<div>
<h1>{t('Welcome')}</h1>
@@ -90,7 +90,7 @@ import { useTranslation } from '@/shared/lib/useTranslation'
function MarketplaceComponent() {
const { t } = useTranslation('marketplace')
return (
<div>
<h1>{t('title')}</h1>
@@ -106,7 +106,7 @@ function MarketplaceComponent() {
function AdminComponent() {
const { t: tCommon } = useTranslation('common')
const { t: tAdmin } = useTranslation('admin')
return (
<div>
<button>{tCommon('save')}</button>
@@ -139,7 +139,7 @@ function AdminComponent() {
```typescript
function Component() {
const { t } = useTranslation()
return (
<div>
<h1>{t('welcome')}</h1>
@@ -172,7 +172,7 @@ function Component() {
```typescript
function UserProfile() {
const { t } = useTranslation()
return (
<div>
<h1>{t('user.profile.title')}</h1>
@@ -198,7 +198,7 @@ function UserProfile() {
function Component() {
const { t } = useTranslation()
const user = { name: 'John', lastLogin: new Date() }
return (
<div>
<h1>{t('greeting', { name: user.name })}</h1>
@@ -227,7 +227,7 @@ function Component() {
function Component() {
const { t } = useTranslation()
const count = 5
return (
<div>
<p>{t('item', { count })}</p>
@@ -255,7 +255,7 @@ function Component() {
function Component() {
const { t } = useTranslation()
const userGender = 'male'
return (
<button>
{t('button.save', { context: userGender })}
@@ -278,11 +278,11 @@ const languages = [
function LanguageSelector() {
const { i18n, t } = useTranslation()
const changeLanguage = (languageCode: string) => {
i18n.changeLanguage(languageCode)
}
return (
<Select
label={t('common.language')}
@@ -305,24 +305,27 @@ function LanguageSelector() {
### Programmatic Language Change
```typescript
import { useTranslation } from '@/shared/lib/useTranslation'
import { useTranslation } from "@/shared/lib/useTranslation";
function useLanguage() {
const { i18n } = useTranslation()
const changeLanguage = useCallback((language: string) => {
i18n.changeLanguage(language)
// Optionally save to user preferences
localStorage.setItem('preferred-language', language)
}, [i18n])
const getCurrentLanguage = () => i18n.language
const { i18n } = useTranslation();
const changeLanguage = useCallback(
(language: string) => {
i18n.changeLanguage(language);
// Optionally save to user preferences
localStorage.setItem("preferred-language", language);
},
[i18n]
);
const getCurrentLanguage = () => i18n.language;
return {
currentLanguage: i18n.language,
changeLanguage,
getCurrentLanguage,
}
};
}
```
@@ -373,20 +376,20 @@ i18n.init({
// ... other config
interpolation: {
format: (value, format, lng) => {
if (format === 'uppercase') return value.toUpperCase()
if (format === 'currency') {
if (format === "uppercase") return value.toUpperCase();
if (format === "currency") {
return new Intl.NumberFormat(lng, {
style: 'currency',
currency: 'USD'
}).format(value)
style: "currency",
currency: "USD",
}).format(value);
}
if (format === 'date') {
return new Intl.DateTimeFormat(lng).format(value)
if (format === "date") {
return new Intl.DateTimeFormat(lng).format(value);
}
return value
}
}
})
return value;
},
},
});
```
```json
@@ -401,27 +404,30 @@ i18n.init({
```typescript
// Custom hook with additional features
export function useAppTranslation(namespace?: string) {
const { t, i18n } = useTranslation(namespace)
const tWithFallback = useCallback((key: string, options?: any) => {
const translation = t(key, options)
// Log missing translations in development
if (process.env.NODE_ENV === 'development' && translation === key) {
console.warn(`Missing translation for key: ${key}`)
}
return translation
}, [t])
const isRTL = i18n.language === 'ar' || i18n.language === 'he'
const { t, i18n } = useTranslation(namespace);
const tWithFallback = useCallback(
(key: string, options?: any) => {
const translation = t(key, options);
// Log missing translations in development
if (process.env.NODE_ENV === "development" && translation === key) {
console.warn(`Missing translation for key: ${key}`);
}
return translation;
},
[t]
);
const isRTL = i18n.language === "ar" || i18n.language === "he";
return {
t: tWithFallback,
i18n,
isRTL,
currentLanguage: i18n.language,
}
};
}
```
@@ -458,7 +464,7 @@ export function useAppTranslation(namespace?: string) {
// en/marketplace.json - Feature-specific translations
{
"title": "MCP Store",
"subtitle": "Discover and install MCP services",
"subtitle": "Discover and install MCP servers",
"search": {
"placeholder": "Search services...",
"noResults": "No services found",
@@ -482,42 +488,45 @@ export function useAppTranslation(namespace?: string) {
```typescript
// Validation script to check for missing translations
import fs from 'fs'
import path from 'path'
import fs from "fs";
import path from "path";
function validateTranslations() {
const localesDir = path.join(process.cwd(), 'public/locales')
const languages = fs.readdirSync(localesDir)
const baseLanguage = 'en'
const baseTranslations = loadTranslations(baseLanguage)
languages.forEach(lang => {
if (lang === baseLanguage) return
const translations = loadTranslations(lang)
const missingKeys = findMissingKeys(baseTranslations, translations)
const localesDir = path.join(process.cwd(), "public/locales");
const languages = fs.readdirSync(localesDir);
const baseLanguage = "en";
const baseTranslations = loadTranslations(baseLanguage);
languages.forEach((lang) => {
if (lang === baseLanguage) return;
const translations = loadTranslations(lang);
const missingKeys = findMissingKeys(baseTranslations, translations);
if (missingKeys.length > 0) {
console.warn(`Missing translations in ${lang}:`, missingKeys)
console.warn(`Missing translations in ${lang}:`, missingKeys);
}
})
});
}
function findMissingKeys(base: any, target: any, prefix = ''): string[] {
const missing: string[] = []
Object.keys(base).forEach(key => {
const fullKey = prefix ? `${prefix}.${key}` : key
function findMissingKeys(base: any, target: any, prefix = ""): string[] {
const missing: string[] = [];
Object.keys(base).forEach((key) => {
const fullKey = prefix ? `${prefix}.${key}` : key;
if (!(key in target)) {
missing.push(fullKey)
} else if (typeof base[key] === 'object' && typeof target[key] === 'object') {
missing.push(...findMissingKeys(base[key], target[key], fullKey))
missing.push(fullKey);
} else if (
typeof base[key] === "object" &&
typeof target[key] === "object"
) {
missing.push(...findMissingKeys(base[key], target[key], fullKey));
}
})
return missing
});
return missing;
}
```
@@ -525,32 +534,32 @@ function findMissingKeys(base: any, target: any, prefix = ''): string[] {
```typescript
// Extract translation keys from components
import { parse } from '@babel/parser'
import traverse from '@babel/traverse'
import fs from 'fs'
import { parse } from "@babel/parser";
import traverse from "@babel/traverse";
import fs from "fs";
function extractTranslationKeys(filePath: string): string[] {
const code = fs.readFileSync(filePath, 'utf-8')
const code = fs.readFileSync(filePath, "utf-8");
const ast = parse(code, {
sourceType: 'module',
plugins: ['typescript', 'jsx']
})
const keys: string[] = []
sourceType: "module",
plugins: ["typescript", "jsx"],
});
const keys: string[] = [];
traverse(ast, {
CallExpression(path) {
if (
path.node.callee.type === 'Identifier' &&
path.node.callee.name === 't' &&
path.node.arguments[0]?.type === 'StringLiteral'
path.node.callee.type === "Identifier" &&
path.node.callee.name === "t" &&
path.node.arguments[0]?.type === "StringLiteral"
) {
keys.push(path.node.arguments[0].value)
keys.push(path.node.arguments[0].value);
}
}
})
return keys
},
});
return keys;
}
```
@@ -560,25 +569,25 @@ function extractTranslationKeys(filePath: string): string[] {
```typescript
// Good: Descriptive, hierarchical keys
t('marketplace.service.install.button')
t('user.profile.form.validation.email.required')
t('admin.dashboard.stats.users.total')
t("marketplace.service.install.button");
t("user.profile.form.validation.email.required");
t("admin.dashboard.stats.users.total");
// Bad: Generic, flat keys
t('button1')
t('error')
t('text')
t("button1");
t("error");
t("text");
```
### 2. Consistent Namespace Usage
```typescript
// Good: Feature-based namespaces
const { t } = useTranslation('marketplace')
const { t: tCommon } = useTranslation('common')
const { t } = useTranslation("marketplace");
const { t: tCommon } = useTranslation("common");
// Bad: Mixed namespace usage
const { t } = useTranslation() // Default namespace for everything
const { t } = useTranslation(); // Default namespace for everything
```
### 3. Translation Context
@@ -601,10 +610,8 @@ const { t } = useTranslation() // Default namespace for everything
```typescript
// Good: Use interpolation
t('welcome.message', { userName: user.name })
// Bad: String concatenation
`Welcome, ${user.name}!`
t("welcome.message", { userName: user.name })// Bad: String concatenation
`Welcome, ${user.name}!`;
```
### 5. Error Message Translations
@@ -649,7 +656,7 @@ describe('MyComponent', () => {
renderWithI18n(<MyComponent />)
expect(screen.getByText('Welcome')).toBeInTheDocument()
})
it('renders in Chinese', async () => {
await i18n.changeLanguage('zh-CN')
renderWithI18n(<MyComponent />)
@@ -662,12 +669,12 @@ describe('MyComponent', () => {
```typescript
// test-utils/i18n-for-tests.ts
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
i18n.use(initReactI18next).init({
lng: 'en',
fallbackLng: 'en',
lng: "en",
fallbackLng: "en",
debug: false,
interpolation: {
escapeValue: false,
@@ -675,20 +682,20 @@ i18n.use(initReactI18next).init({
resources: {
en: {
translation: {
'Welcome': 'Welcome',
'Goodbye': 'Goodbye',
}
Welcome: "Welcome",
Goodbye: "Goodbye",
},
},
'zh-CN': {
"zh-CN": {
translation: {
'Welcome': '欢迎',
'Goodbye': '再见',
}
}
}
})
Welcome: "欢迎",
Goodbye: "再见",
},
},
},
});
export default i18n
export default i18n;
```
## Adding New Languages
@@ -704,10 +711,10 @@ export default i18n
```typescript
// Add to language selector
const languages = [
{ code: 'en', name: 'English', flag: '🇺🇸' },
{ code: 'zh-CN', name: '中文', flag: '🇨🇳' },
{ code: 'es', name: 'Español', flag: '🇪🇸' }, // New language
]
{ code: "en", name: "English", flag: "🇺🇸" },
{ code: "zh-CN", name: "中文", flag: "🇨🇳" },
{ code: "es", name: "Español", flag: "🇪🇸" }, // New language
];
```
### 3. Update i18n Configuration
@@ -716,12 +723,12 @@ const languages = [
// Add fallback languages if needed
i18n.init({
fallbackLng: {
'zh-CN': ['zh', 'en'],
'es': ['en'],
'default': ['en']
"zh-CN": ["zh", "en"],
es: ["en"],
default: ["en"],
},
// ... other config
})
});
```
This comprehensive i18n guide ensures consistent and maintainable internationalization throughout the XPack WebUI application.
This comprehensive i18n guide ensures consistent and maintainable internationalization throughout the XPack WebUI application.
+7 -5
View File
@@ -21,13 +21,15 @@ const nextConfig = {
},
async rewrites() {
return [
{
source: "/api/:path*",
destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/api/:path*`,
},
// {
// source: "/api/:path*",
// destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/api/:path*`,
// },
{
source: "/uploads/:path*",
destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/uploads/:path*`,
destination: `${
process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"
}/uploads/:path*`,
},
];
},
+3 -2
View File
@@ -20,8 +20,10 @@
"@nextui-org/theme": "^2.4.5",
"@tailwindcss/typography": "^0.5.16",
"@types/crypto-js": "^4.2.2",
"@uiw/react-markdown-preview": "^5.1.5",
"@uiw/react-md-editor": "^4.0.7",
"animejs": "^4.0.2",
"async_hooks": "^1.0.0",
"crypto-js": "^4.2.0",
"framer-motion": "^11.5.6",
"i18next": "^23.8.0",
@@ -30,7 +32,7 @@
"immer": "^10.0.3",
"lottie-react": "^2.4.1",
"lucide-react": "^0.475.0",
"next": "^15.3.4",
"next": "^15.3.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.49.3",
@@ -38,7 +40,6 @@
"react-hover-video-player": "^10.0.2",
"react-i18next": "^14.0.1",
"react-icons": "^5.3.0",
"react-markdown": "^10.1.0",
"recharts": "^2.15.1",
"simplex-noise": "^4.0.3",
"swr": "^2.2.4",
+448 -9
View File
@@ -26,12 +26,18 @@ importers:
'@types/crypto-js':
specifier: ^4.2.2
version: 4.2.2
'@uiw/react-markdown-preview':
specifier: ^5.1.5
version: 5.1.5(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@uiw/react-md-editor':
specifier: ^4.0.7
version: 4.0.7(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
animejs:
specifier: ^4.0.2
version: 4.0.2
async_hooks:
specifier: ^1.0.0
version: 1.0.0
crypto-js:
specifier: ^4.2.0
version: 4.2.0
@@ -57,8 +63,8 @@ importers:
specifier: ^0.475.0
version: 0.475.0(react@18.3.1)
next:
specifier: ^15.3.4
version: 15.3.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
specifier: ^15.3.6
version: 15.5.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
react:
specifier: ^18.2.0
version: 18.3.1
@@ -80,9 +86,6 @@ importers:
react-icons:
specifier: ^5.3.0
version: 5.5.0(react@18.3.1)
react-markdown:
specifier: ^10.1.0
version: 10.1.0(@types/react@18.3.23)(react@18.3.1)
recharts:
specifier: ^2.15.1
version: 2.15.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
@@ -876,6 +879,9 @@ packages:
'@emnapi/runtime@1.4.3':
resolution: {integrity: sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==}
'@emnapi/runtime@1.7.1':
resolution: {integrity: sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==}
'@emnapi/wasi-threads@1.0.2':
resolution: {integrity: sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA==}
@@ -1193,122 +1199,272 @@ packages:
'@iconify/types@2.0.0':
resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==}
'@img/colour@1.0.0':
resolution: {integrity: sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==}
engines: {node: '>=18'}
'@img/sharp-darwin-arm64@0.34.2':
resolution: {integrity: sha512-OfXHZPppddivUJnqyKoi5YVeHRkkNE2zUFT2gbpKxp/JZCFYEYubnMg+gOp6lWfasPrTS+KPosKqdI+ELYVDtg==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [arm64]
os: [darwin]
'@img/sharp-darwin-arm64@0.34.5':
resolution: {integrity: sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [arm64]
os: [darwin]
'@img/sharp-darwin-x64@0.34.2':
resolution: {integrity: sha512-dYvWqmjU9VxqXmjEtjmvHnGqF8GrVjM2Epj9rJ6BUIXvk8slvNDJbhGFvIoXzkDhrJC2jUxNLz/GUjjvSzfw+g==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [x64]
os: [darwin]
'@img/sharp-darwin-x64@0.34.5':
resolution: {integrity: sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [x64]
os: [darwin]
'@img/sharp-libvips-darwin-arm64@1.1.0':
resolution: {integrity: sha512-HZ/JUmPwrJSoM4DIQPv/BfNh9yrOA8tlBbqbLz4JZ5uew2+o22Ik+tHQJcih7QJuSa0zo5coHTfD5J8inqj9DA==}
cpu: [arm64]
os: [darwin]
'@img/sharp-libvips-darwin-arm64@1.2.4':
resolution: {integrity: sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==}
cpu: [arm64]
os: [darwin]
'@img/sharp-libvips-darwin-x64@1.1.0':
resolution: {integrity: sha512-Xzc2ToEmHN+hfvsl9wja0RlnXEgpKNmftriQp6XzY/RaSfwD9th+MSh0WQKzUreLKKINb3afirxW7A0fz2YWuQ==}
cpu: [x64]
os: [darwin]
'@img/sharp-libvips-darwin-x64@1.2.4':
resolution: {integrity: sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==}
cpu: [x64]
os: [darwin]
'@img/sharp-libvips-linux-arm64@1.1.0':
resolution: {integrity: sha512-IVfGJa7gjChDET1dK9SekxFFdflarnUB8PwW8aGwEoF3oAsSDuNUTYS+SKDOyOJxQyDC1aPFMuRYLoDInyV9Ew==}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@img/sharp-libvips-linux-arm64@1.2.4':
resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==}
cpu: [arm64]
os: [linux]
'@img/sharp-libvips-linux-arm@1.1.0':
resolution: {integrity: sha512-s8BAd0lwUIvYCJyRdFqvsj+BJIpDBSxs6ivrOPm/R7piTs5UIwY5OjXrP2bqXC9/moGsyRa37eYWYCOGVXxVrA==}
cpu: [arm]
os: [linux]
libc: [glibc]
'@img/sharp-libvips-linux-arm@1.2.4':
resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==}
cpu: [arm]
os: [linux]
'@img/sharp-libvips-linux-ppc64@1.1.0':
resolution: {integrity: sha512-tiXxFZFbhnkWE2LA8oQj7KYR+bWBkiV2nilRldT7bqoEZ4HiDOcePr9wVDAZPi/Id5fT1oY9iGnDq20cwUz8lQ==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@img/sharp-libvips-linux-ppc64@1.2.4':
resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==}
cpu: [ppc64]
os: [linux]
'@img/sharp-libvips-linux-riscv64@1.2.4':
resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==}
cpu: [riscv64]
os: [linux]
'@img/sharp-libvips-linux-s390x@1.1.0':
resolution: {integrity: sha512-xukSwvhguw7COyzvmjydRb3x/09+21HykyapcZchiCUkTThEQEOMtBj9UhkaBRLuBrgLFzQ2wbxdeCCJW/jgJA==}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@img/sharp-libvips-linux-s390x@1.2.4':
resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==}
cpu: [s390x]
os: [linux]
'@img/sharp-libvips-linux-x64@1.1.0':
resolution: {integrity: sha512-yRj2+reB8iMg9W5sULM3S74jVS7zqSzHG3Ol/twnAAkAhnGQnpjj6e4ayUz7V+FpKypwgs82xbRdYtchTTUB+Q==}
cpu: [x64]
os: [linux]
libc: [glibc]
'@img/sharp-libvips-linux-x64@1.2.4':
resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==}
cpu: [x64]
os: [linux]
'@img/sharp-libvips-linuxmusl-arm64@1.1.0':
resolution: {integrity: sha512-jYZdG+whg0MDK+q2COKbYidaqW/WTz0cc1E+tMAusiDygrM4ypmSCjOJPmFTvHHJ8j/6cAGyeDWZOsK06tP33w==}
cpu: [arm64]
os: [linux]
libc: [musl]
'@img/sharp-libvips-linuxmusl-arm64@1.2.4':
resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==}
cpu: [arm64]
os: [linux]
'@img/sharp-libvips-linuxmusl-x64@1.1.0':
resolution: {integrity: sha512-wK7SBdwrAiycjXdkPnGCPLjYb9lD4l6Ze2gSdAGVZrEL05AOUJESWU2lhlC+Ffn5/G+VKuSm6zzbQSzFX/P65A==}
cpu: [x64]
os: [linux]
libc: [musl]
'@img/sharp-libvips-linuxmusl-x64@1.2.4':
resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==}
cpu: [x64]
os: [linux]
'@img/sharp-linux-arm64@0.34.2':
resolution: {integrity: sha512-D8n8wgWmPDakc83LORcfJepdOSN6MvWNzzz2ux0MnIbOqdieRZwVYY32zxVx+IFUT8er5KPcyU3XXsn+GzG/0Q==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@img/sharp-linux-arm64@0.34.5':
resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [arm64]
os: [linux]
'@img/sharp-linux-arm@0.34.2':
resolution: {integrity: sha512-0DZzkvuEOqQUP9mo2kjjKNok5AmnOr1jB2XYjkaoNRwpAYMDzRmAqUIa1nRi58S2WswqSfPOWLNOr0FDT3H5RQ==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [arm]
os: [linux]
libc: [glibc]
'@img/sharp-linux-arm@0.34.5':
resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [arm]
os: [linux]
'@img/sharp-linux-ppc64@0.34.5':
resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [ppc64]
os: [linux]
'@img/sharp-linux-riscv64@0.34.5':
resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [riscv64]
os: [linux]
'@img/sharp-linux-s390x@0.34.2':
resolution: {integrity: sha512-EGZ1xwhBI7dNISwxjChqBGELCWMGDvmxZXKjQRuqMrakhO8QoMgqCrdjnAqJq/CScxfRn+Bb7suXBElKQpPDiw==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@img/sharp-linux-s390x@0.34.5':
resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [s390x]
os: [linux]
'@img/sharp-linux-x64@0.34.2':
resolution: {integrity: sha512-sD7J+h5nFLMMmOXYH4DD9UtSNBD05tWSSdWAcEyzqW8Cn5UxXvsHAxmxSesYUsTOBmUnjtxghKDl15EvfqLFbQ==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [x64]
os: [linux]
libc: [glibc]
'@img/sharp-linux-x64@0.34.5':
resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [x64]
os: [linux]
'@img/sharp-linuxmusl-arm64@0.34.2':
resolution: {integrity: sha512-NEE2vQ6wcxYav1/A22OOxoSOGiKnNmDzCYFOZ949xFmrWZOVII1Bp3NqVVpvj+3UeHMFyN5eP/V5hzViQ5CZNA==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [arm64]
os: [linux]
libc: [musl]
'@img/sharp-linuxmusl-arm64@0.34.5':
resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [arm64]
os: [linux]
'@img/sharp-linuxmusl-x64@0.34.2':
resolution: {integrity: sha512-DOYMrDm5E6/8bm/yQLCWyuDJwUnlevR8xtF8bs+gjZ7cyUNYXiSf/E8Kp0Ss5xasIaXSHzb888V1BE4i1hFhAA==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [x64]
os: [linux]
libc: [musl]
'@img/sharp-linuxmusl-x64@0.34.5':
resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [x64]
os: [linux]
'@img/sharp-wasm32@0.34.2':
resolution: {integrity: sha512-/VI4mdlJ9zkaq53MbIG6rZY+QRN3MLbR6usYlgITEzi4Rpx5S6LFKsycOQjkOGmqTNmkIdLjEvooFKwww6OpdQ==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [wasm32]
'@img/sharp-wasm32@0.34.5':
resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [wasm32]
'@img/sharp-win32-arm64@0.34.2':
resolution: {integrity: sha512-cfP/r9FdS63VA5k0xiqaNaEoGxBg9k7uE+RQGzuK9fHt7jib4zAVVseR9LsE4gJcNWgT6APKMNnCcnyOtmSEUQ==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [arm64]
os: [win32]
'@img/sharp-win32-arm64@0.34.5':
resolution: {integrity: sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [arm64]
os: [win32]
'@img/sharp-win32-ia32@0.34.2':
resolution: {integrity: sha512-QLjGGvAbj0X/FXl8n1WbtQ6iVBpWU7JO94u/P2M4a8CFYsvQi4GW2mRy/JqkRx0qpBzaOdKJKw8uc930EX2AHw==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [ia32]
os: [win32]
'@img/sharp-win32-ia32@0.34.5':
resolution: {integrity: sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [ia32]
os: [win32]
'@img/sharp-win32-x64@0.34.2':
resolution: {integrity: sha512-aUdT6zEYtDKCaxkofmmJDJYGCf0+pJg3eU9/oBuqvEeoB9dKI6ZLc/1iLJCTuJQDO4ptntAlkUmHgGjyuobZbw==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [x64]
os: [win32]
'@img/sharp-win32-x64@0.34.5':
resolution: {integrity: sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
cpu: [x64]
os: [win32]
'@internationalized/date@3.6.0':
resolution: {integrity: sha512-+z6ti+CcJnRlLHok/emGEsWQhe7kfSmEW+/6qCzvKY67YPh7YOBfvc7+/+NXq+zJlbArg30tYpqLjNgcAYv2YQ==}
@@ -1368,6 +1524,9 @@ packages:
'@next/env@15.3.4':
resolution: {integrity: sha512-ZkdYzBseS6UjYzz6ylVKPOK+//zLWvD6Ta+vpoye8cW11AjiQjGYVibF0xuvT4L0iJfAPfZLFidaEzAOywyOAQ==}
'@next/env@15.5.7':
resolution: {integrity: sha512-4h6Y2NyEkIEN7Z8YxkA27pq6zTkS09bUSYC0xjd0NpwFxjnIKeZEeH591o5WECSmjpUhLn3H2QLJcDye3Uzcvg==}
'@next/eslint-plugin-next@15.0.3':
resolution: {integrity: sha512-3Ln/nHq2V+v8uIaxCR6YfYo7ceRgZNXfTd3yW1ukTaFbO+/I8jNakrjYWODvG9BuR2v5kgVtH/C8r0i11quOgw==}
@@ -1380,35 +1539,75 @@ packages:
cpu: [arm64]
os: [darwin]
'@next/swc-darwin-arm64@15.5.7':
resolution: {integrity: sha512-IZwtxCEpI91HVU/rAUOOobWSZv4P2DeTtNaCdHqLcTJU4wdNXgAySvKa/qJCgR5m6KI8UsKDXtO2B31jcaw1Yw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
'@next/swc-darwin-x64@15.3.4':
resolution: {integrity: sha512-Z0FYJM8lritw5Wq+vpHYuCIzIlEMjewG2aRkc3Hi2rcbULknYL/xqfpBL23jQnCSrDUGAo/AEv0Z+s2bff9Zkw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
'@next/swc-darwin-x64@15.5.7':
resolution: {integrity: sha512-UP6CaDBcqaCBuiq/gfCEJw7sPEoX1aIjZHnBWN9v9qYHQdMKvCKcAVs4OX1vIjeE+tC5EIuwDTVIoXpUes29lg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
'@next/swc-linux-arm64-gnu@15.3.4':
resolution: {integrity: sha512-l8ZQOCCg7adwmsnFm8m5q9eIPAHdaB2F3cxhufYtVo84pymwKuWfpYTKcUiFcutJdp9xGHC+F1Uq3xnFU1B/7g==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@next/swc-linux-arm64-gnu@15.5.7':
resolution: {integrity: sha512-NCslw3GrNIw7OgmRBxHtdWFQYhexoUCq+0oS2ccjyYLtcn1SzGzeM54jpTFonIMUjNbHmpKpziXnpxhSWLcmBA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
'@next/swc-linux-arm64-musl@15.3.4':
resolution: {integrity: sha512-wFyZ7X470YJQtpKot4xCY3gpdn8lE9nTlldG07/kJYexCUpX1piX+MBfZdvulo+t1yADFVEuzFfVHfklfEx8kw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
libc: [musl]
'@next/swc-linux-arm64-musl@15.5.7':
resolution: {integrity: sha512-nfymt+SE5cvtTrG9u1wdoxBr9bVB7mtKTcj0ltRn6gkP/2Nu1zM5ei8rwP9qKQP0Y//umK+TtkKgNtfboBxRrw==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
'@next/swc-linux-x64-gnu@15.3.4':
resolution: {integrity: sha512-gEbH9rv9o7I12qPyvZNVTyP/PWKqOp8clvnoYZQiX800KkqsaJZuOXkWgMa7ANCCh/oEN2ZQheh3yH8/kWPSEg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
libc: [glibc]
'@next/swc-linux-x64-gnu@15.5.7':
resolution: {integrity: sha512-hvXcZvCaaEbCZcVzcY7E1uXN9xWZfFvkNHwbe/n4OkRhFWrs1J1QV+4U1BN06tXLdaS4DazEGXwgqnu/VMcmqw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
'@next/swc-linux-x64-musl@15.3.4':
resolution: {integrity: sha512-Cf8sr0ufuC/nu/yQ76AnarbSAXcwG/wj+1xFPNbyNo8ltA6kw5d5YqO8kQuwVIxk13SBdtgXrNyom3ZosHAy4A==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
libc: [musl]
'@next/swc-linux-x64-musl@15.5.7':
resolution: {integrity: sha512-4IUO539b8FmF0odY6/SqANJdgwn1xs1GkPO5doZugwZ3ETF6JUdckk7RGmsfSf7ws8Qb2YB5It33mvNL/0acqA==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
'@next/swc-win32-arm64-msvc@15.3.4':
resolution: {integrity: sha512-ay5+qADDN3rwRbRpEhTOreOn1OyJIXS60tg9WMYTWCy3fB6rGoyjLVxc4dR9PYjEdR2iDYsaF5h03NA+XuYPQQ==}
@@ -1416,12 +1615,24 @@ packages:
cpu: [arm64]
os: [win32]
'@next/swc-win32-arm64-msvc@15.5.7':
resolution: {integrity: sha512-CpJVTkYI3ZajQkC5vajM7/ApKJUOlm6uP4BknM3XKvJ7VXAvCqSjSLmM0LKdYzn6nBJVSjdclx8nYJSa3xlTgQ==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
'@next/swc-win32-x64-msvc@15.3.4':
resolution: {integrity: sha512-4kDt31Bc9DGyYs41FTL1/kNpDeHyha2TC0j5sRRoKCyrhNcfZ/nRQkAUlF27mETwm8QyHqIjHJitfcza2Iykfg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
'@next/swc-win32-x64-msvc@15.5.7':
resolution: {integrity: sha512-gMzgBX164I6DN+9/PGA+9dQiwmTkE4TloBNx8Kv9UiGARsr9Nba7IpcBRA1iTV9vwlYnrE3Uy6I7Aj6qLjQuqw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
'@nextui-org/accordion@2.2.7':
resolution: {integrity: sha512-jdobOwUxSi617m+LpxHFzg64UhDuOfDJI2CMk3MP+b2WBJ7SNW4hmN2NW5Scx5JiY+kyBGmlxJ4Y++jZpZgQjQ==}
deprecated: This package has been deprecated. Please use @heroui/accordion instead.
@@ -3083,8 +3294,8 @@ packages:
'@uiw/copy-to-clipboard@1.0.17':
resolution: {integrity: sha512-O2GUHV90Iw2VrSLVLK0OmNIMdZ5fgEg4NhvtwINsX+eZ/Wf6DWD0TdsK9xwV7dNRnK/UI2mQtl0a2/kRgm1m1A==}
'@uiw/react-markdown-preview@5.1.4':
resolution: {integrity: sha512-6k13WVNHCEaamz3vh54OQ1tseIXneKlir1+E/VFQBPq8PRod+gwLfYtiitDBWu+ZFttoiKPLZ7flgHrVM+JNOg==}
'@uiw/react-markdown-preview@5.1.5':
resolution: {integrity: sha512-DNOqx1a6gJR7Btt57zpGEKTfHRlb7rWbtctMRO2f82wWcuoJsxPBrM+JWebDdOD0LfD8oe2CQvW2ICQJKHQhZg==}
peerDependencies:
react: '>=16.8.0'
react-dom: '>=16.8.0'
@@ -3342,6 +3553,9 @@ packages:
resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==}
engines: {node: '>= 0.4'}
async_hooks@1.0.0:
resolution: {integrity: sha512-t4BSJgx48V3e7U6Ll3/WOUNmxIRPzmPdxVfgbyzcnRItEnn4iKp4F//b0sV3L9hzbdr5qxWdNWzOF7t+rjYSfA==}
attr-accept@2.2.5:
resolution: {integrity: sha512-0bDNnY/u6pPwHDMoF0FieU354oBi0a8rD9FcsLwzcGWbc8KS8KPIi7y+s13OlVY+gMWc/9xEMUgNE6Qm8ZllYQ==}
engines: {node: '>=4'}
@@ -3783,6 +3997,10 @@ packages:
resolution: {integrity: sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==}
engines: {node: '>=8'}
detect-libc@2.1.2:
resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}
engines: {node: '>=8'}
devlop@1.1.0:
resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==}
@@ -5267,6 +5485,27 @@ packages:
sass:
optional: true
next@15.5.7:
resolution: {integrity: sha512-+t2/0jIJ48kUpGKkdlhgkv+zPTEOoXyr60qXe68eB/pl3CMJaLeIGjzp5D6Oqt25hCBiBTt8wEeeAzfJvUKnPQ==}
engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0}
hasBin: true
peerDependencies:
'@opentelemetry/api': ^1.1.0
'@playwright/test': ^1.51.1
babel-plugin-react-compiler: '*'
react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
sass: ^1.3.0
peerDependenciesMeta:
'@opentelemetry/api':
optional: true
'@playwright/test':
optional: true
babel-plugin-react-compiler:
optional: true
sass:
optional: true
no-case@2.3.2:
resolution: {integrity: sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==}
@@ -5987,6 +6226,11 @@ packages:
engines: {node: '>=10'}
hasBin: true
semver@7.7.3:
resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==}
engines: {node: '>=10'}
hasBin: true
sentence-case@2.1.1:
resolution: {integrity: sha512-ENl7cYHaK/Ktwk5OTD+aDbQ3uC8IByu/6Bkg+HDv8Mm+XnBnppVNalcfJTNsp1ibstKh030/JKQQWglDvtKwEQ==}
@@ -6013,6 +6257,10 @@ packages:
resolution: {integrity: sha512-lszvBmB9QURERtyKT2bNmsgxXK0ShJrL/fvqlonCo7e6xBF8nT8xU6pW+PMIbLsz0RxQk3rgH9kd8UmvOzlMJg==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
sharp@0.34.5:
resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==}
engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0}
shebang-command@2.0.0:
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
engines: {node: '>=8'}
@@ -6968,6 +7216,11 @@ snapshots:
tslib: 2.8.1
optional: true
'@emnapi/runtime@1.7.1':
dependencies:
tslib: 2.8.1
optional: true
'@emnapi/wasi-threads@1.0.2':
dependencies:
tslib: 2.8.1
@@ -7285,87 +7538,184 @@ snapshots:
'@iconify/types@2.0.0': {}
'@img/colour@1.0.0':
optional: true
'@img/sharp-darwin-arm64@0.34.2':
optionalDependencies:
'@img/sharp-libvips-darwin-arm64': 1.1.0
optional: true
'@img/sharp-darwin-arm64@0.34.5':
optionalDependencies:
'@img/sharp-libvips-darwin-arm64': 1.2.4
optional: true
'@img/sharp-darwin-x64@0.34.2':
optionalDependencies:
'@img/sharp-libvips-darwin-x64': 1.1.0
optional: true
'@img/sharp-darwin-x64@0.34.5':
optionalDependencies:
'@img/sharp-libvips-darwin-x64': 1.2.4
optional: true
'@img/sharp-libvips-darwin-arm64@1.1.0':
optional: true
'@img/sharp-libvips-darwin-arm64@1.2.4':
optional: true
'@img/sharp-libvips-darwin-x64@1.1.0':
optional: true
'@img/sharp-libvips-darwin-x64@1.2.4':
optional: true
'@img/sharp-libvips-linux-arm64@1.1.0':
optional: true
'@img/sharp-libvips-linux-arm64@1.2.4':
optional: true
'@img/sharp-libvips-linux-arm@1.1.0':
optional: true
'@img/sharp-libvips-linux-arm@1.2.4':
optional: true
'@img/sharp-libvips-linux-ppc64@1.1.0':
optional: true
'@img/sharp-libvips-linux-ppc64@1.2.4':
optional: true
'@img/sharp-libvips-linux-riscv64@1.2.4':
optional: true
'@img/sharp-libvips-linux-s390x@1.1.0':
optional: true
'@img/sharp-libvips-linux-s390x@1.2.4':
optional: true
'@img/sharp-libvips-linux-x64@1.1.0':
optional: true
'@img/sharp-libvips-linux-x64@1.2.4':
optional: true
'@img/sharp-libvips-linuxmusl-arm64@1.1.0':
optional: true
'@img/sharp-libvips-linuxmusl-arm64@1.2.4':
optional: true
'@img/sharp-libvips-linuxmusl-x64@1.1.0':
optional: true
'@img/sharp-libvips-linuxmusl-x64@1.2.4':
optional: true
'@img/sharp-linux-arm64@0.34.2':
optionalDependencies:
'@img/sharp-libvips-linux-arm64': 1.1.0
optional: true
'@img/sharp-linux-arm64@0.34.5':
optionalDependencies:
'@img/sharp-libvips-linux-arm64': 1.2.4
optional: true
'@img/sharp-linux-arm@0.34.2':
optionalDependencies:
'@img/sharp-libvips-linux-arm': 1.1.0
optional: true
'@img/sharp-linux-arm@0.34.5':
optionalDependencies:
'@img/sharp-libvips-linux-arm': 1.2.4
optional: true
'@img/sharp-linux-ppc64@0.34.5':
optionalDependencies:
'@img/sharp-libvips-linux-ppc64': 1.2.4
optional: true
'@img/sharp-linux-riscv64@0.34.5':
optionalDependencies:
'@img/sharp-libvips-linux-riscv64': 1.2.4
optional: true
'@img/sharp-linux-s390x@0.34.2':
optionalDependencies:
'@img/sharp-libvips-linux-s390x': 1.1.0
optional: true
'@img/sharp-linux-s390x@0.34.5':
optionalDependencies:
'@img/sharp-libvips-linux-s390x': 1.2.4
optional: true
'@img/sharp-linux-x64@0.34.2':
optionalDependencies:
'@img/sharp-libvips-linux-x64': 1.1.0
optional: true
'@img/sharp-linux-x64@0.34.5':
optionalDependencies:
'@img/sharp-libvips-linux-x64': 1.2.4
optional: true
'@img/sharp-linuxmusl-arm64@0.34.2':
optionalDependencies:
'@img/sharp-libvips-linuxmusl-arm64': 1.1.0
optional: true
'@img/sharp-linuxmusl-arm64@0.34.5':
optionalDependencies:
'@img/sharp-libvips-linuxmusl-arm64': 1.2.4
optional: true
'@img/sharp-linuxmusl-x64@0.34.2':
optionalDependencies:
'@img/sharp-libvips-linuxmusl-x64': 1.1.0
optional: true
'@img/sharp-linuxmusl-x64@0.34.5':
optionalDependencies:
'@img/sharp-libvips-linuxmusl-x64': 1.2.4
optional: true
'@img/sharp-wasm32@0.34.2':
dependencies:
'@emnapi/runtime': 1.4.3
optional: true
'@img/sharp-wasm32@0.34.5':
dependencies:
'@emnapi/runtime': 1.7.1
optional: true
'@img/sharp-win32-arm64@0.34.2':
optional: true
'@img/sharp-win32-arm64@0.34.5':
optional: true
'@img/sharp-win32-ia32@0.34.2':
optional: true
'@img/sharp-win32-ia32@0.34.5':
optional: true
'@img/sharp-win32-x64@0.34.2':
optional: true
'@img/sharp-win32-x64@0.34.5':
optional: true
'@internationalized/date@3.6.0':
dependencies:
'@swc/helpers': 0.5.15
@@ -7440,6 +7790,8 @@ snapshots:
'@next/env@15.3.4': {}
'@next/env@15.5.7': {}
'@next/eslint-plugin-next@15.0.3':
dependencies:
fast-glob: 3.3.1
@@ -7451,27 +7803,51 @@ snapshots:
'@next/swc-darwin-arm64@15.3.4':
optional: true
'@next/swc-darwin-arm64@15.5.7':
optional: true
'@next/swc-darwin-x64@15.3.4':
optional: true
'@next/swc-darwin-x64@15.5.7':
optional: true
'@next/swc-linux-arm64-gnu@15.3.4':
optional: true
'@next/swc-linux-arm64-gnu@15.5.7':
optional: true
'@next/swc-linux-arm64-musl@15.3.4':
optional: true
'@next/swc-linux-arm64-musl@15.5.7':
optional: true
'@next/swc-linux-x64-gnu@15.3.4':
optional: true
'@next/swc-linux-x64-gnu@15.5.7':
optional: true
'@next/swc-linux-x64-musl@15.3.4':
optional: true
'@next/swc-linux-x64-musl@15.5.7':
optional: true
'@next/swc-win32-arm64-msvc@15.3.4':
optional: true
'@next/swc-win32-arm64-msvc@15.5.7':
optional: true
'@next/swc-win32-x64-msvc@15.3.4':
optional: true
'@next/swc-win32-x64-msvc@15.5.7':
optional: true
'@nextui-org/accordion@2.2.7(@nextui-org/system@2.4.6(@nextui-org/theme@2.4.5(tailwindcss@3.4.17(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@20.19.1)(typescript@5.7.3))))(framer-motion@11.18.2(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@nextui-org/theme@2.4.5(tailwindcss@3.4.17(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@20.19.1)(typescript@5.7.3))))(framer-motion@11.18.2(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
'@nextui-org/aria-utils': 2.2.7(@nextui-org/theme@2.4.5(tailwindcss@3.4.17(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@20.19.1)(typescript@5.7.3))))(framer-motion@11.18.2(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
@@ -11173,7 +11549,7 @@ snapshots:
'@uiw/copy-to-clipboard@1.0.17': {}
'@uiw/react-markdown-preview@5.1.4(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
'@uiw/react-markdown-preview@5.1.5(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
'@babel/runtime': 7.26.9
'@uiw/copy-to-clipboard': 1.0.17
@@ -11197,7 +11573,7 @@ snapshots:
'@uiw/react-md-editor@4.0.7(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
'@babel/runtime': 7.26.9
'@uiw/react-markdown-preview': 5.1.4(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@uiw/react-markdown-preview': 5.1.5(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
rehype: 13.0.2
@@ -11445,6 +11821,8 @@ snapshots:
async-function@1.0.0: {}
async_hooks@1.0.0: {}
attr-accept@2.2.5: {}
autoprefixer@10.4.20(postcss@8.5.3):
@@ -11880,6 +12258,9 @@ snapshots:
detect-libc@2.0.4:
optional: true
detect-libc@2.1.2:
optional: true
devlop@1.1.0:
dependencies:
dequal: 2.0.3
@@ -13961,6 +14342,29 @@ snapshots:
- '@babel/core'
- babel-plugin-macros
next@15.5.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies:
'@next/env': 15.5.7
'@swc/helpers': 0.5.15
caniuse-lite: 1.0.30001724
postcss: 8.4.31
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
styled-jsx: 5.1.6(react@18.3.1)
optionalDependencies:
'@next/swc-darwin-arm64': 15.5.7
'@next/swc-darwin-x64': 15.5.7
'@next/swc-linux-arm64-gnu': 15.5.7
'@next/swc-linux-arm64-musl': 15.5.7
'@next/swc-linux-x64-gnu': 15.5.7
'@next/swc-linux-x64-musl': 15.5.7
'@next/swc-win32-arm64-msvc': 15.5.7
'@next/swc-win32-x64-msvc': 15.5.7
sharp: 0.34.5
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
no-case@2.3.2:
dependencies:
lower-case: 1.1.4
@@ -14916,6 +15320,9 @@ snapshots:
semver@7.7.2: {}
semver@7.7.3:
optional: true
sentence-case@2.1.1:
dependencies:
no-case: 2.3.2
@@ -14976,6 +15383,38 @@ snapshots:
'@img/sharp-win32-x64': 0.34.2
optional: true
sharp@0.34.5:
dependencies:
'@img/colour': 1.0.0
detect-libc: 2.1.2
semver: 7.7.3
optionalDependencies:
'@img/sharp-darwin-arm64': 0.34.5
'@img/sharp-darwin-x64': 0.34.5
'@img/sharp-libvips-darwin-arm64': 1.2.4
'@img/sharp-libvips-darwin-x64': 1.2.4
'@img/sharp-libvips-linux-arm': 1.2.4
'@img/sharp-libvips-linux-arm64': 1.2.4
'@img/sharp-libvips-linux-ppc64': 1.2.4
'@img/sharp-libvips-linux-riscv64': 1.2.4
'@img/sharp-libvips-linux-s390x': 1.2.4
'@img/sharp-libvips-linux-x64': 1.2.4
'@img/sharp-libvips-linuxmusl-arm64': 1.2.4
'@img/sharp-libvips-linuxmusl-x64': 1.2.4
'@img/sharp-linux-arm': 0.34.5
'@img/sharp-linux-arm64': 0.34.5
'@img/sharp-linux-ppc64': 0.34.5
'@img/sharp-linux-riscv64': 0.34.5
'@img/sharp-linux-s390x': 0.34.5
'@img/sharp-linux-x64': 0.34.5
'@img/sharp-linuxmusl-arm64': 0.34.5
'@img/sharp-linuxmusl-x64': 0.34.5
'@img/sharp-wasm32': 0.34.5
'@img/sharp-win32-arm64': 0.34.5
'@img/sharp-win32-ia32': 0.34.5
'@img/sharp-win32-x64': 0.34.5
optional: true
shebang-command@2.0.0:
dependencies:
shebang-regex: 3.0.0
+242 -12
View File
@@ -1,13 +1,243 @@
{
"**XPack** is a lightweight, open-source marketplace framework for MCP (Model Context Protocol) services.": "**XPack** is a lightweight, open-source marketplace framework for MCP (Model Context Protocol) services.",
"It allows you to transform any OpenAPI into a monetizable MCP service and build your own API store in just minutes.": "It allows you to transform any OpenAPI into a monetizable MCP service and build your own API store in just minutes.",
"✨ With XPack, you can:": "✨ With XPack, you can:",
"- ✅ **One-click OpenAPI → MCP service config**": "- ✅ **One-click OpenAPI → MCP service config**",
"- 🧾 **SEO-friendly homepage + mcp service page**": "- 🧾 **SEO-friendly homepage + mcp service page**",
"- 💳 **Built-in billing (per-call)**": "- 💳 **Built-in billing (per-call)**",
"- 👥 **User account management**": "- 👥 **User account management**",
"- 🛠 **Support Stripe Payment**": "- 🛠 **Support Stripe Payment**",
"- 🔐 **Support Email & Google OAuth Sign in**": "- 🔐 **Support Email & Google OAuth Sign in**",
"Everything is open-source and licensed under **Apache 2.0** — ready for commercial use.": "Everything is open-source and licensed under **Apache 2.0** — ready for commercial use.",
"About Us": "About Us"
}
"Server Configuration": "Server Configuration",
"Subdomain": "Subdomain",
"Enter subdomain (e.g., mysite)": "Enter subdomain (e.g., mysite)",
"Subdomain is required": "Subdomain is required",
"Subdomain must contain only lowercase letters, numbers, and hyphens": "Subdomain must contain only lowercase letters, numbers, and hyphens",
"Subdomain must be between 3 and 63 characters": "Subdomain must be between 3 and 63 characters",
"Log in to your admin account to continue": "Log in to your admin account to continue",
"Your unique subdomain for the platform": "Your unique subdomain for the platform",
"Let's get started!": "Let's get started!",
"Welcome! It's time to set up Lethe Live.": "Welcome! It's time to set up Lethe Live.",
"Start a new Ghost publication": "Start a new Ghost publication",
"Customize your design": "Customize your design",
"Craft a look that reflects your brand and style": "Craft a look that reflects your brand and style",
"Explore the editor": "Explore the editor",
"Build your audience": "Build your audience",
"Share your publication": "Share your publication",
"More questions? Check out our": "More questions? Check out our",
"Help Center": "Help Center",
"Skip onboarding": "Skip onboarding",
"Great! All tasks completed!": "Great! All tasks completed!",
"Continue to Dashboard": "Continue to Dashboard",
"Page Not Found": "Page Not Found",
"The page you're looking for doesn't exist or has been moved.": "The page you're looking for doesn't exist or has been moved.",
"This page could not be found.": "This page could not be found.",
"Back to Home": "Back to Home",
"Subdomain Change Warning": "Subdomain Change Warning",
"The subdomain has been changed. You will be automatically redirected to the new address in {{seconds}} seconds.": "The subdomain has been changed. You will be automatically redirected to the new address in {{seconds}} seconds.",
"New Address": "New Address",
"Redirect Now": "Redirect Now",
"Daily Registered Users": "Daily Registered Users",
"Daily Revenue": "Daily Revenue",
"Daily API Calls": "Daily API Calls",
"Top Servers by Calls": "Top Servers by Calls",
"Date": "Date",
"Users": "Users",
"Revenue": "Revenue",
"Calls": "Calls",
"Server Name": "Server Name",
"Call Volume": "Call Volume",
"Last 30 Days Overview": "Last 30 Days Overview",
"Sort by Call Volume": "Sort by Call Volume",
"Sort by Name": "Sort by Name",
"Total subscribers": "Total subscribers",
"Avg. open rate": "Avg. open rate",
"Avg. click rate": "Avg. click rate",
"Total Users": "Total Users",
"Total Revenue": "Total Revenue",
"Total API Calls": "Total API Calls",
"API server for machine learning tasks": "API server for machine learning tasks",
"Web Scraping Statistics": "Web Scraping Statistics",
"Total Scraped Pages": "Total Scraped Pages",
"Total number of pages scraped from the website": "Total number of pages scraped from the website",
"Scraping Growth Chart": "Scraping Growth Chart",
"New Pages": "New Pages",
"Daily growth of scraped pages over time": "Daily growth of scraped pages over time",
"Real-time data processing service": "Real-time data processing service",
"Natural language processing service": "Natural language processing service",
"Computer vision analysis tool": "Computer vision analysis tool",
"Translation and localization service": "Translation and localization service",
"Web search and indexing engine": "Web search and indexing engine",
"Cloud file storage and management": "Cloud file storage and management",
"Email delivery and management service": "Email delivery and management service",
"Weather data and forecasting API": "Weather data and forecasting API",
"Calendar synchronization service": "Calendar synchronization service",
"Settings": "Settings",
"System Settings": "System Settings",
"General": "General",
"Platform basic configuration": "Platform basic configuration",
"Homepage": "Homepage",
"Homepage content and theme settings": "Homepage content and theme settings",
"Payment Channels": "Payment Channels",
"Configure payment channels": "Configure payment channels",
"Admin Settings": "Admin Settings",
"Configure admin login credentials": "Configure admin login credentials",
"Search settings": "Search settings",
"Clear": "Clear",
"No results": "No results",
"Welcome to Your Platform!": "Welcome to Your Platform!",
"Let's set up {{platformName}} to get you started.": "Let's set up {{platformName}} to get you started.",
"Configure Platform Settings": "Configure Platform Settings",
"Set up your platform name, domain, and branding.": "Set up your platform name, domain, and branding.",
"Add MCP Services": "Add MCP Services",
"Configure and deploy your first MCP server tools.": "Configure and deploy your first MCP server tools.",
"Manage Users": "Manage Users",
"View and configure user accounts and permissions.": "View and configure user accounts and permissions.",
"Configure Payment & Billing": "Configure Payment & Billing",
"Set up payment channels and token pricing.": "Set up payment channels and token pricing.",
"Generate API Keys": "Generate API Keys",
"Create API keys for external integrations.": "Create API keys for external integrations.",
"Share Your Platform": "Share Your Platform",
"Invite users and promote your MCP platform.": "Invite users and promote your MCP platform.",
"Need help getting started? Check out our": "Need help getting started? Check out our",
"Discord Community": "Discord Community",
"Skip setup guide": "Skip setup guide",
"Excellent! Your platform is ready to go!": "Excellent! Your platform is ready to go!",
"Go to Dashboard": "Go to Dashboard",
"Platform": "Platform",
"Billing & Payments": "Billing & Payments",
"Administration": "Administration",
"Meta Data": "Meta Data",
"Extra content for search engines and social accounts": "Extra content for search engines and social accounts",
"Search": "Search",
"X Card": "X Card",
"Facebook Card": "Facebook Card",
"Meta Title": "Meta Title",
"Enter meta title": "Enter meta title",
"Recommended: 70 characters": "Recommended: 70 characters",
"Meta Description": "Meta Description",
"Enter meta description": "Enter meta description",
"Recommended: 156 characters": "Recommended: 156 characters",
"Preview": "Preview",
"Lethe Live": "Lethe Live",
"Thoughts, stories and ideas.": "Thoughts, stories and ideas.",
"Upload X Image": "Upload X Image",
"Upload Facebook Image": "Upload Facebook Image",
"Uploading...": "Uploading...",
"X Title": "X Title",
"Enter X title": "Enter X title",
"X Description": "X Description",
"Enter X description": "Enter X description",
"Facebook Title": "Facebook Title",
"Enter Facebook title": "Enter Facebook title",
"Facebook Description": "Facebook Description",
"Enter Facebook description": "Enter Facebook description",
"Meta data saved successfully": "Meta data saved successfully",
"Please select a valid image file": "Please select a valid image file",
"Image size should be less than 5MB": "Image size should be less than 5MB",
"Failed to upload image": "Failed to upload image",
"General settings": "General settings",
"Title & description": "Title & description",
"Configure your site title and description": "Configure your site title and description",
"Meta data": "Meta data",
"SEO metadata and site configuration": "SEO metadata and site configuration",
"Connect your social media accounts": "Connect your social media accounts",
"Custom domain": "Custom domain",
"Configure your custom domain settings": "Configure your custom domain settings",
"Site": "Site",
"Branding": "Branding",
"Logo, colors, and brand identity": "Logo, colors, and brand identity",
"Theme": "Theme",
"Visual theme and appearance settings": "Visual theme and appearance settings",
"Navigation": "Navigation",
"Configure site navigation and menus": "Configure site navigation and menus",
"Business": "Business",
"Payment": "Payment",
"Payment processing and billing settings": "Payment processing and billing settings",
"XPack Explore": "XPack Explore",
"Explore XPack features and integrations": "Explore XPack features and integrations",
"Advanced": "Advanced",
"Code injection": "Code injection",
"Custom code injection and scripts": "Custom code injection and scripts",
"Enter the domain you want to use": "Enter the domain you want to use",
"Enter your full domain name (e.g., www.example.com)": "Enter your full domain name (e.g., www.example.com)",
"Create your DNS records": "Create your DNS records",
"Add the following DNS records at your DNS provider": "Add the following DNS records at your DNS provider",
"DNS Records Table": "DNS Records Table",
"Type": "Type",
"Host": "Host",
"Value": "Value",
"Activate custom domain": "Activate custom domain",
"Your DNS looks good. You can activate now.": "Your DNS looks good. You can activate now.",
"Make sure your DNS records have propagated before activation.": "Make sure your DNS records have propagated before activation.",
"Activate": "Activate",
"Domain": "Domain",
"Please enter a valid URL with http:// or https://": "Please enter a valid URL with http:// or https://",
"Create MCP Server": "Create MCP Server",
"Choose how you want to create your MCP server": "Choose how you want to create your MCP server",
"Website Content Scraper": "Website Content Scraper",
"Create an MCP server that can scrape and extract content from websites": "Create an MCP server that can scrape and extract content from websites",
"OpenAPI Generator": "OpenAPI Generator",
"Generate MCP server from OpenAPI/Swagger documentation": "Generate MCP server from OpenAPI/Swagger documentation",
"Update Website Scraper": "Update Website Scraper",
"Sync from OpenAPI": "Sync from OpenAPI",
"Update Server": "Update Server",
"Add Server": "Add Server",
"Website URL": "Website URL",
"Enter the website URL (e.g., https://example.com)": "Enter the website URL (e.g., https://example.com)",
"Update website URL for content scraping": "Update website URL for content scraping",
"Enter the website URL you want to scrape content from": "Enter the website URL you want to scrape content from",
"Creating webscraper server...": "Creating webscraper server...",
"Sync server configuration from OpenAPI/Swagger documentation": "Sync server configuration from OpenAPI/Swagger documentation",
"Generate MCP server configuration from OpenAPI/Swagger documentation": "Generate MCP server configuration from OpenAPI/Swagger documentation",
"From URL": "From URL",
"Upload File": "Upload File",
"OpenAPI URL": "OpenAPI URL",
"Enter the URL to your OpenAPI/Swagger specification": "Enter the URL to your OpenAPI/Swagger specification",
"Upload OpenAPI File": "Upload OpenAPI File",
"Choose File": "Choose File",
"Supports JSON and YAML formats": "Supports JSON and YAML formats",
"Parsing OpenAPI document...": "Parsing OpenAPI document...",
"Back": "Back",
"Create Server": "Create Server",
"Generate Server": "Generate Server",
"Sync Server": "Sync Server",
"Select Type": "Select Type",
"Configure": "Configure",
"OR": "OR",
"Use Website Scraper": "Use Website Scraper",
"Use OpenAPI Generator": "Use OpenAPI Generator",
"Data scraping in progress...": "Data scraping in progress...",
"Scraped {{current}} of {{total}} pages": "Scraped {{current}} of {{total}} pages",
"Scraped {{count}} pages": "Scraped {{count}} pages",
"Modifying the URL will trigger re-scraping of the website data.": "Modifying the URL will trigger re-scraping of the website data.",
"You have modified the Website URL. This will trigger re-scraping of the website data. Are you sure you want to continue?": "You have modified the Website URL. This will trigger re-scraping of the website data. Are you sure you want to continue?",
"Scraping...": "Scraping...",
"Server Type": "Server Type",
"Edit Website URL": "Edit Website URL",
"Modifying the website URL will trigger re-scraping of the website data. This process may take some time to complete.": "Modifying the website URL will trigger re-scraping of the website data. This process may take some time to complete.",
"Please enter a valid URL": "Please enter a valid URL",
"Use the refresh button to modify the website URL": "Use the refresh button to modify the website URL",
"Cannot publish while scraping": "Cannot publish while scraping",
"Publish": "Publish",
"Unpublish": "Unpublish",
"Published": "Published",
"Unpublished": "Unpublished",
"Your brand": "Your brand",
"Support JPG, PNG, GIF, SVG. Max size 5MB": "Support JPG, PNG, GIF, SVG. Max size 5MB",
"Site title": "Site title",
"Enter site title": "Enter site title",
"Main title displayed on the home page": "Main title displayed on the home page",
"Site description": "Site description",
"Enter site description": "Enter site description",
"Secondary description displayed below the main title": "Secondary description displayed below the main title",
"Title is required": "Title is required",
"Custom Domain": "Custom Domain",
"Activate your domain": "Activate your domain",
"Set Custom Domain": "Set Custom Domain",
"Configure platform language": "Configure platform language",
"Enter title": "Enter title",
"Enter link URL": "Enter link URL",
"Configure FAQ": "Configure FAQ",
"Enter question": "Enter question",
"Enter answer": "Enter answer",
"Enable Stripe Payment": "Enable Stripe Payment",
"Toggle to enable or disable Stripe payment interface": "Toggle to enable or disable Stripe payment interface",
"Enter Secret Key": "Enter Secret Key",
"Enter Webhook Secret": "Enter Webhook Secret",
"Email Login Settings": "Email Login Settings",
"Open in new tab": "Open in new tab",
"Analyze platform usage and revenue": "Analyze platform usage and revenue",
"Change your password": "Change your password"
}
+93 -83
View File
@@ -81,7 +81,7 @@
"Free": "Free",
"Sign up now to get 100 free calls every month.": "Sign up now to get 100 free calls every month.",
"Generate and manage dynamic PowerPoints and Google Slides with your own custom branding and layouts.": "Generate and manage dynamic PowerPoints and Google Slides with your own custom branding and layouts.",
"Try for free": "Try for free",
"Sign up to get the auth key": "Sign up to get the auth key",
"Lightning Fast Setup": "Lightning Fast Setup",
"Enterprise Security": "Enterprise Security",
"Global Scale": "Global Scale",
@@ -103,7 +103,7 @@
"Build AI Agents": "Build AI Agents",
"With Incredible MCP": "With Incredible MCP",
"Instant Integration": "Instant Integration",
"Connect to global APIs and MCP services with just one config or SDK.": "Connect to global APIs and MCP services with just one config or SDK.",
"Connect to global APIs and MCP servers with just one config or SDK.": "Connect to global APIs and MCP servers with just one config or SDK.",
"Zero Overhead": "Zero Overhead",
"Flexible pay-as-you-go pricing to fuel agent growth at every stage.": "Flexible pay-as-you-go pricing to fuel agent growth at every stage.",
"Secure & Compliant": "Secure & Compliant",
@@ -119,24 +119,24 @@
"Get Started": "Get Started",
"Demo": "Demo",
"Start Deploying": "Start Deploying",
"We help these products connect to global services.": "We help these products connect to global services.",
"We help these products connect to global servers.": "We help these products connect to global servers.",
"Become a partner": "Become a partner",
"AI Design": "AI Design",
"AI Agent": "AI Agent",
"AI Browser": "AI Browser",
"Home": "Home",
"Services": "Services",
"Servers": "Servers",
"Interesting in \n becoming a partner?": "Interesting in \n becoming a partner?",
"Other Partners": "Other Partners",
"Services List": "Services List",
"Submit services": "Submit services",
"Interesting in \n becoming a services supplier?": "Interesting in \n becoming a services supplier?",
"Apply to become a supplier and provide services to global users.": "Apply to become a supplier and provide services to global users.",
"Servers List": "Servers List",
"Submit servers": "Submit servers",
"Interesting in \n becoming a servers supplier?": "Interesting in \n becoming a servers supplier?",
"Apply to become a supplier and provide servers to global users.": "Apply to become a supplier and provide servers to global users.",
"Become a supplier": "Become a supplier",
"We only list some services": "We only list some services",
"Other Services": "Other Services",
"We only list some servers": "We only list some servers",
"Other Servers": "Other Servers",
"Submit a demo": "Submit a demo",
"Number of service categories": "Number of service categories",
"Number of server categories": "Number of server categories",
"Number of MCP Tools": "Number of MCP Tools",
"Time for integration": "Time for integration",
"Daily MCP request count": "Daily MCP request count",
@@ -148,31 +148,31 @@
"It's hard to say goodbyes": "It's hard to say goodbyes",
"We're sorry to see you go. Your subscription has been cancelled.": "We're sorry to see you go. Your subscription has been cancelled.",
"Playground": "Playground",
"MCP Services Management": "MCP Services Management",
"Service List": "Service List",
"Add Service": "Add Service",
"MCP Servers Management": "MCP Servers Management",
"Server List": "Server List",
"Add Server": "Add Server",
"OpenAPI Generator": "OpenAPI Generator",
"Service Name": "Service Name",
"Service Description": "Service Description",
"Service Category": "Service Category",
"Service Status": "Service Status",
"Online": "Online",
"Offline": "Offline",
"Server Name": "Server Name",
"Server Description": "Server Description",
"Server Category": "Server Category",
"Server Status": "Server Status",
"Published": "Published",
"Unpublished": "Unpublished",
"Actions": "Actions",
"Edit": "Edit",
"Delete": "Delete",
"Toggle Status": "Toggle Status",
"Create New Service": "Create New Service",
"Edit Service": "Edit Service",
"Create New Server": "Create New Server",
"Edit Server": "Edit Server",
"Generate from OpenAPI": "Generate from OpenAPI",
"Update from OpenAPI": "Update from OpenAPI",
"Sync from OpenAPI": "Sync from OpenAPI",
"Sync service configuration from OpenAPI/Swagger documentation": "Sync service configuration from OpenAPI/Swagger documentation",
"Sync Service": "Sync Service",
"Sync server configuration from OpenAPI/Swagger documentation": "Sync server configuration from OpenAPI/Swagger documentation",
"Sync Server": "Sync Server",
"OpenAPI URL": "OpenAPI URL",
"Upload OpenAPI File": "Upload OpenAPI File",
"Generate Service": "Generate Service",
"Service Configuration": "Service Configuration",
"Generate Server": "Generate Server",
"Server Configuration": "Server Configuration",
"API Endpoint": "API Endpoint",
"Authentication": "Authentication",
"API Key": "API Key",
@@ -190,15 +190,14 @@
"Edit Tool": "Edit Tool",
"Delete Tool": "Delete Tool",
"Save Changes": "Save Changes",
"No tools configured for this service": "No tools configured for this service",
"Add tools to extend service functionality": "Add tools to extend service functionality",
"Configure and manage tools for this service": "Configure and manage tools for this service",
"No tools configured for this server": "No tools configured for this server",
"Add tools to extend server functionality": "Add tools to extend server functionality",
"Configure and manage tools for this server": "Configure and manage tools for this server",
"Add New Tool": "Add New Tool",
"Enter tool name": "Enter tool name",
"Enter tool description": "Enter tool description",
"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",
@@ -217,41 +216,36 @@
"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",
"Brief description of the service": "Brief description of the service",
"Detailed description of the service": "Detailed description of the service",
"Brief description of the server": "Brief description of the server",
"Detailed description of the server": "Detailed description of the server",
"Basic Information": "Basic Information",
"API Configuration": "API Configuration",
"Authentication Type": "Authentication Type",
"Update Service": "Update Service",
"Create Service": "Create Service",
"Update Server": "Update Server",
"Create Server": "Create Server",
"Confirm Delete": "Confirm Delete",
"Are you sure you want to delete this service?": "Are you sure you want to delete this service?",
"Are you sure you want to delete this server?": "Are you sure you want to delete this server?",
"This action cannot be undone.": "This action cannot be undone.",
"Manage your MCP services, configure APIs, and monitor service status": "Manage your MCP services, configure APIs, and monitor service status",
"Search services...": "Search services...",
"Manage your MCP servers, configure APIs, and monitor server status": "Manage your MCP servers, configure APIs, and monitor server status",
"Search MCP servers": "Search MCP servers",
"Filter by category": "Filter by category",
"Filter by status": "Filter by status",
"All Categories": "All Categories",
"All Status": "All Status",
"Created": "Created",
"Last Updated": "Last Updated",
"Total Services": "Total Services",
"Online Services": "Online Services",
"Offline Services": "Offline Services",
"Service created successfully": "Service created successfully",
"Service updated successfully": "Service updated successfully",
"Service deleted successfully": "Service deleted successfully",
"Service status updated successfully": "Service status updated successfully",
"Failed to create service": "Failed to create service",
"Failed to update service": "Failed to update service",
"Failed to delete service": "Failed to delete service",
"Failed to update service status": "Failed to update service status",
"Total Servers": "Total Servers",
"Server created successfully": "Server created successfully",
"Server updated successfully": "Server updated successfully",
"Server deleted successfully": "Server deleted successfully",
"Server status updated successfully": "Server status updated successfully",
"Failed to create server": "Failed to create server",
"Failed to update server": "Failed to update server",
"Failed to delete server": "Failed to delete server",
"Failed to update server status": "Failed to update server status",
"Invalid OpenAPI URL": "Invalid OpenAPI URL",
"Failed to parse OpenAPI document": "Failed to parse OpenAPI document",
"OpenAPI document parsed successfully": "OpenAPI document parsed successfully",
@@ -261,8 +255,8 @@
"Please select a file": "Please select a file",
"File uploaded successfully": "File uploaded successfully",
"Failed to upload file": "Failed to upload file",
"Service name is required": "Service name is required",
"Service description is required": "Service description is required",
"Server name is required": "Server name is required",
"Server description is required": "Server description is required",
"API endpoint is required": "API endpoint is required",
"Documentation is required": "Documentation is required",
"Connect Your AI Agent to the Real World": "Connect Your AI Agent to the Real World",
@@ -297,13 +291,13 @@
"Login Success": "Login Success",
"Login Error": "Login Error",
"Back Home": "Back Home",
"MCP Services": "MCP Services",
"MCP Servers": "MCP Servers",
"User Management": "User Management",
"Revenue Management": "Revenue Management",
"Payment Channels": "Payment Channels",
"System Settings": "System Settings",
"Overview and analytics": "Overview and analytics",
"Manage MCP services and API tools": "Manage MCP services and API tools",
"Manage MCP servers and API tools": "Manage MCP servers and API tools",
"Manage registered users": "Manage registered users",
"View user recharge history": "View user recharge history",
"Configure payment channels": "Configure payment channels",
@@ -357,7 +351,7 @@
"No": "No",
"User Statistics": "User Statistics",
"API Calls": "API Calls",
"Services Used": "Services Used",
"Servers Used": "Servers Used",
"Total Spent": "Total Spent",
"Wallet Balance": "Wallet Balance",
"Confirm Ban User": "Confirm Ban User",
@@ -386,13 +380,12 @@
"Enter your password": "Enter your password",
"Confirm your password": "Confirm your password",
"Passwords do not match": "Passwords do not match",
"Password must be at least 8 characters": "Password must be at least 8 characters",
"Registration successful": "Registration successful",
"Registration failed": "Registration failed",
"Email already exists": "Email already exists",
"Invalid email format": "Invalid email format",
"Sign up with Google": "Sign up with Google",
"Terms of Service": "Terms of Service",
"Terms of Server": "Terms of Server",
"Privacy Policy": "Privacy Policy",
"By signing up, you agree to our": "By signing up, you agree to our",
"and": "and",
@@ -436,9 +429,9 @@
"Enable Google Login": "Enable Google Login",
"Administrator Account": "Administrator Account",
"Platform Information": "Platform Information",
"Delete Service": "Delete Service",
"Delete Server": "Delete Server",
"Parsing OpenAPI document...": "Parsing OpenAPI document...",
"Generated Service Configuration": "Generated Service Configuration",
"Generated Server Configuration": "Generated Server Configuration",
"None": "None",
"Tags": "Tags",
"Paid": "Paid",
@@ -476,7 +469,7 @@
"Enter your verification code": "Enter your verification code",
"Resend": "Resend",
"Verify Email Error": "Verify Email Error",
"Generate MCP service configuration from OpenAPI/Swagger documentation": "Generate MCP service configuration from OpenAPI/Swagger documentation",
"Generate MCP server configuration from OpenAPI/Swagger documentation": "Generate MCP server configuration from OpenAPI/Swagger documentation",
"From URL": "From URL",
"Upload File": "Upload File",
"Choose File": "Choose File",
@@ -485,7 +478,12 @@
"Invalid email address": "Invalid email address",
"Back to Home": "Back to Home",
"Enter the URL to your OpenAPI/Swagger specification": "Enter the URL to your OpenAPI/Swagger specification",
"Enter service name": "Enter service name",
"Enter server name": "Enter server name",
"Server ID": "Server ID",
"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",
@@ -510,7 +508,7 @@
"API Key Header Name": "API Key Header Name",
"Secret Key format is incorrect, should start with sk_": "Secret Key format is incorrect, should start with sk_",
"Webhook Secret format is incorrect, should start with whsec_": "Webhook Secret format is incorrect, should start with whsec_",
"Password must be at least 8 characters long": "Password must be at least 8 characters long",
"Password must be at least 6 characters long": "Password must be at least 6 characters long",
"OAuth 2.0 Client Secret (optional, for server-side verification)": "OAuth 2.0 Client Secret (optional, for server-side verification)",
"Authorized redirect URI configured in Google Cloud Console": "Authorized redirect URI configured in Google Cloud Console",
"Webhook signing secret for verifying Stripe events": "Webhook signing secret for verifying Stripe events",
@@ -551,7 +549,7 @@
"Select currency": "Select currency",
"Default currency for the platform": "Default currency for the platform",
"call": "call",
"No services found": "No services found",
"No servers found": "No servers found",
"free/day": "free/day",
"Account (Email)": "Account (Email)",
"Recharge Amount": "Recharge Amount",
@@ -569,7 +567,7 @@
"No tools added yet. Add your first tool using the input above.": "No tools added yet. Add your first tool using the input above.",
"Insert tool below": "Insert tool below",
"Remove tool": "Remove tool",
"Service Detail": "Service Detail",
"Server Detail": "Server Detail",
"Billing Mode": "Billing Mode",
"Enable free quota": "Enable free quota",
"Configure Stripe payment interface": "Configure Stripe payment interface",
@@ -598,9 +596,9 @@
"Platform total fund pool": "Platform total fund pool",
"Today's API Calls": "Today's API Calls",
"API call count": "API call count",
"Total MCP Services": "Total MCP Services",
"Deployed services": "Deployed services",
"This is your AI service management center. You can quickly view platform core data on the left and manage and configure your MCP services, users, payment channels, etc.": "This is your AI service management center. You can quickly view platform core data on the left and manage and configure your MCP services, users, payment channels, etc.",
"Total MCP Servers": "Total MCP Servers",
"Deployed servers": "Deployed servers",
"This is your AI server management center. You can quickly view platform core data on the left and manage and configure your MCP servers, users, payment channels, etc.": "This is your AI server management center. You can quickly view platform core data on the left and manage and configure your MCP servers, users, payment channels, etc.",
"Log In": "Log In",
"Register Date": "Register Date",
"Dashboard": "Dashboard",
@@ -646,17 +644,16 @@
"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}}",
"Log Out": "Log Out",
"Enter your username": "Enter your username",
"Login": "Login",
"Admin Portal": "Admin Portal",
"Log in to admin console": "Log in to admin console",
"Welcome to XPack.AI Open Source": "Welcome to XPack.AI Open Source",
"Are you sure you want to delete this \"{{name}}\" service?": "Are you sure you want to delete this \"{{name}}\" service?",
"Service status toggled successfully": "Service status toggled successfully",
"Failed to toggle service status": "Failed to toggle service status",
"Log in to your admin account to continue": "Log in to your admin account to continue",
"Welcome to XPack.AI": "Welcome to XPack.AI",
"Are you sure you want to delete this \"{{name}}\" server?": "Are you sure you want to delete this \"{{name}}\" server?",
"Server status toggled successfully": "Server status toggled successfully",
"Failed to toggle server status": "Failed to toggle server status",
"Stripe configuration saved successfully": "Stripe configuration saved successfully",
"Failed to save Stripe configuration": "Failed to save Stripe configuration",
"System config updated successfully": "System config updated successfully",
@@ -691,8 +688,6 @@
"{{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",
"Email Configuration": "Email Configuration",
"Configure SMTP settings for email notifications": "Configure SMTP settings for email notifications",
@@ -766,10 +761,10 @@
"Traditional email and password authentication": "Traditional email and password authentication",
"Email/Verification Code": "Email/Verification Code",
"Passwordless login with email verification code": "Passwordless login with email verification code",
"Email service is not configured. Please configure email settings first.": "Email service is not configured. Please configure email settings first.",
"SMTP is not configured. Please configure email settings first.": "SMTP is not configured. Please configure email settings first.",
"Go to Settings": "Go to Settings",
"AI Tools Marketplace": "AI Tools Marketplace",
"A marketplace for AI tools and services. Discover and integrate powerful AI solutions for your projects.": "A marketplace for AI tools and services. Discover and integrate powerful AI solutions for your projects.",
"A marketplace for AI tools and servers. Discover and integrate powerful AI solutions for your projects.": "A marketplace for AI tools and servers. Discover and integrate powerful AI solutions for your projects.",
"Configuration": "Configuration",
"Featured Products": "Featured Products",
"Search": "Search",
@@ -778,7 +773,7 @@
"Re-enter new password": "Re-enter new password",
"Confirm new password": "Confirm new password",
"New password and confirm password do not match": "New password and confirm password do not match",
"New password must be at least 8 characters long": "New password must be at least 8 characters long",
"New password must be at least 6 characters long": "New password must be at least 6 characters long",
"New password and confirm password must be the same": "New password and confirm password must be the same",
"New Password": "New Password",
"Confirm New Password": "Confirm New Password",
@@ -799,7 +794,6 @@
"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<script>\n // Google Analytics\n gtag('config', 'GA_MEASUREMENT_ID');\n</script>\n\n<style>\n .custom-style {\n color: #333;\n }\n</style>": "Enter your custom HTML, CSS, or JavaScript code here...\n\nExample:\n<script>\n // Google Analytics\n gtag('config', 'GA_MEASUREMENT_ID');\n</script>\n\n<style>\n .custom-style {\n color: #333;\n }\n</style>",
"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.",
@@ -838,8 +832,6 @@
"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",
@@ -871,5 +863,23 @@
"Price per million output tokens": "Price per million output tokens",
"Input": "Input",
"Output": "Output",
"1M tokens": "1M tokens"
"1M tokens": "1M tokens",
"Total Spending": "Total Spending",
"Remote": "Remote",
"Platform Logo": "Platform Logo",
"Support JPG, PNG, GIF. Max size 5MB": "Support JPG, PNG, GIF. Max size 5MB",
"(30 days)": "(30 days)",
"Sign in": "Sign in",
"or create your account": "or create your account",
"No account? Just continue—we’ll set you up.": "No account? Just continue—we’ll set you up.",
"Password must be at least 6 characters": "Password must be at least 6 characters",
"Email is required": "Email is required",
"No servers available": "No servers available",
"(Deleted)": "(Deleted)",
"Transport Type": "Transport Type",
"Server ID must be less than 256 characters": "Server ID must be less than 256 characters",
"Server Name must be less than 256 characters": "Server Name must be less than 256 characters",
"API Endpoint must be a valid HTTP/HTTPS URL": "API Endpoint must be a valid HTTP/HTTPS URL",
"Server ID is required": "Server ID is required",
"Short description is required": "Short description is required"
}
+242 -12
View File
@@ -1,13 +1,243 @@
{
"**XPack** is a lightweight, open-source marketplace framework for MCP (Model Context Protocol) services.": "**XPack** 是一个轻量级的开源 MCP(模型上下文协议)服务市场框架。",
"It allows you to transform any OpenAPI into a monetizable MCP service and build your own API store in just minutes.": "它允许您将任何 OpenAPI 转换为可盈利的 MCP 服务,并在几分钟内构建您自己的 API 商店。",
"✨ With XPack, you can:": "✨ 使用 XPack,您可以:",
"- ✅ **One-click OpenAPI → MCP service config**": "- ✅ **一键 OpenAPI → MCP 服务配置**",
"- 🧾 **SEO-friendly homepage + mcp service page**": "- 🧾 **SEO 友好的主页 + MCP 服务页面**",
"- 💳 **Built-in billing (per-call)**": "- 💳 **内置计费(按调用计费)**",
"- 👥 **User account management**": "- 👥 **用户账户管理**",
"- 🛠 **Support Stripe Payment**": "- 🛠 **支持 Stripe 支付**",
"- 🔐 **Support Email & Google OAuth Sign in**": "- 🔐 **支持邮箱和 Google OAuth 登录**",
"Everything is open-source and licensed under **Apache 2.0** — ready for commercial use.": "一切都是开源的,采用 **Apache 2.0** 许可证 — 可用于商业用途。",
"About Us": "关于我们"
}
"Server Configuration": "服务器配置",
"Subdomain": "子域名",
"Enter subdomain (e.g., mysite)": "输入子域名(例如:mysite)",
"Subdomain is required": "子域名不能为空",
"Subdomain must contain only lowercase letters, numbers, and hyphens": "子域名只能包含小写字母、数字和连字符",
"Subdomain must be between 3 and 63 characters": "子域名长度需在 3 到 63 个字符之间",
"Log in to your admin account to continue": "登录管理员账号以继续",
"Your unique subdomain for the platform": "平台的唯一子域名",
"Let's get started!": "开始设置!",
"Welcome! It's time to set up Lethe Live.": "欢迎!是时候设置 Lethe Live 了。",
"Start a new Ghost publication": "开始新的 Ghost 发布",
"Customize your design": "自定义你的设计",
"Craft a look that reflects your brand and style": "打造反映你品牌与风格的外观",
"Explore the editor": "探索编辑器",
"Build your audience": "构建你的受众",
"Share your publication": "分享你的发布内容",
"More questions? Check out our": "还有问题?请查看我们的",
"Help Center": "帮助中心",
"Skip onboarding": "跳过引导",
"Great! All tasks completed!": "太棒了!所有任务都已完成!",
"Continue to Dashboard": "进入仪表盘",
"Page Not Found": "页面未找到",
"The page you're looking for doesn't exist or has been moved.": "你要访问的页面不存在或已被移动。",
"This page could not be found.": "无法找到此页面。",
"Back to Home": "返回首页",
"Subdomain Change Warning": "子域名更改提醒",
"The subdomain has been changed. You will be automatically redirected to the new address in {{seconds}} seconds.": "子域名已更改。你将在 {{seconds}} 秒后自动跳转至新地址。",
"New Address": "新地址",
"Redirect Now": "立即跳转",
"Daily Registered Users": "每日注册用户",
"Daily Revenue": "每日营收",
"Daily API Calls": "每日 API 调用",
"Top Servers by Calls": "调用量最多的服务器",
"Date": "日期",
"Users": "用户",
"Revenue": "收入",
"Calls": "调用量",
"Server Name": "服务器名称",
"Call Volume": "调用量",
"Last 30 Days Overview": "近 30 天概览",
"Sort by Call Volume": "按调用量排序",
"Sort by Name": "按名称排序",
"Total subscribers": "订阅者总数",
"Avg. open rate": "平均打开率",
"Avg. click rate": "平均点击率",
"Total Users": "用户总数",
"Total Revenue": "总收入",
"Total API Calls": "API 调用总数",
"API server for machine learning tasks": "用于机器学习任务的 API 服务器",
"Web Scraping Statistics": "网页爬取统计",
"Total Scraped Pages": "已爬取页面总数",
"Total number of pages scraped from the website": "从网站爬取的页面总数",
"Scraping Growth Chart": "爬取增长图",
"New Pages": "新增页面",
"Daily growth of scraped pages over time": "每日新增爬取页面数量",
"Real-time data processing service": "实时数据处理服务",
"Natural language processing service": "自然语言处理服务",
"Computer vision analysis tool": "计算机视觉分析工具",
"Translation and localization service": "翻译与本地化服务",
"Web search and indexing engine": "网页搜索与索引引擎",
"Cloud file storage and management": "云端文件存储与管理",
"Email delivery and management service": "邮件投递与管理服务",
"Weather data and forecasting API": "天气数据与预测 API",
"Calendar synchronization service": "日历同步服务",
"Settings": "设置",
"System Settings": "系统设置",
"General": "通用设置",
"Platform basic configuration": "平台基础配置",
"Homepage": "首页",
"Homepage content and theme settings": "首页内容与主题设置",
"Payment Channels": "支付渠道",
"Configure payment channels": "配置支付渠道",
"Admin Settings": "管理员设置",
"Configure admin login credentials": "配置管理员登录信息",
"Search settings": "搜索设置",
"Clear": "清除",
"No results": "无结果",
"Welcome to Your Platform!": "欢迎使用你的平台!",
"Let's set up {{platformName}} to get you started.": "让我们来设置 {{platformName}},开始你的旅程。",
"Configure Platform Settings": "配置平台设置",
"Set up your platform name, domain, and branding.": "设置平台名称、域名和品牌标识。",
"Add MCP Services": "添加 MCP 服务",
"Configure and deploy your first MCP server tools.": "配置并部署你的第一个 MCP 服务器工具。",
"Manage Users": "管理用户",
"View and configure user accounts and permissions.": "查看并配置用户账号与权限。",
"Configure Payment & Billing": "配置支付与结算",
"Set up payment channels and token pricing.": "设置支付渠道与 Token 定价。",
"Generate API Keys": "生成 API Key",
"Create API keys for external integrations.": "为外部集成创建 API Key。",
"Share Your Platform": "分享你的平台",
"Invite users and promote your MCP platform.": "邀请用户并推广你的 MCP 平台。",
"Need help getting started? Check out our": "需要帮助?请查看我们的",
"Discord Community": "Discord 社区",
"Skip setup guide": "跳过设置向导",
"Excellent! Your platform is ready to go!": "太棒了!你的平台已准备就绪!",
"Go to Dashboard": "进入仪表盘",
"Platform": "平台",
"Billing & Payments": "账单与支付",
"Administration": "管理",
"Meta Data": "元数据",
"Extra content for search engines and social accounts": "用于搜索引擎与社交平台的额外信息",
"Search": "搜索",
"X Card": "X 卡片",
"Facebook Card": "Facebook 卡片",
"Meta Title": "Meta 标题",
"Enter meta title": "输入 Meta 标题",
"Recommended: 70 characters": "建议:70 个字符",
"Meta Description": "Meta 描述",
"Enter meta description": "输入 Meta 描述",
"Recommended: 156 characters": "建议:156 个字符",
"Preview": "预览",
"Lethe Live": "Lethe Live",
"Thoughts, stories and ideas.": "思想、故事与想法。",
"Upload X Image": "上传 X 图片",
"Upload Facebook Image": "上传 Facebook 图片",
"Uploading...": "上传中...",
"X Title": "X 标题",
"Enter X title": "输入 X 标题",
"X Description": "X 描述",
"Enter X description": "输入 X 描述",
"Facebook Title": "Facebook 标题",
"Enter Facebook title": "输入 Facebook 标题",
"Facebook Description": "Facebook 描述",
"Enter Facebook description": "输入 Facebook 描述",
"Meta data saved successfully": "元数据保存成功",
"Please select a valid image file": "请选择有效的图片文件",
"Image size should be less than 5MB": "图片大小应小于 5MB",
"Failed to upload image": "图片上传失败",
"General settings": "通用设置",
"Title & description": "标题与描述",
"Configure your site title and description": "配置站点标题与描述",
"Meta data": "元数据",
"SEO metadata and site configuration": "SEO 元数据与站点配置",
"Connect your social media accounts": "连接你的社交媒体账号",
"Custom domain": "自定义域名",
"Configure your custom domain settings": "配置你的自定义域名设置",
"Site": "站点",
"Branding": "品牌",
"Logo, colors, and brand identity": "Logo、颜色与品牌识别",
"Theme": "主题",
"Visual theme and appearance settings": "视觉主题与外观设置",
"Navigation": "导航",
"Configure site navigation and menus": "配置站点导航与菜单",
"Business": "业务",
"Payment": "支付",
"Payment processing and billing settings": "支付处理与结算设置",
"XPack Explore": "XPack 探索",
"Explore XPack features and integrations": "探索 XPack 的功能与集成",
"Advanced": "高级",
"Code injection": "代码注入",
"Custom code injection and scripts": "自定义代码注入与脚本",
"Enter the domain you want to use": "输入你要使用的域名",
"Enter your full domain name (e.g., www.example.com)": "输入完整域名(例如:www.example.com)",
"Create your DNS records": "创建你的 DNS 记录",
"Add the following DNS records at your DNS provider": "在你的 DNS 服务商处添加以下记录",
"DNS Records Table": "DNS 记录表",
"Type": "类型",
"Host": "主机名",
"Value": "值",
"Activate custom domain": "激活自定义域名",
"Your DNS looks good. You can activate now.": "DNS 看起来没问题。现在可以激活了。",
"Make sure your DNS records have propagated before activation.": "激活前请确保 DNS 记录已生效。",
"Activate": "激活",
"Domain": "域名",
"Please enter a valid URL with http:// or https://": "请输入包含 http:// 或 https:// 的有效 URL",
"Create MCP Server": "创建 MCP 服务器",
"Choose how you want to create your MCP server": "选择创建 MCP 服务器的方式",
"Website Content Scraper": "网站内容爬虫",
"Create an MCP server that can scrape and extract content from websites": "创建可以爬取并提取网站内容的 MCP 服务器",
"OpenAPI Generator": "OpenAPI 生成器",
"Generate MCP server from OpenAPI/Swagger documentation": "从 OpenAPI/Swagger 文档生成 MCP 服务器",
"Update Website Scraper": "更新网站爬虫",
"Sync from OpenAPI": "从 OpenAPI 同步",
"Update Server": "更新服务器",
"Add Server": "添加服务器",
"Website URL": "网站 URL",
"Enter the website URL (e.g., https://example.com)": "输入网站 URL(例如:https://example.com)",
"Update website URL for content scraping": "更新用于内容爬取的网站 URL",
"Enter the website URL you want to scrape content from": "输入你想爬取内容的网站 URL",
"Creating webscraper server...": "正在创建爬虫服务器...",
"Sync server configuration from OpenAPI/Swagger documentation": "从 OpenAPI/Swagger 文档同步服务器配置",
"Generate MCP server configuration from OpenAPI/Swagger documentation": "从 OpenAPI/Swagger 文档生成 MCP 服务器配置",
"From URL": "从 URL",
"Upload File": "上传文件",
"OpenAPI URL": "OpenAPI URL",
"Enter the URL to your OpenAPI/Swagger specification": "输入 OpenAPI/Swagger 规范的 URL",
"Upload OpenAPI File": "上传 OpenAPI 文件",
"Choose File": "选择文件",
"Supports JSON and YAML formats": "支持 JSON 与 YAML 格式",
"Parsing OpenAPI document...": "正在解析 OpenAPI 文档...",
"Back": "返回",
"Create Server": "创建服务器",
"Generate Server": "生成服务器",
"Sync Server": "同步服务器",
"Select Type": "选择类型",
"Configure": "配置",
"OR": "或",
"Use Website Scraper": "使用网站爬虫",
"Use OpenAPI Generator": "使用 OpenAPI 生成器",
"Data scraping in progress...": "数据爬取进行中...",
"Scraped {{current}} of {{total}} pages": "已爬取 {{current}} / {{total}} 个页面",
"Scraped {{count}} pages": "已爬取 {{count}} 个页面",
"Modifying the URL will trigger re-scraping of the website data.": "修改 URL 将会触发重新爬取网站数据。",
"You have modified the Website URL. This will trigger re-scraping of the website data. Are you sure you want to continue?": "你已修改网站 URL。这将触发重新爬取网站数据。确定要继续吗?",
"Scraping...": "正在爬取...",
"Server Type": "服务器类型",
"Edit Website URL": "编辑网站 URL",
"Modifying the website URL will trigger re-scraping of the website data. This process may take some time to complete.": "修改网站 URL 将触发重新爬取数据。该过程可能需要一段时间完成。",
"Please enter a valid URL": "请输入有效的 URL",
"Use the refresh button to modify the website URL": "使用刷新按钮来修改网站 URL",
"Cannot publish while scraping": "爬取未完成,无法发布",
"Publish": "发布",
"Unpublish": "取消发布",
"Published": "已发布",
"Unpublished": "未发布",
"Your brand": "你的品牌",
"Support JPG, PNG, GIF, SVG. Max size 5MB": "支持 JPG, PNG, GIF, SVG. 最大支持 5MB",
"Site title": "站点标题",
"Enter site title": "输入站点标题",
"Main title displayed on the home page": "首页显示的主标题",
"Site description": "站点描述",
"Enter site description": "输入站点描述",
"Secondary description displayed below the main title": "主标题下方显示的次标题",
"Title is required": "标题不能为空",
"Custom Domain": "自定义域名",
"Activate your domain": "激活您的域名",
"Set Custom Domain": "设置自定义域名",
"Configure platform language": "配置平台语言",
"Enter title": "输入标题",
"Enter link URL": "输入链接 URL",
"Configure FAQ": "配置常见问题",
"Enter question": "输入问题",
"Enter answer": "输入答案",
"Enable Stripe Payment": "启用 Stripe 支付",
"Toggle to enable or disable Stripe payment interface": "切换以启用或禁用 Stripe 支付接口",
"Enter Secret Key": "输入 Stripe 密钥",
"Enter Webhook Secret": "输入 Stripe Webhook 密钥",
"Email Login Settings": "邮箱登录设置",
"Open in new tab": "在新标签页打开",
"Analyze platform usage and revenue": "分析平台使用情况和收入",
"Change your password": "更改您的密码"
}
+94 -84
View File
@@ -81,7 +81,7 @@
"Free": "免费",
"Sign up now to get 100 free calls every month.": "注册即可获得每月 100 次免费调用",
"Generate and manage dynamic PowerPoints and Google Slides with your own custom branding and layouts.": "使用您自己的自定义品牌和布局生成和管理动态 PowerPoint 和 Google 幻灯片。",
"Try for free": "免费试用",
"Sign up to get the auth key": "注册以获取认证密钥",
"Lightning Fast Setup": "闪电般快速设置",
"Enterprise Security": "企业级安全",
"Global Scale": "全球规模",
@@ -103,7 +103,7 @@
"Build AI Agents": "使用令人难以置信的 MCP",
"With Incredible MCP": "构建 AI Agent",
"Instant Integration": "即时集成",
"Connect to global APIs and MCP services with just one config or SDK.": "通过一个配置或 SDK 连接到全球 API 和 MCP 服务。",
"Connect to global APIs and MCP servers with just one config or SDK.": "通过一个配置或 SDK 连接到全球 API 和 MCP 服务。",
"Zero Overhead": "零开销",
"Flexible pay-as-you-go pricing to fuel agent growth at every stage.": "灵活的按使用付费定价,为每个阶段的 Agent 增长提供动力。",
"Secure & Compliant": "安全 & 合规",
@@ -119,24 +119,24 @@
"Get Started": "立即开始",
"Demo": "演示",
"Start Deploying": "开始部署",
"We help these products connect to global services.": "我们帮助这些产品连接到全球服务。",
"We help these products connect to global servers.": "我们帮助这些产品连接到全球服务。",
"Become a partner": "成为合作伙伴",
"AI Design": "AI 设计",
"AI Agent": "AI Agent",
"AI Browser": "AI 浏览器",
"Home": "首页",
"Services": "服务",
"Servers": "服务",
"Interesting in \n becoming a partner?": "有兴趣\n 成为合作伙伴吗?",
"Other Partners": "其他合作伙伴",
"Services List": "服务列表",
"Submit services": "提交服务",
"Interesting in \n becoming a services supplier?": "有兴趣\n 成为服务供应商吗?",
"Apply to become a supplier and provide services to global users.": "申请成为供应商,为全球用户提供服务。",
"Servers List": "服务列表",
"Submit servers": "提交服务",
"Interesting in \n becoming a servers supplier?": "有兴趣\n 成为服务供应商吗?",
"Apply to become a supplier and provide servers to global users.": "申请成为供应商,为全球用户提供服务。",
"Become a supplier": "成为供应商",
"We only list some services": "我们只列出部分服务",
"Other Services": "其他服务",
"We only list some servers": "我们只列出部分服务",
"Other Servers": "其他服务",
"Submit a demo": "提交演示",
"Number of service categories": "服务分类数量",
"Number of server categories": "服务分类数量",
"Number of MCP Tools": "MCP 工具数量",
"Time for integration": "集成时间",
"Daily MCP request count": "每日 MCP 请求数量",
@@ -148,31 +148,31 @@
"It's hard to say goodbyes": "说再见总是很难",
"We're sorry to see you go. Your subscription has been cancelled.": "我们很遗憾看到您离开。您的订阅已被取消。",
"Playground": "演示环境",
"MCP Services Management": "MCP 服务管理",
"Service List": "服务列表",
"Add Service": "添加服务",
"MCP Servers Management": "MCP 服务管理",
"Server List": "服务列表",
"Add Server": "添加服务",
"OpenAPI Generator": "OpenAPI 生成器",
"Service Name": "服务名称",
"Service Description": "服务描述",
"Service Category": "服务分类",
"Service Status": "服务状态",
"Online": "上线",
"Offline": "下线",
"Server Name": "服务名称",
"Server Description": "服务描述",
"Server Category": "服务分类",
"Server Status": "服务状态",
"Published": "已发布",
"Unpublished": "未发布",
"Actions": "操作",
"Edit": "编辑",
"Delete": "删除",
"Toggle Status": "切换状态",
"Create New Service": "创建新服务",
"Edit Service": "编辑服务",
"Create New Server": "创建新服务",
"Edit Server": "编辑服务",
"Generate from OpenAPI": "从 OpenAPI 生成",
"Update from OpenAPI": "从 OpenAPI 更新",
"Sync from OpenAPI": "从 OpenAPI 同步",
"Sync service configuration from OpenAPI/Swagger documentation": "从 OpenAPI/Swagger 文档同步服务配置",
"Sync Service": "同步服务",
"Sync server configuration from OpenAPI/Swagger documentation": "从 OpenAPI/Swagger 文档同步服务配置",
"Sync Server": "同步服务",
"OpenAPI URL": "OpenAPI 地址",
"Upload OpenAPI File": "上传 OpenAPI 文件",
"Generate Service": "生成服务",
"Service Configuration": "服务配置",
"Generate Server": "生成服务",
"Server Configuration": "服务配置",
"API Endpoint": "API 端点",
"Authentication": "身份验证",
"API Key": "API 密钥",
@@ -182,7 +182,7 @@
"Markdown Documentation": "Markdown 文档",
"Save": "保存",
"Cancel": "取消",
"Service Documentation": "服务文档",
"Server Documentation": "服务文档",
"Manage Tools": "管理工具",
"Tools Count": "工具数量",
"Tool Name": "工具名称",
@@ -191,15 +191,14 @@
"Edit Tool": "编辑工具",
"Delete Tool": "删除工具",
"Save Changes": "保存更改",
"No tools configured for this service": "此服务未配置任何工具",
"Add tools to extend service functionality": "添加工具以扩展服务功能",
"Configure and manage tools for this service": "配置和管理此服务的工具",
"No tools configured for this server": "此服务未配置任何工具",
"Add tools to extend server functionality": "添加工具以扩展服务功能",
"Configure and manage tools for this server": "配置和管理此服务的工具",
"Add New Tool": "添加新工具",
"Enter tool name": "输入工具名称",
"Enter tool description": "输入工具描述",
"Tool name": "工具名称",
"Tool description": "工具描述",
"Take Offline": "下线",
"Platform Domain": "平台域名",
"Enter platform domain (e.g., example.com)": "输入平台域名(例如:example.com)",
"The domain name of your platform": "您平台的域名",
@@ -218,41 +217,36 @@
"Question": "问题",
"Answer": "答案",
"No FAQ items available.": "暂无FAQ项目。",
"Enter question": "输入问题",
"Enter answer": "输入答案",
"Insert below": "在下方插入",
"Bring Online": "上线",
"Short Description": "简短描述",
"Long Description": "详细描述",
"Brief description of the service": "服务的简短描述",
"Detailed description of the service": "服务的详细描述",
"Brief description of the server": "服务的简短描述",
"Detailed description of the server": "服务的详细描述",
"Basic Information": "基本信息",
"API Configuration": "API配置",
"Authentication Type": "认证类型",
"Update Service": "更新服务",
"Create Service": "创建服务",
"Update Server": "更新服务",
"Create Server": "创建服务",
"Confirm Delete": "确认删除",
"Are you sure you want to delete this service?": "您确定要删除此服务吗?",
"Are you sure you want to delete this server?": "您确定要删除此服务吗?",
"This action cannot be undone.": "此操作无法撤销。",
"Manage your MCP services, configure APIs, and monitor service status": "管理您的MCP服务,配置API,并监控服务状态",
"Search services...": "搜索服务...",
"Manage your MCP servers, configure APIs, and monitor server status": "管理您的MCP服务,配置API,并监控服务状态",
"Search MCP servers": "搜索服务...",
"Filter by category": "按分类筛选",
"Filter by status": "按状态筛选",
"All Categories": "所有分类",
"All Status": "所有状态",
"Created": "创建时间",
"Last Updated": "最后更新",
"Total Services": "总服务数",
"Online Services": "在线服务",
"Offline Services": "离线服务",
"Service created successfully": "服务创建成功",
"Service updated successfully": "服务更新成功",
"Service deleted successfully": "服务删除成功",
"Service status updated successfully": "服务状态更新成功",
"Failed to create service": "创建服务失败",
"Failed to update service": "更新服务失败",
"Failed to delete service": "删除服务失败",
"Failed to update service status": "更新服务状态失败",
"Total Servers": "总服务数",
"Server created successfully": "服务创建成功",
"Server updated successfully": "服务更新成功",
"Server deleted successfully": "服务删除成功",
"Server status updated successfully": "服务状态更新成功",
"Failed to create server": "创建服务失败",
"Failed to update server": "更新服务失败",
"Failed to delete server": "删除服务失败",
"Failed to update server status": "更新服务状态失败",
"Invalid OpenAPI URL": "无效的 OpenAPI 地址",
"Failed to parse OpenAPI document": "解析 OpenAPI 文档失败",
"OpenAPI document parsed successfully": "OpenAPI 文档解析成功",
@@ -262,8 +256,8 @@
"Please select a file": "请选择文件",
"File uploaded successfully": "文件上传成功",
"Failed to upload file": "文件上传失败",
"Service name is required": "服务名称为必填项",
"Service description is required": "服务描述为必填项",
"Server name is required": "服务名称为必填项",
"Server description is required": "服务描述为必填项",
"API endpoint is required": "API 端点为必填项",
"Documentation is required": "文档为必填项",
"Connect Your AI Agent to the Real World": "连接您的 AI Agent 到真实世界",
@@ -298,13 +292,13 @@
"Login Success": "登录成功",
"Login Error": "登录错误",
"Back Home": "返回首页",
"MCP Services": "MCP 服务",
"MCP Servers": "MCP 服务",
"User Management": "用户管理",
"Revenue Management": "收入管理",
"Payment Channels": "支付渠道",
"System Settings": "系统设置",
"Overview and analytics": "概览和分析",
"Manage MCP services and API tools": "管理MCP服务及API工具",
"Manage MCP servers and API tools": "管理MCP服务及API工具",
"Manage registered users": "管理注册用户",
"View user recharge history": "查看用户充值历史",
"Configure payment channels": "配置支付渠道",
@@ -358,7 +352,7 @@
"No": "否",
"User Statistics": "用户统计",
"API Calls": "API调用次数",
"Services Used": "使用的服务",
"Servers Used": "使用的服务",
"Total Spent": "总消费",
"Wallet Balance": "钱包余额",
"Confirm Ban User": "确认封禁用户",
@@ -387,13 +381,12 @@
"Enter your password": "请输入密码",
"Confirm your password": "请确认密码",
"Passwords do not match": "密码不匹配",
"Password must be at least 8 characters": "密码至少需要8个字符",
"Registration successful": "注册成功",
"Registration failed": "注册失败",
"Email already exists": "邮箱已存在",
"Invalid email format": "邮箱格式无效",
"Sign up with Google": "使用Google注册",
"Terms of Service": "服务条款",
"Terms of Server": "服务条款",
"Privacy Policy": "隐私政策",
"By signing up, you agree to our": "注册即表示您同意我们的",
"and": "和",
@@ -437,9 +430,9 @@
"Enable Google Login": "启用Google登录",
"Administrator Account": "管理员账户",
"Platform Information": "平台信息",
"Delete Service": "删除服务",
"Delete Server": "删除服务",
"Parsing OpenAPI document...": "正在解析OpenAPI文档...",
"Generated Service Configuration": "生成的服务配置",
"Generated Server Configuration": "生成的服务配置",
"None": "无",
"Tags": "标签",
"Paid": "付费",
@@ -477,7 +470,7 @@
"Enter your verification code": "输入您的验证码",
"Resend": "重新发送",
"Verify Email Error": "邮箱验证错误",
"Generate MCP service configuration from OpenAPI/Swagger documentation": "从OpenAPI/Swagger文档生成MCP服务配置",
"Generate MCP server configuration from OpenAPI/Swagger documentation": "从OpenAPI/Swagger文档生成MCP服务配置",
"From URL": "从URL",
"Upload File": "上传文件",
"Choose File": "选择文件",
@@ -486,7 +479,12 @@
"Invalid email address": "无效的邮箱地址",
"Back to Home": "返回首页",
"Enter the URL to your OpenAPI/Swagger specification": "输入您的OpenAPI/Swagger规范的URL",
"Enter service name": "输入服务名称",
"Enter server name": "输入服务名称",
"Server ID": "服务器ID",
"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令牌",
@@ -511,7 +509,7 @@
"API Key Header Name": "API密钥头部名称",
"Secret Key format is incorrect, should start with sk_": "密钥格式不正确,应以sk_开头",
"Webhook Secret format is incorrect, should start with whsec_": "Webhook密钥格式不正确,应以whsec_开头",
"Password must be at least 8 characters long": "密码至少需要8个字符",
"Password must be at least 6 characters long": "密码至少需要6个字符",
"OAuth 2.0 Client Secret (optional, for server-side verification)": "OAuth 2.0 客户端密钥(可选,用于服务端验证)",
"Authorized redirect URI configured in Google Cloud Console": "在Google Cloud Console中配置的授权重定向URI",
"Webhook signing secret for verifying Stripe events": "用于验证Stripe事件的Webhook签名密钥",
@@ -553,7 +551,7 @@
"Select currency": "选择货币",
"Default currency for the platform": "平台默认货币",
"call": "调用",
"No services found": "未找到服务",
"No servers found": "未找到服务",
"free/day": "免费/天",
"Account (Email)": "账户(邮箱)",
"Recharge Amount": "充值金额",
@@ -571,7 +569,7 @@
"No tools added yet. Add your first tool using the input above.": "尚未添加工具。使用上面的输入添加您的第一个工具。",
"Insert tool below": "在下方插入工具",
"Remove tool": "移除工具",
"Service Detail": "服务详情",
"Server Detail": "服务详情",
"Billing Mode": "计费模式",
"Enable free quota": "启用免费配额",
"Configure Stripe payment interface": "配置Stripe支付接口",
@@ -600,9 +598,9 @@
"Platform total fund pool": "平台总资金池",
"Today's API Calls": "今日调用量",
"API call count": "API 调用次数",
"Total MCP Services": "MCP服务总数",
"Deployed services": "已部署的服务",
"This is your AI service management center. You can quickly view platform core data on the left and manage and configure your MCP services, users, payment channels, etc.": "这里是您的AI服务管理中心,您可以在左侧快速查看平台核心数据,在此管理和配置您的 MCP 服务、用户、支付渠道等。",
"Total MCP Servers": "MCP服务总数",
"Deployed servers": "已部署的服务",
"This is your AI server management center. You can quickly view platform core data on the left and manage and configure your MCP servers, users, payment channels, etc.": "这里是您的AI服务管理中心,您可以在左侧快速查看平台核心数据,在此管理和配置您的 MCP 服务、用户、支付渠道等。",
"Log In": "登录",
"Register Date": "注册日期",
"Dashboard": "仪表盘",
@@ -648,17 +646,16 @@
"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}}",
"Log Out": "退出登录",
"Enter your username": "输入您的用户名",
"Login": "登录",
"Admin Portal": "管理员门户",
"Log in to admin console": "登录管理员控制台",
"Welcome to XPack.AI Open Source": "欢迎来到XPack.AI开源项目",
"Are you sure you want to delete this \"{{name}}\" service?": "您确定要删除这个\"{{name}}\"服务吗?",
"Service status toggled successfully": "服务状态切换成功",
"Failed to toggle service status": "切换服务状态失败",
"Log in to your admin account to continue": "登录管理员控制台",
"Welcome to XPack.AI": "欢迎来到XPack.AI",
"Are you sure you want to delete this \"{{name}}\" server?": "您确定要删除这个\"{{name}}\"服务吗?",
"Server status toggled successfully": "服务状态切换成功",
"Failed to toggle server status": "切换服务状态失败",
"Stripe configuration saved successfully": "Stripe 配置保存成功",
"Failed to save Stripe configuration": "保存 Stripe 配置失败",
"Failed to save {{channelName}} config": "保存{{channelName}}配置失败",
@@ -693,8 +690,6 @@
"Stripe config saved successfully": "Stripe 配置保存成功",
"Alipay config saved successfully": "支付宝配置保存成功",
"WeChat config saved successfully": "微信配置保存成功",
"Login successful": "登录成功",
"Logged out successfully": "退出登录成功",
"Configure email settings": "配置邮箱设置",
"Email Configuration": "邮箱配置",
"Configure SMTP settings for email notifications": "配置SMTP设置用于邮件通知",
@@ -768,10 +763,10 @@
"Traditional email and password authentication": "传统邮箱和密码认证",
"Email/Verification Code": "邮箱/验证码",
"Passwordless login with email verification code": "邮箱验证码登录",
"Email service is not configured. Please configure email settings first.": "邮箱服务未配置。请先配置邮箱设置。",
"SMTP is not configured. Please configure email settings first.": "SMTP未配置。请先配置邮箱设置。",
"Go to Settings": "前往设置",
"AI Tools Marketplace": "AI工具市场",
"A marketplace for AI tools and services. Discover and integrate powerful AI solutions for your projects.": "一个AI工具和服务的市场。发现并整合强大的AI解决方案,为您的项目提供支持。",
"A marketplace for AI tools and servers. Discover and integrate powerful AI solutions for your projects.": "一个AI工具和服务的市场。发现并整合强大的AI解决方案,为您的项目提供支持。",
"Configuration": "配置",
"Featured Products": "推荐产品",
"Search": "搜索",
@@ -780,7 +775,7 @@
"Re-enter new password": "重新输入新密码",
"Confirm new password": "确认新密码",
"New password and confirm password do not match": "新密码和确认密码不匹配",
"New password must be at least 8 characters long": "新密码至少需要8个字符",
"New password must be at least 6 characters long": "新密码至少需要6个字符",
"New password and confirm password must be the same": "新密码和确认密码必须相同",
"New Password": "新密码",
"Confirm New Password": "确认新密码",
@@ -801,7 +796,6 @@
"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<script>\n // Google Analytics\n gtag('config', 'GA_MEASUREMENT_ID');\n</script>\n\n<style>\n .custom-style {\n color: #333;\n }\n</style>": "在此输入您的自定义HTML、CSS或JavaScript代码...\n\n示例:\n<script>\n // Google Analytics\n gtag('config', 'GA_MEASUREMENT_ID');\n</script>\n\n<style>\n .custom-style {\n color: #333;\n }\n</style>",
"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将在保存并启用后渲染。",
@@ -840,8 +834,6 @@
"Target": "目标",
"Add Navigation Item": "添加导航项",
"Remove Navigation Item": "删除导航项",
"Enter title": "输入标题",
"Enter link URL": "输入链接地址",
"Same window": "当前窗口",
"New window": "新窗口",
"Custom HTML injection": "自定义HTML注入",
@@ -873,5 +865,23 @@
"Price per million output tokens": "每百万输出Token价格",
"Input": "输入",
"Output": "输出",
"1M tokens": "1M tokens"
"1M tokens": "1M tokens",
"Total Spending": "总支出",
"Remote": "远程",
"Platform Logo": "平台Logo",
"Support JPG, PNG, GIF. Max size 5MB": "支持JPG、PNG、GIF格式,最大大小5MB",
"(30 days)": "(30天)",
"Sign in": "登录",
"or create your account": "或创建您的账户",
"No account? Just continue—we’ll set you up.": "没有账户?继续即可,我们会为您设置。",
"Password must be at least 6 characters": "密码必须至少6个字符",
"Email is required": "邮箱为必填项",
"No servers available": "没有可用服务",
"(Deleted)": "(已删除)",
"Transport Type": "传输方式",
"Server ID must be less than 256 characters": "Server ID 必须少于256个字符",
"Server Name must be less than 256 characters": "Server Name 必须少于256个字符",
"API Endpoint must be a valid HTTP/HTTPS URL": "API Endpoint 必须是一个有效的HTTP/HTTPS URL",
"Server ID is required": "Server ID 为必填项",
"Short description is required": "简短描述为必填项"
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 MiB

+75
View File
@@ -0,0 +1,75 @@
import { ApiResponse } from "@/shared/types";
import { fetchAdminAPI } from "@/rpc/admin-api";
/**
* Admin analytics API data structures based on OpenAPI spec
* GET /api/admin/stats/analytics
*/
export interface DayCountStringItem {
stats_day: string; // yyyy-mm-dd
count: string;
}
export interface DayCountNumberItem {
stats_day: string; // yyyy-mm-dd
count: number;
}
// 用户注册数据
export interface UserRegisterData {
total: number; // user register total count
today?: number; // today user register count
days: DayCountStringItem[]; // daily user register count
}
// user pay data
export interface UserPayData {
total: number; // user pay total amount
today?: number; // today user pay amount
days: DayCountNumberItem[]; // daily user pay amount
}
// MCP 调用数据
export interface MCPCallData {
total: number; // mcp call total count
today?: number; // today mcp call count
days: DayCountNumberItem[]; // daily mcp call count
}
// Top server items
export interface TopServiceItem {
id: string; // server id
name: string; // server name
short_description: string; // short description
call_count: number; // call count
is_deleted: boolean; //It means the server was deleted.
}
// admin analytics data
export interface AdminAnalyticsData {
user_register: UserRegisterData;
user_pay: UserPayData;
mcp_call: MCPCallData;
top_services: TopServiceItem[];
}
// admin analytics response body
export interface AdminAnalyticsResponse
extends ApiResponse<AdminAnalyticsData> {
success: boolean;
code: string;
error_message: string;
data: AdminAnalyticsData;
}
/**
* Get admin analytics data
* Headers: { Authorization: string }
*/
export async function getAdminAnalytics(): Promise<AdminAnalyticsResponse> {
return fetchAdminAPI<AdminAnalyticsData>("/api/admin/stats/analytics", {
method: "GET",
}) as unknown as AdminAnalyticsResponse;
}
+30
View File
@@ -0,0 +1,30 @@
import { fetchAdminAPI } from "@/rpc/admin-api";
import { ApiResponse } from "@/shared/types";
import toast from "react-hot-toast";
export enum OnboardingTaskKey {
PLATFORM_SETUP = "configure-platform-settings",
MCP_SERVICES = "add-mcp-services",
REVENUE_MANAGEMENT = "configure-platment-billings",
SHARE_PLATFORM = "share-your-platform",
}
export enum TaskStatusEnum {
COMPLETED = 1,
NOT_STARTED = 0,
}
export type TaskItem = {
task_id: OnboardingTaskKey;
task_status: TaskStatusEnum;
};
export async function updateAdminOnboardingTasks(
task: TaskItem
): Promise<boolean> {
const res = (await fetchAdminAPI<void>("/api/onboarding/task_update_status", {
method: "PUT",
body: task as unknown as BodyInit,
})) as unknown as ApiResponse<void>;
// if (!res.success) {
// toast.error(res.error_message || "Failed to update onboarding task status");
// }
return res.success;
}
+2 -2
View File
@@ -4,8 +4,8 @@ import { createBaseMetadata, getDynamicTitle } from "@/shared/utils/metadata";
import { AboutThemeSelector } from "@/components/theme/AboutThemeSelector";
export async function generateMetadata(): Promise<Metadata> {
const title = await getDynamicTitle("About");
return createBaseMetadata(title);
const platformConfig = await getDynamicTitle("About");
return createBaseMetadata(platformConfig);
}
export default async function AboutPage() {
+17 -10
View File
@@ -1,13 +1,20 @@
'use server';
"use server";
import { revalidatePath, revalidateTag } from 'next/cache';
import { revalidatePath, revalidateTag } from "next/cache";
import { headers } from "next/headers";
export async function revalidatePlatformConfig() {
// 重新验证根路径和所有子路径
revalidatePath('/', 'layout');
// 如果使用了标签缓存,也可以重新验证特定标签
revalidateTag('platform-config');
console.log('Platform config cache revalidated');
}
// Get current host for host-specific cache invalidation
const headersList = await headers();
const host = headersList.get("host") || "default";
// Revalidate root path and all sub-paths
revalidatePath("/", "layout");
// Revalidate host-specific cache tag
revalidateTag(`platform-config-${host}`);
console.info(
`Platform config cache revalidated for host: platform-config-${host}`
);
}
@@ -6,7 +6,6 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
import { useTranslation } from "@/shared/lib/useTranslation";
import { useAdminLogin } from "@/hooks/useAdminLogin";
import toast from "react-hot-toast";
const adminLoginSchema = z.object({
username: z.string().min(1, "Username is required"),
@@ -62,4 +61,4 @@ export const AdminLoginForm = () => {
</Button>
</form>
);
};
};
+13
View File
@@ -0,0 +1,13 @@
import React from "react";
import type { Metadata } from "next";
import { createBaseMetadata, getDynamicTitle } from "@/shared/utils/metadata";
import ConsoleMain from "@/components/console/Main";
export async function generateMetadata(): Promise<Metadata> {
const platformConfig = await getDynamicTitle("Console");
return createBaseMetadata(platformConfig);
}
export default function AdminConsolePage() {
return <ConsoleMain />;
}
+5 -3
View File
@@ -15,8 +15,10 @@ const AdminLoginHeader = () => {
return (
<div className="flex flex-col items-center pb-6">
<DynamicLogo alt="Platform Logo" className="h-[40px]" />
<p className="text-xl font-medium mt-4">{t("Admin Portal")}</p>
<p className="text-sm text-default-500">{t("Log in to admin console")}</p>
<p className="text-xl font-medium mt-4">{t("Welcome")}</p>
<p className="text-sm text-default-500">
{t("Log in to your admin account to continue")}
</p>
</div>
);
};
@@ -28,7 +30,7 @@ const AdminLoginPageContent = () => {
const handleCheckLogin = async () => {
const res = await getAdminUser();
if (res.success) {
router.push("/console");
router.push("/admin/console");
}
};
+5 -7
View File
@@ -1,15 +1,13 @@
import React from "react";
import type { Metadata } from "next";
import { createBaseMetadata, getDynamicTitle } from "@/shared/utils/metadata";
import ConsoleMain from "@/components/console/Main";
import DashboardMain from "@/components/dashboard/Main";
export async function generateMetadata(): Promise<Metadata> {
const title = await getDynamicTitle("Console");
return createBaseMetadata(title);
const platformConfig = await getDynamicTitle("Dashboard");
return createBaseMetadata(platformConfig);
}
export default function HomePage() {
return (
<ConsoleMain />
);
export default function ConsolePage() {
return <DashboardMain />;
}
-15
View File
@@ -1,15 +0,0 @@
import React from "react";
import type { Metadata } from "next";
import { createBaseMetadata, getDynamicTitle } from "@/shared/utils/metadata";
import DashboardMain from "@/components/dashboard/Main";
export async function generateMetadata(): Promise<Metadata> {
const title = await getDynamicTitle("Dashboard");
return createBaseMetadata(title);
}
export default function HomePage() {
return (
<DashboardMain />
);
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 11 KiB

+12 -1
View File
@@ -1,9 +1,13 @@
input::placeholder,
textarea::placeholder {
--nextui-foreground-500: 240 5.03% 64.9%;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
/* Import theme styles */
@import '../styles/themes.css';
@import "../styles/themes.css";
html,
body {
@@ -84,3 +88,10 @@ body {
background-size: 16px 16px; /* 每个格子的尺寸 */
background-repeat: repeat;
}
.wmde-markdown ul,
.wmde-markdown ol {
list-style-type: revert;
}
.wmde-markdown {
background-color: inherit !important;
}
+16 -11
View File
@@ -2,7 +2,11 @@ import type { Metadata } from "next";
import { Red_Hat_Display } from "next/font/google";
import ClientRootProviders from "@/shared/components/ClientRootProviders";
import "./globals.css";
import { getCachedPlatformConfig, getDynamicTitle, createBaseMetadata } from "@/shared/utils/metadata";
import {
getCachedPlatformConfig,
getDynamicTitle,
createBaseMetadata,
} from "@/shared/utils/metadata";
const redHatDisplay = Red_Hat_Display({
subsets: ["latin"],
@@ -11,8 +15,8 @@ const redHatDisplay = Red_Hat_Display({
});
export async function generateMetadata(): Promise<Metadata> {
const title = await getDynamicTitle();
return createBaseMetadata(title);
const platformConfig = await getDynamicTitle();
return createBaseMetadata(platformConfig);
}
export default async function RootLayout({
@@ -23,7 +27,7 @@ export default async function RootLayout({
const platformConfig = await getCachedPlatformConfig();
return (
<html lang="en" suppressHydrationWarning>
<html lang="en" suppressHydrationWarning data-color-mode="light">
<head>
<script
dangerouslySetInnerHTML={{
@@ -32,15 +36,16 @@ export default async function RootLayout({
`,
}}
/>
{platformConfig?.embeded_html?.is_enabled && platformConfig?.embeded_html?.html && (
<div
dangerouslySetInnerHTML={{
__html: platformConfig.embeded_html.html,
}}
/>
)}
</head>
<body className={redHatDisplay.className} suppressHydrationWarning>
{platformConfig?.embeded_html?.is_enabled &&
platformConfig?.embeded_html?.html && (
<div
dangerouslySetInnerHTML={{
__html: platformConfig.embeded_html.html,
}}
/>
)}
<ClientRootProviders initConfig={platformConfig}>
{children}
</ClientRootProviders>
+12 -14
View File
@@ -2,7 +2,7 @@
import React, { useEffect, Suspense } from "react";
import { Spinner, Button } from "@nextui-org/react";
import { useLogin } from "@/hooks/useLogin";
import { useLogin } from "@/shared/hooks/useLogin";
import { useRouter, useSearchParams } from "next/navigation";
import { Icon } from "@iconify/react/dist/iconify.js";
import { useTranslation } from "@/shared/lib/useTranslation";
@@ -22,7 +22,7 @@ function LoginSuccessContent() {
const backHome = () => {
const dynamicParams = new URLSearchParams(searchParams?.get("state") || "");
router.push(`/login?${dynamicParams.toString()}`);
router.push(`/?${dynamicParams.toString()}`);
};
return (
@@ -31,22 +31,14 @@ function LoginSuccessContent() {
<Spinner size="lg" color="default" />
) : status === "success" ? (
<>
<Icon
fontSize={70}
className="text-success"
icon="mi:circle-check"
/>
<Icon fontSize={70} className="text-success" icon="mi:circle-check" />
<div className="text-xl font-bold text-success">
{t("Login Success")}
</div>
</>
) : (
<>
<Icon
fontSize={70}
className="text-danger"
icon="mi:circle-error"
/>
<Icon fontSize={70} className="text-danger" icon="mi:circle-error" />
<div className="text-xl font-bold text-danger">
{t("Login Error")}
</div>
@@ -59,8 +51,14 @@ function LoginSuccessContent() {
export default function LoginSuccessPage() {
return (
<Suspense fallback={<div className="flex justify-center mt-40"><Spinner size="lg" color="default" /></div>}>
<Suspense
fallback={
<div className="flex justify-center mt-40">
<Spinner size="lg" color="default" />
</div>
}
>
<LoginSuccessContent />
</Suspense>
);
}
}
+4 -4
View File
@@ -6,8 +6,8 @@ import type { ServiceData } from "@/shared/types/marketplace";
import { ThemeSelector } from "@/components/theme/ThemeSelector";
export async function generateMetadata(): Promise<Metadata> {
const title = await getDynamicTitle();
return createBaseMetadata(title);
const platformConfig = await getDynamicTitle();
return createBaseMetadata(platformConfig);
}
export default async function HomePage({
@@ -36,8 +36,8 @@ export default async function HomePage({
services = response?.data?.services || [];
total = response?.page?.total || 0;
} catch (err) {
console.error("Error fetching services:", err);
error = "Failed to load services";
console.error("Error fetching servers:", err);
error = "Failed to load servers";
}
return (
@@ -5,8 +5,6 @@ import type { Metadata } from "next";
import { createBaseMetadata, getDynamicTitle } from "@/shared/utils/metadata";
import { fetchServiceById } from "@/services/marketplaceService";
import type { ServiceData } from "@/shared/types/marketplace";
import { Footer } from "@/shared/components/Footer";
import { Navigation } from "@/shared/components/Navigation";
interface ProductPageProps {
params: Promise<{ id: string }>;
@@ -32,20 +30,15 @@ export async function generateMetadata({
// use cached function to get data to generate metadata
const product = await getProductById(id);
const productName = product?.name || "Unknown";
if (product) {
const title = await getDynamicTitle(product.name);
return {
...createBaseMetadata(title),
description:
product.short_description ||
`Discover ${product.name} and its powerful tools`,
};
}
// default metadata if product not found
const defaultTitle = await getDynamicTitle("Marketplace");
return createBaseMetadata(defaultTitle);
const platformConfig = await getDynamicTitle(productName);
return {
...createBaseMetadata(platformConfig),
description:
product?.short_description ||
`Discover ${productName} and its powerful tools`,
};
}
export default async function ProductPage({ params }: ProductPageProps) {
@@ -6,8 +6,21 @@ import { Icon } from "@iconify/react/dist/iconify.js";
interface LoginButtonProps {
title: string;
icon?: string;
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger";
variant?: "solid" | "bordered" | "light" | "flat" | "faded" | "shadow" | "ghost";
color?:
| "default"
| "primary"
| "secondary"
| "success"
| "warning"
| "danger";
variant?:
| "solid"
| "bordered"
| "light"
| "flat"
| "faded"
| "shadow"
| "ghost";
onClick?: () => void;
}
@@ -29,4 +42,4 @@ export const LoginButton = ({
{title}
</Button>
);
};
};
@@ -6,12 +6,13 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
import { StepState } from "../page";
import { useTranslation } from "@/shared/lib/useTranslation";
import i18n from "@/shared/lib/i18n";
const emailSchema = z.object({
email: z
.string()
.email({ message: "Invalid email address" })
.min(1, { message: "Email is required" }),
.email({ message: i18n.t("Invalid email address") })
.min(1, { message: i18n.t("Email is required") }),
});
type EmailFormData = z.infer<typeof emailSchema>;
@@ -30,7 +31,7 @@ export const LoginEmailFrom = ({ setEmail, setStep }: LoginEmailFromProps) => {
formState: { errors, isSubmitting, isValid },
} = useForm<EmailFormData>({
resolver: zodResolver(emailSchema),
mode: "all",
mode: "onBlur",
});
const onSubmit = async (data: EmailFormData) => {
@@ -61,7 +62,9 @@ export const LoginEmailFrom = ({ setEmail, setStep }: LoginEmailFromProps) => {
type="submit"
color="primary"
isLoading={isSubmitting}
className="w-full"
size="lg"
className="w-full font-semibold bg-default-900"
isDisabled={!isValid}
>
{t("Continue")}
</Button>
@@ -7,15 +7,16 @@ import { z } from "zod";
import { useState } from "react";
import { Eye, EyeOff } from "lucide-react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { useLogin } from "@/hooks/useLogin";
import { useLogin } from "@/shared/hooks/useLogin";
import { md5Encrypt } from "@/shared/utils/crypto";
import i18n from "@/shared/lib/i18n";
const emailPasswordSchema = z.object({
email: z
.string()
.email({ message: "Invalid email address" })
.min(1, { message: "Email is required" }),
password: z.string().min(6, "Password must be at least 6 characters"),
.email({ message: i18n.t("Invalid email address") })
.min(1, { message: i18n.t("Email is required") }),
password: z.string().min(6, i18n.t("Password must be at least 6 characters")),
});
type EmailPasswordFormData = z.infer<typeof emailPasswordSchema>;
@@ -37,7 +38,7 @@ export const LoginEmailPasswordForm = ({
formState: { errors, isSubmitting, isValid },
} = useForm<EmailPasswordFormData>({
resolver: zodResolver(emailPasswordSchema),
mode: "all",
mode: "onBlur",
});
const onSubmit = async (data: EmailPasswordFormData) => {
@@ -105,9 +106,11 @@ export const LoginEmailPasswordForm = ({
type="submit"
color="primary"
isLoading={isSubmitting}
className="w-full"
size="lg"
className="w-full font-semibold bg-default-900"
isDisabled={!isValid}
>
{t("Sign In")}
{t("Continue")}
</Button>
</form>
);
+88 -51
View File
@@ -1,86 +1,123 @@
"use client";
import { Divider } from "@nextui-org/react";
import { Suspense, useState } from "react";
import { useRef, useState } from "react";
import { LoginButton } from "./LoginButton";
import { useLogin } from "@/hooks/useLogin";
import { useLogin } from "@/shared/hooks/useLogin";
import { EmailVerificationForm } from "./VerifyEmail";
import { LoginEmailFrom } from "./LoginEmailFrom";
import { LoginEmailPasswordForm } from "./LoginEmailPasswordForm";
import { useTranslation } from "@/shared/lib/useTranslation";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
import { EmailMode } from "@/shared/types/system";
import BgCollagePattern from "@/shared/components/sign/BgCollagePattern";
import { DynamicLogo } from "@/shared/components/DynamicLogo";
export type StepState = "init" | "emailForm" | "verifyEmail";
const SignInComponent = () => {
export default function SignInComponent() {
const { t } = useTranslation();
const [email, setEmail] = useState("");
const [step, setStep] = useState<StepState>("init");
const { googleLoginOrSignUp } = useLogin();
const { loginConfig } = usePlatformConfig();
const containerRef = useRef<HTMLDivElement>(null);
// 检查是否启用了 Google 登录
const isGoogleLoginEnabled =
loginConfig?.google?.is_enabled && loginConfig?.google?.client_id;
// 检查是否启用了邮箱登录
const isEmailEnabled = loginConfig?.email?.is_enabled ?? true;
// 获取邮箱登录模式
const emailMode = loginConfig?.email?.mode ?? EmailMode.PASSWORD;
return (
<>
<div className="mt-2 flex w-full max-w-sm flex-col gap-8 rounded-large bg-content1 px-8 py-6 shadow-small backdrop-blur-sm">
{step === "verifyEmail" && <EmailVerificationForm email={email} />}
{step === "init" && isGoogleLoginEnabled && (
<LoginButton
title={t("Log in with Google")}
color="primary"
variant="solid"
icon="flat-color-icons:google"
onClick={googleLoginOrSignUp}
/>
)}
{/* OR - 只有在启用 Google 登录且有其他登录方式时才显示分隔符 */}
{isGoogleLoginEnabled && isEmailEnabled && (
<div className="flex items-center gap-4">
<Divider className="flex-1" />
<p className="shrink-0 text-tiny text-default-500">{t("OR")}</p>
<Divider className="flex-1" />
</div>
)}
{/* Login With Email */}
{step === "init" && isEmailEnabled && (
<div className="space-y-4">
{/* 邮箱/密码登录表单 */}
{emailMode === EmailMode.PASSWORD && (
<LoginEmailPasswordForm />
)}
<div
className="relative w-full min-h-screen flex items-center justify-center"
ref={containerRef}
>
{/* Background collage pattern */}
<BgCollagePattern
containerRef={containerRef}
options={{
radius: 30,
background: "#f5f5f5",
particleCount: 20000,
color: "#006fee",
colorPole: "#001aee",
}}
/>
<div className="relative z-10 w-full max-w-md">
<div className="bg-white rounded-2xl shadow-2xl p-8 backdrop-blur-lg bg-opacity-95">
<div className="mb-10">
<div className="flex gap-2 mb-4">
<DynamicLogo className="h-[32px]" hideText />
</div>
<h1 className="text-3xl font-semibold text-default-900">
{t("Sign in")} <br />
<span>{t("or create your account")}</span>
</h1>
</div>
{/* 邮箱/验证码登录表单 */}
{emailMode === EmailMode.CAPTCHA && (
<LoginEmailFrom setEmail={setEmail} setStep={setStep} />
)}
<div className="space-y-6">
{step === "verifyEmail" && (
<EmailVerificationForm email={email} />
)}
{step === "init" && isGoogleLoginEnabled && (
<LoginButton
title={t("Log in with Google")}
color="primary"
variant="solid"
icon="flat-color-icons:google"
onClick={googleLoginOrSignUp}
/>
)}
{/* OR - 只有在启用 Google 登录且有其他登录方式时才显示分隔符 */}
{isGoogleLoginEnabled && isEmailEnabled && (
<div className="flex items-center gap-4">
<Divider className="flex-1" />
<p className="shrink-0 text-tiny text-default-500">
{t("OR")}
</p>
<Divider className="flex-1" />
</div>
)}
{/* Login With Email */}
{step === "init" && isEmailEnabled && (
<div className="space-y-4">
{/* 邮箱/密码登录表单 */}
{emailMode === EmailMode.PASSWORD && (
<LoginEmailPasswordForm />
)}
{/* 邮箱/验证码登录表单 */}
{emailMode === EmailMode.CAPTCHA && (
<LoginEmailFrom setEmail={setEmail} setStep={setStep} />
)}
</div>
)}
{step !== "init" && isGoogleLoginEnabled && (
<LoginButton
title={t("Log in with Google")}
icon="flat-color-icons:google"
onClick={googleLoginOrSignUp}
/>
)}
{/* 底部提示文本 */}
{step === "init" && (
<div className="mt-6 text-center">
<p className="text-sm text-gray-600">
{t("No account? Just continue—we’ll set you up.")}
</p>
</div>
)}
</div>
</div>
)}
{step !== "init" && isGoogleLoginEnabled && (
<LoginButton
title={t("Log in with Google")}
icon="flat-color-icons:google"
onClick={googleLoginOrSignUp}
/>
)}
</div>
</div>
</>
);
};
export default function SignInWrapper() {
return (
<Suspense fallback={<></>}>
<SignInComponent />
</Suspense>
);
}
@@ -5,11 +5,11 @@ import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
import { useEffect, useRef, useState } from "react";
import { useLogin } from "@/hooks/useLogin";
import { useLogin } from "@/shared/hooks/useLogin";
import { useTranslation } from "@/shared/lib/useTranslation";
import toast from "react-hot-toast";
import { fetchAPI } from "@/shared/rpc/common-function";
import { getEmail } from "@/utils/getEmail";
import { getEmail } from "@/shared/utils/getEmail";
const schema = z.object({
captcha: z
+10 -26
View File
@@ -2,14 +2,11 @@
import React, { useEffect, Suspense } from "react";
import { Spinner } from "@nextui-org/react";
import { Toaster } from "react-hot-toast";
import SignInComponent from "./components/SignIn";
import { useTranslation } from "@/shared/lib/useTranslation";
import { useSearchParams } from "next/navigation";
import { useLogin } from "@/hooks/useLogin";
import { useLogin } from "@/shared/hooks/useLogin";
import { useSharedStore } from "@/shared/store/share";
import { useGlobalStore } from "@/shared/store/global";
import { DynamicLogo } from "@/shared/components/DynamicLogo";
export interface LoginFormData {
user_email: string;
@@ -17,23 +14,6 @@ export interface LoginFormData {
nick_name?: string;
}
const LoginHeader = () => {
const { t } = useTranslation();
return (
<div className="flex flex-col items-center pb-6">
<DynamicLogo
alt="Platform Logo"
className="h-[40px]"
/>
<p className="text-xl font-medium mt-4">{t("Welcome")}</p>
<p className="text-sm text-default-500">
{t("Log in to your account to continue")}
</p>
</div>
);
};
export type StepState = "init" | "emailForm" | "verifyEmail";
const LoginPageContent = () => {
@@ -58,10 +38,8 @@ const LoginPageContent = () => {
return (
<>
<div className="flex flex-col items-center justify-center w-full h-full mt-20">
<LoginHeader />
<div className="flex flex-col items-center justify-center w-full h-full">
<SignInComponent />
<Toaster />
</div>
</>
);
@@ -69,10 +47,16 @@ const LoginPageContent = () => {
const LoginPage = () => {
return (
<Suspense fallback={<div className="flex justify-center mt-40"><Spinner size="lg" color="default" /></div>}>
<Suspense
fallback={
<div className="flex justify-center">
<Spinner size="lg" color="default" />
</div>
}
>
<LoginPageContent />
</Suspense>
);
};
export default LoginPage;
export default LoginPage;
+10 -10
View File
@@ -1,7 +1,7 @@
"use client";
import React from "react";
import ReactMarkdown from "react-markdown";
import MarkdownPreview from "@uiw/react-markdown-preview";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
import { Card, CardBody } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
@@ -14,26 +14,26 @@ export const AboutContent: React.FC = () => {
<Card shadow="none" className="bg-transparent">
<CardBody className="space-y-4">
<h1 className="text-3xl font-bold mb-6">{t("About Us")}</h1>
<div className="leading-relaxed prose prose-sm max-w-none">
<div className="leading-relaxed max-w-none">
{platformConfig.about_page ? (
<ReactMarkdown>{platformConfig.about_page}</ReactMarkdown>
<MarkdownPreview source={platformConfig.about_page} />
) : (
<ReactMarkdown>
{`
${t("**XPack** is a lightweight, open-source marketplace framework for MCP (Model Context Protocol) services.")}
${t("It allows you to transform any OpenAPI into a monetizable MCP service and build your own API store in just minutes.")}
<MarkdownPreview
source={`
${t("**XPack** is a lightweight, open-source marketplace framework for MCP (Model Context Protocol) servers.")}
${t("It allows you to transform any OpenAPI into a monetizable MCP server and build your own API store in just minutes.")}
${t("✨ With XPack, you can:")}
${t("- ✅ **One-click OpenAPI → MCP service config**")}
${t("- 🧾 **SEO-friendly homepage + mcp service page**")}
${t("- ✅ **One-click OpenAPI → MCP server config**")}
${t("- 🧾 **SEO-friendly homepage + mcp server page**")}
${t("- 💳 **Built-in billing (per-call)**")}
${t("- 👥 **User account management**")}
${t("- 🛠 **Support Stripe Payment**")}
${t("- 🔐 **Support Email & Google OAuth Sign in**")}
${t("Everything is open-source and licensed under **Apache 2.0** — ready for commercial use.")}`}
</ReactMarkdown>
/>
)}
</div>
</CardBody>
@@ -48,8 +48,8 @@ export const ChangePasswordModal: React.FC<ChangePasswordModalProps> = ({
return;
}
if (newPassword.length < 8) {
toast.error(t("Password must be at least 8 characters long"));
if (newPassword.length < 6) {
toast.error(t("Password must be at least 6 characters long"));
return;
}
@@ -73,7 +73,7 @@ export const ChangePasswordModal: React.FC<ChangePasswordModalProps> = ({
newPassword.trim() !== "" &&
confirmPassword.trim() !== "" &&
newPassword === confirmPassword &&
newPassword.length >= 8;
newPassword.length >= 6;
return (
<Modal isOpen={isOpen} onClose={handleClose} size="md">
@@ -90,7 +90,7 @@ export const ChangePasswordModal: React.FC<ChangePasswordModalProps> = ({
type={showNewPassword ? "text" : "password"}
value={newPassword}
onChange={(e) => setNewPassword(e.target.value)}
description={t("Password must be at least 8 characters long")}
description={t("Password must be at least 6 characters long")}
endContent={
<button
type="button"
@@ -0,0 +1,113 @@
"use client";
import React, { useState, useRef } from "react";
import { Card, Spinner } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import toast from "react-hot-toast";
import { UploadIcon } from "lucide-react";
import { calculateFileSha256 } from "@/shared/utils/crypto";
interface UploadImageProps {
onSave: (file: File, sha256?: string) => Promise<string>;
imageUrl?: string;
setImageUrl: (imageUrl: string) => void;
className?: string;
description?: string;
}
const UploadImage: React.FC<UploadImageProps> = ({
onSave,
imageUrl,
setImageUrl,
className = "h-32 w-32",
description,
}) => {
const { t } = useTranslation();
const [isUploading, setIsUploading] = useState(false);
const fileInputRef = useRef<HTMLInputElement>(null);
const handleImageUpload = async (
event: React.ChangeEvent<HTMLInputElement>
) => {
const file = event.target.files?.[0];
if (!file) return;
// Validate file type
if (!file.type.startsWith("image/")) {
toast.error(t("Please select a valid image file"));
return;
}
// Validate file size (max 5MB)
if (file.size > 5 * 1024 * 1024) {
toast.error(t("Image size should be less than 5MB"));
return;
}
setIsUploading(true);
try {
const sha256 = await calculateFileSha256(file);
const imageUrl = await onSave(file, sha256);
setImageUrl(imageUrl);
} catch (error) {
console.error("Upload failed:", error);
toast.error(t("Failed to upload image"));
} finally {
setIsUploading(false);
}
};
const handleImageClick = () => {
if (!isUploading) {
fileInputRef.current?.click();
}
};
return (
<div className="space-y-2">
<Card
className={`relative group ${isUploading ? "cursor-not-allowed" : "cursor-pointer"} ${className} `}
style={{
backgroundSize: "contain",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
}}
onPress={handleImageClick}
isPressable={!isUploading}
shadow="none"
>
{imageUrl && (
<img
src={imageUrl}
alt="Uploaded"
className="w-full h-full object-contain"
/>
)}
<div
className={`absolute top-0 rounded-large right-0 bg-default-100 w-full h-full flex items-center justify-center transition-opacity duration-300 ${
imageUrl && !isUploading ? "opacity-0" : "opacity-100"
} group-hover:opacity-50 backdrop-blur-sm`}
></div>
<div
className={`absolute w-full h-full flex flex-col gap-2 items-center justify-center ${
imageUrl && !isUploading ? "opacity-0" : "opacity-100"
} group-hover:opacity-100`}
>
<span>
{isUploading ? <Spinner size="lg" /> : <UploadIcon size={48} />}
</span>
<span className="text-sm text-default-500">{description}</span>
</div>
</Card>
<input
ref={fileInputRef}
type="file"
accept="image/*"
onChange={handleImageUpload}
className="hidden"
/>
</div>
);
};
export default UploadImage;
@@ -0,0 +1,138 @@
"use client";
import React, { useState } from "react";
import { Input, Button } from "@nextui-org/react";
import { Eye, EyeOff } from "lucide-react";
import { AdminConfig } from "@/types/system";
import { z } from "zod";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { useTranslation } from "@/shared/lib/useTranslation";
const formSchema = z.object({
password: z
.string()
.min(1, "Password is required")
.max(100, "Password is too long")
.min(6, "Password must be at least 6 characters"),
confirmPassword: z
.string()
.min(1, "Confirm password is required")
.max(100, "Confirm password is too long")
.min(6, "Confirm password must be at least 6 characters"),
});
type FormData = z.infer<typeof formSchema>;
interface AdminConfigFormProps {
onSave: (config: AdminConfig) => Promise<boolean>;
}
export const AdminConfigForm: React.FC<AdminConfigFormProps> = ({ onSave }) => {
const { t } = useTranslation();
const {
handleSubmit,
control,
watch,
formState: { errors, isSubmitting, isValid },
} = useForm<FormData>({
resolver: zodResolver(formSchema),
mode: "onBlur",
});
const [showPassword, setShowPassword] = useState(false);
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
const onSubmit = async (data: FormData) => {
await onSave({
password: data.password,
} as AdminConfig);
};
const passwordsMatch = watch("password") === watch("confirmPassword");
return (
<form
onSubmit={handleSubmit(onSubmit)}
className="flex flex-col gap-4 pb-4"
>
<Controller
name="password"
control={control}
render={({ field }) => (
<Input
{...field}
label={t("Administrator Password")}
placeholder={t("Enter administrator password")}
description={t("Password must be at least 6 characters long")}
isInvalid={!!errors.password}
errorMessage={errors.password?.message}
type={showPassword ? "text" : "password"}
endContent={
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="focus:outline-none"
>
{showPassword ? (
<EyeOff className="w-4 h-4 text-gray-400" />
) : (
<Eye className="w-4 h-4 text-gray-400" />
)}
</button>
}
isRequired
autoComplete="new-password"
labelPlacement="outside"
/>
)}
/>
<Controller
name="confirmPassword"
control={control}
render={({ field }) => (
<Input
{...field}
label={t("Confirm Password")}
placeholder={t("Confirm administrator password")}
description={t("Re-enter the password to confirm")}
isInvalid={
!!errors.confirmPassword ||
(!passwordsMatch && (field.value?.length || 0) > 0)
}
errorMessage={
errors.confirmPassword?.message || t("Passwords do not match")
}
type={showConfirmPassword ? "text" : "password"}
endContent={
<button
type="button"
onClick={() => setShowConfirmPassword(!showConfirmPassword)}
className="focus:outline-none"
>
{showConfirmPassword ? (
<EyeOff className="w-4 h-4 text-gray-400" />
) : (
<Eye className="w-4 h-4 text-gray-400" />
)}
</button>
}
autoComplete="new-password"
isRequired
labelPlacement="outside"
/>
)}
/>
<div className="flex mt-2">
<Button
type="submit"
color="primary"
isLoading={isSubmitting}
isDisabled={!isValid}
className="w-fit"
size="sm"
>
{t("Save")}
</Button>
</div>
</form>
);
};
@@ -1,5 +0,0 @@
.xpack-console-stats-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
max-width: 100%;
}
+300 -83
View File
@@ -1,105 +1,322 @@
"use client";
import React, { useState, useEffect } from "react";
import { overviewService } from "@/services/overviewService";
import { PlatformOverviewData } from "@/types/dashboard";
import "./ConsoleStats.css"
import { Alert, Card, CardBody, CardFooter } from "@nextui-org/react";
import React, { useMemo, useState, useEffect } from "react";
import {
Card,
CardBody,
CardHeader,
Tabs,
Tab,
Listbox,
ListboxItem,
Skeleton,
} from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { ChartBarIcon, DollarSignIcon, ServerIcon, UserIcon } from "lucide-react";
import {
LineChart,
Line,
XAxis,
YAxis,
CartesianGrid,
Tooltip,
ResponsiveContainer,
} from "recharts";
import {
getAdminAnalytics,
AdminAnalyticsData,
TopServiceItem,
} from "@/api/adminAnalytics.api";
import toast from "react-hot-toast";
interface StatCardProps {
title: string;
value: string | number;
icon: React.ReactNode;
description?: string;
// Chart data interface to match existing chart component
interface ChartDataItem {
date: string;
users: number;
revenue: number;
calls: number;
}
const StatCard: React.FC<StatCardProps> = ({ title, value, icon, description }) => {
const { t } = useTranslation();
return (
<Card shadow="none" className="border-1">
<CardBody>
<div className="flex items-center justify-between">
<div className="flex-1">
<p className="text-sm font-medium text-gray-600 mb-1">{t(title)}</p>
<p className="text-2xl font-bold text-gray-900">{value}</p>
</div>
<div className="ml-4 text-blue-500">
{icon}
</div>
</div>
</CardBody>
<CardFooter>
{description && (
<p className="text-xs text-gray-500 mt-1">{t(description)}</p>
)}
</CardFooter>
</Card>
// Transform API data to chart format
const transformToChartData = (
analytics: AdminAnalyticsData
): ChartDataItem[] => {
// Get the maximum length of days arrays to handle potential mismatches
const maxLength = Math.max(
analytics.user_register.days.length,
analytics.user_pay.days.length,
analytics.mcp_call.days.length
);
const chartData: ChartDataItem[] = [];
for (let i = 0; i < maxLength; i++) {
// Format date for display (converting from YYYY-MM-DD to MMM DD)
const userRegDay = analytics.user_register.days[i];
const payDay = analytics.user_pay.days[i];
const callDay = analytics.mcp_call.days[i];
// Use the first available date, format it nicely
const rawDate =
userRegDay?.stats_day || payDay?.stats_day || callDay?.stats_day;
const formattedDate = rawDate
? new Date(rawDate).toLocaleDateString("en-US", {
month: "short",
day: "numeric",
})
: `Day ${i + 1}`;
chartData.push({
date: formattedDate,
users: userRegDay ? parseInt(userRegDay.count as string) || 0 : 0,
revenue: payDay ? payDay.count : 0,
calls: callDay ? callDay.count : 0,
});
}
return chartData;
};
// Render label + total value in tab header
const TabTitle: React.FC<{
label: string;
total: number | string;
}> = ({ label, total }) => (
<div className="flex flex-col items-start gap-2">
<div className="text-sm text-default-500">{label}</div>
<div className="text-2xl font-semibold text-default-900">
{typeof total === "number" ? total.toLocaleString() : total}
</div>
</div>
);
const ConsoleStats: React.FC = () => {
const { t } = useTranslation();
const [overviewData, setOverviewData] = useState<PlatformOverviewData | null>(null);
const fetchOverviewData = async () => {
try {
const data = await overviewService.getPlatformOverview();
setOverviewData(data);
} catch (err) {
console.error('Failed to fetch overview data:', err);
} finally {
}
};
// get platform overview data
const [activeTab, setActiveTab] = useState<string>("users");
// State for API data
const [analyticsData, setAnalyticsData] = useState<AdminAnalyticsData | null>(
null
);
const [loading, setLoading] = useState(true);
// Fetch analytics data on component mount
useEffect(() => {
fetchOverviewData();
const fetchData = async () => {
try {
setLoading(true);
const response = await getAdminAnalytics();
if (response.success) {
setAnalyticsData(response.data);
} else {
toast.error(
response.error_message || "Failed to load analytics data"
);
}
} catch (err) {
} finally {
setLoading(false);
}
};
fetchData();
}, []);
// Transform API data to chart format
const chartData = useMemo<ChartDataItem[]>(() => {
if (!analyticsData) return [];
return transformToChartData(analyticsData);
}, [analyticsData]);
// Format revenue as currency (USD by default)
const formatCurrency = (value: number, currency: string = "USD") =>
new Intl.NumberFormat("en-US", { style: "currency", currency }).format(
value
);
if (loading) {
return (
<div className="w-full flex flex-col gap-4 h-full">
<Skeleton className="rounded-lg" isLoaded={!loading}>
<div className="h-24 rounded-lg bg-secondary" />
</Skeleton>
<div className="flex flex-col gap-3">
<Skeleton className="w-3/5 rounded-lg" isLoaded={!loading}>
<div className="h-3 w-full rounded-lg bg-secondary" />
</Skeleton>
<Skeleton className="w-4/5 rounded-lg" isLoaded={!loading}>
<div className="h-3 w-full rounded-lg bg-secondary-300" />
</Skeleton>
<Skeleton className="w-2/5 rounded-lg" isLoaded={!loading}>
<div className="h-3 w-full rounded-lg bg-secondary-200" />
</Skeleton>
</div>
</div>
);
}
return (
<div className="space-y-6">
{/* stat card grid */}
<div className="xpack-console-stats-grid gap-4">
<StatCard
title="Total Users"
value={overviewData?.total_user.toLocaleString() || 0}
icon={
<UserIcon size={32} />
}
description="Platform registered users"
/>
<StatCard
title="Total Revenue"
value={overviewData?.total_balance.toLocaleString() || 0}
icon={
<DollarSignIcon size={32} />
}
description="Platform total fund pool"
/>
<StatCard
title="Today's API Calls"
value={overviewData?.invoke_count.today.toLocaleString() || 0}
icon={
<ChartBarIcon size={32} />
}
description="API call count"
/>
{/* Charts with Tabs */}
<Card shadow="none" className="border-1">
<CardHeader className="p-0 flex items-center justify-between">
<Tabs
selectedKey={activeTab}
onSelectionChange={(key) => setActiveTab(key as string)}
variant="underlined"
color="primary"
classNames={{
base: "w-full",
tab: "h-fit justify-start border-b-1 p-4",
cursor: "w-[90%]",
tabList: "w-full gap-0 p-0",
}}
>
<Tab
key="users"
title={
<TabTitle
label={t("Daily Registered Users")}
total={analyticsData?.user_register.today || 0}
/>
}
/>
<Tab
key="revenue"
title={
<TabTitle
label={t("Daily Revenue")}
total={formatCurrency(analyticsData?.user_pay.today || 0)}
/>
}
/>
<Tab
key="calls"
title={
<TabTitle
label={t("Daily API Calls")}
total={analyticsData?.mcp_call.today || 0}
/>
}
/>
</Tabs>
</CardHeader>
<CardBody>
<div className="w-full h-[300px]">
<ResponsiveContainer width="100%" height="100%">
<LineChart data={chartData}>
<CartesianGrid strokeDasharray="3 3" vertical={false} />
<XAxis dataKey="date" />
<YAxis />
<Tooltip
labelStyle={{ color: "#374151" }}
contentStyle={{
backgroundColor: "#f9fafb",
border: "1px solid #e5e7eb",
borderRadius: "8px",
padding: "12px",
}}
/>
{activeTab === "users" && (
<Line
type="monotone"
dataKey="users"
stroke="#3b82f6"
strokeWidth={2}
dot={false}
activeDot={{ fill: "#3b82f6", strokeWidth: 2, r: 4 }}
/>
)}
{activeTab === "revenue" && (
<Line
type="monotone"
dataKey="revenue"
stroke="#10b981"
strokeWidth={2}
dot={false}
activeDot={{ fill: "#10b981", strokeWidth: 2, r: 4 }}
/>
)}
{activeTab === "calls" && (
<Line
type="monotone"
dataKey="calls"
stroke="#f59e0b"
strokeWidth={2}
dot={false}
activeDot={{ fill: "#f59e0b", strokeWidth: 2, r: 4 }}
/>
)}
</LineChart>
</ResponsiveContainer>
</div>
</CardBody>
</Card>
<StatCard
title="Total MCP Services"
value={overviewData?.total_service.toLocaleString() || 0}
icon={
<ServerIcon size={32} />
}
description="Deployed services"
/>
</div>
{/* welcome guide */}
<Alert color="primary" title={t("Welcome to XPack.AI Open Source")} description={t("This is your AI service management center. You can quickly view platform core data on the left and manage and configure your MCP services, users, payment channels, etc.")}></Alert>
{/* Top Servers List */}
<Card shadow="none" className="border-1">
<CardHeader className="pb-0 flex items-center justify-between">
<h4 className="text-lg font-semibold text-gray-900">
{t("Top Servers by Calls")}
</h4>
</CardHeader>
<CardBody>
<div>
{analyticsData?.top_services?.length ? (
<Listbox
aria-label="top servers"
selectionMode="none"
className="overflow-visible p-0"
classNames={{ list: "overflow-visible space-y-3" }}
>
{(analyticsData.top_services || []).map(
(service: TopServiceItem, index: number) => (
<ListboxItem
key={service.id}
className="p-3 bg-gray-50 data-[hover=true]:bg-gray-100 cursor-default"
classNames={{
title: "w-full",
}}
>
<div className="flex items-center justify-between w-full gap-3">
<div className="flex items-center justify-center min-w-8 w-8 h-8 bg-blue-100 text-blue-600 rounded-full text-sm font-semibold">
{index + 1}
</div>
<div className="flex flex-col items-start flex-1 overflow-hidden">
<div className="flex gap-1 w-full">
<span className="text-danger-500">
{service.is_deleted ? t("(Deleted)") : ""}
</span>
<span className="truncate w-full flex-1">
{service.name}
</span>
</div>
<span className="text-xs text-gray-500 truncate w-full">
{service.short_description}
</span>
</div>
<div className="text-right">
<div className="text-lg font-semibold text-gray-900">
{service.call_count.toLocaleString()}
</div>
<div className="text-xs text-gray-500">
{t("Calls")}
</div>
</div>
</div>
</ListboxItem>
)
)}
</Listbox>
) : (
<div className="text-center py-8 text-gray-500">
{t("No servers available")}
</div>
)}
</div>
</CardBody>
</Card>
</div>
);
};
export default ConsoleStats;
export default ConsoleStats;
@@ -15,6 +15,7 @@ interface LoginSettingsContentProps {
loginConfig: LoginConfig;
saveLoginConfig: (config: LoginConfig) => Promise<boolean>;
emailConfig: EmailConfig;
type?: "email" | "google";
}
export const LoginSettingsContent: React.FC<LoginSettingsContentProps> = ({
@@ -22,6 +23,7 @@ export const LoginSettingsContent: React.FC<LoginSettingsContentProps> = ({
loginConfig,
saveLoginConfig,
emailConfig,
type = "email",
}) => {
const [googleSubmitLoading, setGoogleSubmitLoading] = useState(false);
const [emailSubmitLoading, setEmailSubmitLoading] = useState(false);
@@ -83,20 +85,24 @@ export const LoginSettingsContent: React.FC<LoginSettingsContentProps> = ({
return (
<div className="space-y-4 w-full">
{/* email config */}
<EmailConfigForm
config={loginConfig}
emailConfig={emailConfig}
onSave={handleSaveLoginConfig}
isLoading={emailSubmitLoading}
onTabNavigate={onTabNavigate}
/>
{type === "email" && (
<EmailConfigForm
config={loginConfig}
emailConfig={emailConfig}
onSave={handleSaveLoginConfig}
isLoading={emailSubmitLoading}
onTabNavigate={onTabNavigate}
/>
)}
{/* google auth config */}
<GoogleAuthConfigForm
config={loginConfig.google}
onSave={handleSaveGoogleAuthConfig}
isLoading={googleSubmitLoading}
/>
{type === "google" && (
<GoogleAuthConfigForm
config={loginConfig.google}
onSave={handleSaveGoogleAuthConfig}
isLoading={googleSubmitLoading}
/>
)}
</div>
);
};
+171 -115
View File
@@ -1,156 +1,108 @@
"use client";
import React, { useEffect, useState, Suspense } from "react";
import { useRouter, useSearchParams } from "next/navigation";
import { useTranslation } from "react-i18next";
import { useSearchParams } from "next/navigation";
import { useTranslation } from "@/shared/lib/useTranslation";
import { useAdminStore } from "@/store/admin";
import DashboardDemoContent from "@/shared/components/DashboardDemoContent";
import ConsoleStats from "@/components/console/ConsoleStats";
import PaymentChannelsContent from "@/components/console/PaymentChannelsContent";
import SystemSettingsContent from "@/components/console/SystemSettingsContent";
import { SidebarItem, TabKey } from "@/shared/types/dashboard";
import { useAdminLogin } from "@/hooks/useAdminLogin";
import { MCPServicesManagement } from "@/components/mcp-services/MCPServicesManagement";
import UserManagement from "@/components/user-management/UserManagement";
import RevenueManagement from "@/components/revenue-management/RevenueManagement";
import {
CreditCard,
DollarSign,
Home,
Settings,
Users,
ServerIcon,
} from "lucide-react";
import ConsoleSidebar from "./Sidebar";
import { withComponentInjection } from "@/shared/hooks/useComponentInjection";
import { DollarSign, Home, ServerIcon, Users } from "lucide-react";
import OnboardingWelcome, { REQUIRED_TASK_KEYS } from "./OnboardingWelcome";
import ConsoleStats from "./ConsoleStats";
import SystemSettingsModal from "./SystemSettingsModal";
import SharePlatformModal from "./SharePlatformModal";
import {
OnboardingTaskKey,
TaskItem,
TaskStatusEnum,
updateAdminOnboardingTasks,
} from "@/api/onboard.api";
const ConsoleContent: React.FC = () => {
const { t } = useTranslation();
const router = useRouter();
const searchParams = useSearchParams();
const [admin_token] = useAdminStore((state) => [state.admin_token]);
const _DefaultSubTab = "general";
const [admin_token, getAdminUser] = useAdminStore((state) => [
state.admin_token,
state.getAdminUser,
]);
const getInitialTab = (): TabKey => {
const tabFromUrl = searchParams.get("tab") as TabKey;
if (
tabFromUrl &&
[
"mcp-services",
"user-management",
"revenue-management",
"payment-channels",
"login-settings",
"system-settings",
].includes(tabFromUrl)
["mcp-services", "user-management", "revenue-management"].includes(
tabFromUrl
)
) {
return tabFromUrl;
}
return TabKey.CONSOLE;
};
const getInitialSubTab = (): string | undefined => {
const subTabFromUrl = searchParams.get("subtab");
return subTabFromUrl || _DefaultSubTab;
};
const [activeTab, setActiveTab] = useState<TabKey>(getInitialTab);
const [activeSubTab, setActiveSubTab] = useState<string | undefined>(
getInitialSubTab
);
const isSkipOnboarding =
typeof window !== "undefined" &&
localStorage.getItem("admin_onboarding_skip") === "1";
const [showOnboarding, setShowOnboarding] = useState<boolean>(false);
const [completedTasks, setCompletedTasks] = useState<string[]>([]);
const [isSettingsModalOpen, setIsSettingsModalOpen] =
useState<boolean>(false);
const [isShareModalOpen, setIsShareModalOpen] = useState<boolean>(false);
const [settingModalKeyword, setSettingModalKeyword] = useState<string>("");
const sidebarItems: SidebarItem[] = [
{
key: TabKey.CONSOLE,
icon: <Home size={18} />,
label: t("Dashboard"),
description: t("Overview and analytics"),
label: t("Analytics"),
description: t("Analyze platform usage and revenue"),
},
{
key: TabKey.MCP_SERVICES,
icon: <ServerIcon size={18} />,
label: t("MCP Services"),
description: t("Manage MCP services and API tools"),
label: t("MCP"),
description: t("Manage MCP servers and API tools"),
},
{
key: TabKey.USER_MANAGEMENT,
icon: <Users size={18} />,
label: t("User Management"),
label: t("User"),
description: t("Manage registered users"),
},
{
key: TabKey.REVENUE_MANAGEMENT,
icon: <DollarSign size={18} />,
label: t("Revenue Management"),
label: t("Revenue"),
description: t("View user recharge history"),
},
{
key: TabKey.PAYMENT_CHANNELS,
icon: <CreditCard size={18} />,
label: t("Payment Channels"),
description: t("Configure payment channels"),
},
{
key: TabKey.SYSTEM_SETTINGS,
icon: <Settings size={18} />,
label: t("System Settings"),
description: t("Platform basic configuration"),
// Sub-menu items for System Settings
subItems: [
{
key: "general",
label: "General",
description: "Platform basic configuration",
},
{
key: "login-settings",
label: "Login Settings",
description: "Configure authentication methods",
},
{
key: "homepage",
label: "Homepage",
description: "Homepage content and theme settings",
},
{
key: "about-page",
label: "About Page",
description: "About page content configuration",
},
{
key: "email-admin",
label: "Email & Admin",
description: "Email and administrator settings",
},
],
},
];
// If admin is not logged in, redirect to admin login page
useEffect(() => {
if (!admin_token) {
router.push("/admin");
window.location.href =
process.env.NEXT_PUBLIC_ADMIN_LOGIN_URL || "/admin";
}
}, [admin_token, router]);
}, [admin_token]);
const handleTabNavigate = (tab: TabKey, subTab?: string) => {
setActiveTab(tab);
setActiveSubTab(subTab || _DefaultSubTab);
const handleTabNavigate = (tab: TabKey | string, _subTab?: string) => {
setActiveTab(tab as TabKey);
// update url params
if (tab === TabKey.CONSOLE) {
// when switch to dashboard, clear all query params, only keep base path
router.push("/console", { scroll: false });
window.history.pushState({}, "", "/admin/console");
} else {
// other tabs set corresponding tab params
const params = new URLSearchParams();
params.set("tab", tab);
// add subtab parameter if provided
if (subTab) {
params.set("subtab", subTab);
}
router.push(`/console?${params.toString()}`, { scroll: false });
window.history.pushState({}, "", `/admin/console?${params.toString()}`);
}
};
@@ -161,6 +113,94 @@ const ConsoleContent: React.FC = () => {
adminLogout();
};
const handleSettingsClick = () => {
setIsSettingsModalOpen(true);
};
const handleSettingsModalClose = () => {
setIsSettingsModalOpen(false);
setSettingModalKeyword("");
};
const initOnboarding = async () => {
const res = await getAdminUser();
if (!res.success) {
adminLogout();
return;
}
try {
const completedTasks: string[] = (res.data.onboarding_tasks || [])
.filter(
(task: TaskItem) => task.task_status === TaskStatusEnum.COMPLETED
)
.map((task: TaskItem) => task.task_id);
setCompletedTasks(completedTasks);
setShowOnboarding(completedTasks.length !== REQUIRED_TASK_KEYS.length);
} catch (e) {
// Fallback to show onboarding if localStorage not available
setShowOnboarding(false);
}
};
//todo: onboarding
// Initialize onboarding state from localStorage
useEffect(() => {
if (isSkipOnboarding) {
setShowOnboarding(false);
return;
}
initOnboarding();
}, []);
const handleSkipOnboarding = () => {
localStorage.setItem("admin_onboarding_skip", "1");
setShowOnboarding(false);
};
const markTaskAsCompleted = async (taskKey: OnboardingTaskKey) => {
// Mark task as completed
const next = Array.from(new Set([...completedTasks, taskKey]));
setCompletedTasks(next);
const result = await updateAdminOnboardingTasks({
task_id: taskKey,
task_status: TaskStatusEnum.COMPLETED,
});
if (!result) return;
if (next.length === REQUIRED_TASK_KEYS.length) {
localStorage.setItem("admin_onboarding_skip", "1");
setShowOnboarding(false);
}
};
const handleTaskClick = async (taskKey: OnboardingTaskKey) => {
switch (taskKey) {
case OnboardingTaskKey.PLATFORM_SETUP:
setIsSettingsModalOpen(true);
await markTaskAsCompleted(taskKey);
break;
case OnboardingTaskKey.MCP_SERVICES:
handleTabNavigate(TabKey.MCP_SERVICES);
await markTaskAsCompleted(taskKey);
break;
case OnboardingTaskKey.REVENUE_MANAGEMENT:
setSettingModalKeyword("Payment");
setIsSettingsModalOpen(true);
await markTaskAsCompleted(taskKey);
break;
case OnboardingTaskKey.SHARE_PLATFORM:
setIsShareModalOpen(true);
// 不在这里标记完成,等待实际分享后再标记
break;
}
};
const handleShareComplete = async () => {
await markTaskAsCompleted(OnboardingTaskKey.SHARE_PLATFORM);
};
const handleShareModalClose = () => {
setIsShareModalOpen(false);
};
// render different content based on activeTab
const renderContent = () => {
switch (activeTab) {
@@ -178,30 +218,24 @@ const ConsoleContent: React.FC = () => {
<RevenueManagement />
</div>
);
case TabKey.PAYMENT_CHANNELS:
return (
<DashboardDemoContent
title={t("Payment Channels")}
description={t("Configure payment channels")}
>
<PaymentChannelsContent />
</DashboardDemoContent>
);
case "system-settings":
return (
<SystemSettingsContent
activeSubTab={activeSubTab}
subTab={sidebarItems
.find((item) => item.key === activeTab)
?.subItems?.find((item) => item.key === activeSubTab)}
onTabNavigate={handleTabNavigate}
/>
);
default:
return (
return showOnboarding ? (
<OnboardingWelcome
onSkipOnboarding={handleSkipOnboarding}
onTaskClick={handleTaskClick}
completedTasks={completedTasks}
/>
) : (
<DashboardDemoContent
title={t("Admin Dashboard")}
description={t("Platform management and analytics")}
title={
<div className="flex items-center gap-2">
<span>{t("Analytics")}</span>
<span className="text-primary text-lg font-medium">
{t("(30 days)")}
</span>
</div>
}
description={t("Analyze platform usage and revenue")}
>
<ConsoleStats />
</DashboardDemoContent>
@@ -215,15 +249,33 @@ const ConsoleContent: React.FC = () => {
{/* Sidebar */}
<ConsoleSidebar
activeTab={activeTab}
activeSubTab={activeSubTab}
onTabNavigate={handleTabNavigate}
onLogout={handleLogout}
sidebarItems={sidebarItems}
onSettingsClick={handleSettingsClick}
/>
{/* Main Content */}
<div className="flex-1 h-screen overflow-y-auto">{renderContent()}</div>
</div>
{/* Settings Modal */}
{isSettingsModalOpen && (
<SystemSettingsModal
isOpen={true}
onClose={handleSettingsModalClose}
keyword={settingModalKeyword}
/>
)}
{/* Share Platform Modal */}
{isShareModalOpen && (
<SharePlatformModal
isOpen={true}
onClose={handleShareModalClose}
onShareComplete={handleShareComplete}
/>
)}
</div>
);
};
@@ -244,4 +296,8 @@ const ConsoleMain: React.FC = () => {
);
};
export default ConsoleMain;
// Export the base component for direct use
export { ConsoleMain as ConsoleMainBase };
// Export with component injection support
export default withComponentInjection("console/Main", ConsoleMain);
@@ -0,0 +1,180 @@
"use client";
import React, { useEffect, useState } from "react";
import {
CheckCircle2,
Share2,
ArrowRight,
Settings,
ServerIcon,
DollarSign,
} from "lucide-react";
import {
Button,
Card,
CardBody,
Listbox,
ListboxItem,
Link,
} from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
import { OnboardingTaskKey } from "@/api/onboard.api";
export const REQUIRED_TASK_KEYS = [
OnboardingTaskKey.PLATFORM_SETUP,
OnboardingTaskKey.MCP_SERVICES,
OnboardingTaskKey.REVENUE_MANAGEMENT,
OnboardingTaskKey.SHARE_PLATFORM,
];
interface OnboardingWelcomeProps {
onSkipOnboarding: () => void;
completedTasks: string[];
onTaskClick: (taskKey: OnboardingTaskKey) => void;
}
const OnboardingWelcome: React.FC<OnboardingWelcomeProps> = ({
onSkipOnboarding,
completedTasks,
onTaskClick,
}) => {
const { t } = useTranslation();
const { platformConfig } = usePlatformConfig();
const [activeTab, setActiveTab] = useState<OnboardingTaskKey | undefined>(
REQUIRED_TASK_KEYS.find((task) => !completedTasks.includes(task))
);
useEffect(() => {
setActiveTab(
REQUIRED_TASK_KEYS.find((task) => !completedTasks.includes(task))
);
}, [completedTasks]);
const tasks = [
{
key: OnboardingTaskKey.PLATFORM_SETUP,
title: t("Configure Platform Settings"),
subtitle: t("Set up your platform name, domain, and branding."),
icon: <Settings size={18} />,
},
{
key: OnboardingTaskKey.MCP_SERVICES,
title: t("Add MCP Services"),
subtitle: t("Configure and deploy your first MCP server tools."),
icon: <ServerIcon size={18} />,
},
{
key: OnboardingTaskKey.REVENUE_MANAGEMENT,
title: t("Configure Payment & Billing"),
subtitle: t("Set up payment channels and token pricing."),
icon: <DollarSign size={18} />,
},
{
key: OnboardingTaskKey.SHARE_PLATFORM,
title: t("Share Your Platform"),
subtitle: t("Invite users and promote your MCP platform."),
icon: <Share2 size={18} />,
},
];
const isTaskCompleted = (taskKey: string) => completedTasks.includes(taskKey);
return (
<div className="min-h-screen flex flex-col items-center justify-center p-6">
{/* Header */}
<div className="text-center mb-8">
<h1 className="text-2xl font-bold text-gray-900 mb-2">
{t("Welcome to {{name}}!", {
name: platformConfig.name || "your platform",
})}
</h1>
<p className="text-gray-600 text-sm">
{t("Let's set up {{name}} to get you started.", {
name: platformConfig.name || "your platform",
})}
</p>
</div>
<Card className="w-full max-w-lg border-1 overflow-visible" shadow="none">
<CardBody className="py-0 overflow-y-visible">
<Listbox
aria-label="Onboarding tasks"
className="overflow-visible"
classNames={{
list: "overflow-visible",
}}
>
{tasks.map((task, index) => (
<ListboxItem
key={task.key}
startContent={
<div
className={`flex-shrink-0 ${
!isTaskCompleted(task.key)
? "text-primary"
: "text-default-400"
}`}
>
{task.icon}
</div>
}
endContent={
isTaskCompleted(task.key) ? (
<CheckCircle2
size={18}
className="text-green-500 flex-shrink-0"
/>
) : (
<ArrowRight
size={18}
className="text-primary flex-shrink-0 group-data-[hover=true]:translate-x-1 duration-300 ease-in-out"
/>
)
}
description={activeTab === task.key ? task.subtitle : undefined}
onPress={() => {
onTaskClick(task.key);
}}
className={`py-6 gap-3 ${
!isTaskCompleted(task.key)
? "data-[hover=true]:opacity-50"
: "text-default-500 data-[hover=true]:text-default-500"
} ${activeTab === task.key ? "scale-[1.15] border-2 border-primary bg-white px-6 data-[hover=true]:opacity-100 data-[hover=true]:bg-white" : "data-[hover=true]:bg-transparent"}`}
classNames={{
title: "font-bold text-md",
}}
showDivider={
index !== tasks.length - 1 && activeTab !== task.key
}
>
{task.title}
</ListboxItem>
))}
</Listbox>
</CardBody>
</Card>
{/* Help Section */}
<div className="text-center my-6">
<p className="text-xs text-gray-500">
{t("Need help getting started? Check out our")}{" "}
<Link
href="https://discord.gg/cyZfcdCXkW"
size="sm"
className="font-medium"
target="_blank"
>
{t("Discord Community")}
</Link>
.
</p>
</div>
{/* Skip Button */}
<div className="text-center">
<Button onPress={onSkipOnboarding} size="sm" variant="bordered">
{t("Skip setup guide")}
</Button>
</div>
</div>
);
};
export default OnboardingWelcome;
@@ -6,7 +6,13 @@ import { AlipayConfigForm } from "../payment/AlipayConfigForm";
import { WechatConfigForm } from "../payment/WechatConfigForm";
import { usePaymentChannelManagement } from "@/hooks/usePaymentChannelManagement";
export const PaymentChannelsContent: React.FC = () => {
interface PaymentChannelsContentProps {
labelPlacement?: "outside" | "inside";
}
export const PaymentChannelsContent: React.FC<PaymentChannelsContentProps> = ({
labelPlacement = "inside",
}) => {
const {
stripeConfig,
alipayConfig,
@@ -30,6 +36,7 @@ export const PaymentChannelsContent: React.FC = () => {
onEnable={enableChannel}
onDisable={disableChannel}
isLoading={isStripeSaving}
labelPlacement={labelPlacement}
/>
{/* coming soon */}
{/* alipay configuration */}
@@ -0,0 +1,165 @@
"use client";
import React from "react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { Link as LinkIcon } from "lucide-react";
import {
Modal,
ModalContent,
ModalBody,
Button,
Image,
} from "@nextui-org/react";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
import { FaFacebook } from "react-icons/fa";
import { FaLinkedin } from "react-icons/fa6";
import { FaXTwitter } from "react-icons/fa6";
import { copyToClipboard } from "@/shared/utils/clipboard";
import toast from "react-hot-toast";
interface SharePlatformModalProps {
isOpen: boolean;
onClose: () => void;
onShareComplete: () => void;
}
const SharePlatformModal: React.FC<SharePlatformModalProps> = ({
isOpen,
onClose,
onShareComplete,
}) => {
const { t } = useTranslation();
const { platformConfig } = usePlatformConfig();
const handleCopyLink = async () => {
try {
const res = await copyToClipboard(window.location.origin);
onShareComplete();
if (res.success) {
toast.success(t("Copied to clipboard"));
}
} catch (err) {
console.error("Failed to copy link:", err);
}
};
const handleSocialShare = (platform: "x" | "facebook" | "linkedin") => {
const text = t(
`Just launched my first MCP Platform:{{name}} with xpack.ai 🚀
Built in minutes, no coding, ready for AI Agents 🤖
👉Go and try my MCP: {{link}}
#MCP #AI #APIs #XPack #AIagents #DevTools`,
{
name: platformConfig.name,
link: window.location.origin,
}
);
let url = "";
const shareUrl = encodeURIComponent(window.location.origin);
switch (platform) {
case "x":
url = `https://twitter.com/intent/tweet?text=${encodeURIComponent(text)}&url=${shareUrl}`;
break;
case "facebook":
url = `https://www.facebook.com/sharer/sharer.php?u=${shareUrl}`;
break;
case "linkedin":
url = `https://www.linkedin.com/sharing/share-offsite/?url=${shareUrl}`;
break;
}
if (url) {
window.open(url, "_blank", "width=600,height=400");
onShareComplete();
}
};
return (
<Modal isOpen={isOpen} onClose={onClose} size="xl">
<ModalContent>
<ModalBody>
{/* Header */}
<div className="my-6 flex flex-col gap-2 ">
<h2 className="text-2xl font-extrabold text-primary md:text-4xl">
{t("Your MCP Market is ready.")}
</h2>
<p className="text-2xl font-bold text-gray-900">
{t("Share your MCP to the world")}
</p>
</div>
{/* Preview Card */}
<div className="mb-6 rounded-xl border border-gray-200 bg-white p-6">
<div className="space-y-2">
<h3 className="text-xl font-semibold text-gray-900">
{platformConfig.website_title || platformConfig.name}
</h3>
<p className="text-gray-700">{platformConfig.meta_description}</p>
</div>
<div className="mt-4 flex items-center gap-2 text-sm text-gray-800">
{platformConfig.logo && (
<Image
src={platformConfig.logo}
alt={platformConfig.name}
width={20}
height={20}
/>
)}
<span className="font-semibold">{platformConfig.name}</span>
<span>•</span>
<span className="text-gray-600">{window.location.hostname}</span>
</div>
</div>
{/* Actions */}
<div className="flex flex-col items-stretch gap-4 sm:flex-row sm:items-center sm:justify-between mb-4">
{/* Social buttons */}
<div className="flex items-center gap-2">
<Button
onPress={() => handleSocialShare("x")}
title={t("Share on X")}
isIconOnly
size="lg"
variant="flat"
>
<FaXTwitter size={20} />
</Button>
<Button
onPress={() => handleSocialShare("facebook")}
title={t("Share on Facebook")}
isIconOnly
size="lg"
variant="flat"
>
<FaFacebook size={20} className="text-primary" />
</Button>
<Button
onPress={() => handleSocialShare("linkedin")}
title={t("Share on LinkedIn")}
isIconOnly
size="lg"
variant="flat"
>
<FaLinkedin size={20} className="text-blue-500" />
</Button>
</div>
{/* Copy link button */}
<Button
onPress={handleCopyLink}
size="lg"
color="primary"
className="gap-1 w-full bg-default-900"
>
<LinkIcon size={20} />
<span className="text-base font-semibold">{t("Copy link")}</span>
</Button>
</div>
</ModalBody>
</ModalContent>
</Modal>
);
};
export default SharePlatformModal;
+75 -122
View File
@@ -2,159 +2,112 @@
import React from "react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { Button, Divider, Link, Tooltip } from "@nextui-org/react";
import { LogOut } from "lucide-react";
import { Button, Divider, Tooltip } from "@nextui-org/react";
import { ExternalLinkIcon, LogOut, Settings } from "lucide-react";
import { DashboardSidebarProps } from "@/shared/types/dashboard";
import { DynamicLogo } from "@/shared/components/DynamicLogo";
import { FaDiscord } from "react-icons/fa";
import Link from "next/link";
const ConsoleSidebar: React.FC<DashboardSidebarProps> = ({
interface ConsoleSidebarProps extends DashboardSidebarProps {
onSettingsClick?: () => void;
}
const ConsoleSidebar: React.FC<ConsoleSidebarProps> = ({
activeTab,
activeSubTab,
onTabNavigate,
onLogout,
sidebarItems,
onSettingsClick,
}) => {
const { t } = useTranslation();
const handleSubItemClick = (parentKey: string, subKey: string) => {
onTabNavigate?.(parentKey as any, subKey);
};
// Filter out system settings from sidebar items
const filteredSidebarItems = sidebarItems.filter(
(item) => item.key !== "system-settings"
);
return (
<div className="flex h-screen">
{/* Main Sidebar */}
<div className="py-2 px-2 w-[70px] overflow-hidden border-r border-divider flex flex-col justify-between">
{/* Header */}
<div className="mb-6 mt-4 flex flex-col items-center gap-2">
<Link href={process.env.NEXT_PUBLIC_DOMAIN || "/"}>
<DynamicLogo
alt="Platform Logo"
className="max-w-full h-auto max-h-[30px]"
/>
</Link>
</div>
{/* Navigation */}
<div className="flex flex-col gap-2 flex-1">
{sidebarItems.map((item) => (
<React.Fragment key={item.key}>
<Tooltip
content={t(item.label)}
closeDelay={0}
disableAnimation
placement="right"
<>
<div className="flex h-screen">
{/* Main Sidebar */}
<div className="py-2 px-4 w-[300px] overflow-hidden border-r border-divider flex flex-col justify-between bg-default-50">
{/* Header */}
<div className="mb-6 mt-4 flex gap-2 justify-between items-center">
<Link href="/" prefetch target="_blank">
<DynamicLogo
alt="Platform Logo"
className="max-w-full h-[32px] object-contain"
/>
</Link>
<Tooltip content={t("Open in new tab")} closeDelay={0} disableAnimation>
<Link
href="/"
prefetch
target="_blank"
className="hover:text-primary"
>
<Button
key={item.key}
variant={activeTab === item.key ? "flat" : "light"}
color={activeTab === item.key ? "primary" : "default"}
startContent={item.icon}
className="w-full h-auto p-4"
onPress={() => onTabNavigate?.(item.key)}
isIconOnly
></Button>
</Tooltip>
</React.Fragment>
))}
</div>
<ExternalLinkIcon size={18} />
</Link>
</Tooltip>
</div>
<div>
<Divider className="my-2" />
{/* Navigation */}
<div className="flex flex-col gap-2 flex-1">
{filteredSidebarItems.map((item) => (
<Button
key={item.key}
variant={activeTab === item.key ? "flat" : "light"}
color={activeTab === item.key ? "primary" : "default"}
startContent={item.icon}
className="w-full h-auto p-4 justify-start"
onPress={() => onTabNavigate?.(item.key)}
>
{t(item.label)}
</Button>
))}
</div>
<div className="space-y-2">
<Tooltip
content={t("Discord")}
closeDelay={0}
disableAnimation
placement="right"
>
<div>
<Divider className="my-2" />
<div className="space-y-2">
<Button
variant="light"
startContent={<FaDiscord size={18} />}
className="w-full h-auto p-4"
className="w-full h-auto p-4 justify-start"
onPress={() => {
window.open("https://discord.gg/cyZfcdCXkW", "_blank");
}}
isIconOnly
></Button>
</Tooltip>
>
{t("Discord")}
</Button>
{/* Logout */}
<Tooltip
content={t("Log Out")}
closeDelay={0}
disableAnimation
placement="right"
>
{/* Settings */}
<Button
variant="light"
startContent={<Settings size={18} />}
className="w-full h-auto p-4 justify-start"
onPress={onSettingsClick}
>
{t("Settings")}
</Button>
{/* Logout */}
<Button
variant="light"
color="danger"
startContent={<LogOut size={18} />}
className="w-full h-auto p-4"
className="w-full h-auto p-4 justify-start"
onPress={onLogout}
isIconOnly
></Button>
</Tooltip>
>
{t("Log Out")}
</Button>
</div>
</div>
</div>
</div>
{/* Sub Menu Panel */}
{(() => {
const activeItem = sidebarItems.find((item) => item.key === activeTab);
if (!activeItem?.subItems?.length) return null;
return (
<div className="relative bg-content2/50 border-r overflow-hidden w-[240px] p-3">
<div className="mb-3 pb-2 border-b">
<h4 className="font-medium text-sm text-default-700">
{t(activeItem.label)}
</h4>
<p className="text-xs text-default-500 mt-1">
{t(activeItem.description)}
</p>
</div>
<div className="space-y-1">
{activeItem.subItems?.map((subItem) => {
const isSubActive = activeSubTab === subItem.key;
return (
<React.Fragment key={subItem.key}>
<Button
key={subItem.key}
variant={isSubActive ? "flat" : "light"}
color={isSubActive ? "primary" : "default"}
size="sm"
className={`w-full justify-start h-auto p-2 text-left ${
isSubActive
? "bg-primary/10 border border-primary/20"
: "hover:bg-default-100"
}`}
onPress={() =>
handleSubItemClick(activeItem.key, subItem.key)
}
>
<div className="flex flex-col items-start w-full">
<div className="font-medium text-xs">
{t(subItem.label)}
</div>
{subItem.description && (
<div className="text-xs opacity-60 mt-0.5 truncate w-full">
{t(subItem.description)}
</div>
)}
</div>
</Button>
</React.Fragment>
);
})}
</div>
</div>
);
})()}
</div>
</>
);
};
@@ -1,156 +0,0 @@
"use client";
import React, { useState } from "react";
import { HomepageSettings } from "@/components/system-setting/HomepageSettings";
import { AboutPageSettings } from "@/components/system-setting/AboutPageSettings";
import { EmailAndAdminSettings } from "@/components/system-setting/EmailAndAdminSettings";
import { useSystemConfigManagement } from "@/hooks/useSystemConfigManagement";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
import { Theme } from "@/shared/types/system";
import i18n from "@/shared/lib/i18n";
import { PlatformConfigForm } from "../system-setting/PlatformConfigForm";
import DashboardDemoContent from "@/shared/components/DashboardDemoContent";
import { useTranslation } from "@/shared/lib/useTranslation";
import { SidebarSubItem, TabKey } from "@/shared/types/dashboard";
import { LoginSettingsContent } from "./LoginSettingsContent";
interface SystemSettingsContentProps {
activeSubTab?: string;
subTab?: SidebarSubItem;
onTabNavigate: (tab: TabKey, subTab?: string) => void;
}
export const SystemSettingsContent: React.FC<SystemSettingsContentProps> = ({
activeSubTab,
subTab,
onTabNavigate,
}) => {
const { updateClientConfig } = usePlatformConfig();
const [isAboutLoading, setIsAboutLoading] = useState(false);
const { t } = useTranslation();
const {
// platform config
platformConfig,
platformLoading,
savePlatformConfig,
// admin config
adminConfig,
adminLoading,
saveAdminConfig,
// email config
emailConfig,
emailLoading,
saveEmailConfig,
// image upload
uploadImage,
// login config
loginConfig,
saveLoginConfig,
} = useSystemConfigManagement();
// save admin config
const handleSaveAdminConfig = async (config: typeof adminConfig) => {
await saveAdminConfig(config);
};
// save email config
const handleSaveEmailConfig = async (config: typeof emailConfig) => {
await saveEmailConfig(config);
};
// save platform config
const handleSavePlatformConfig = async (config: typeof platformConfig) => {
const result = await savePlatformConfig(config);
if (!result) return;
updateClientConfig({
platform: config,
});
if (config.language !== i18n.language) {
i18n.changeLanguage(config.language);
}
};
// handle theme change
const handleThemeChange = async (theme: Theme) => {
const updatedConfig = { ...platformConfig, theme };
const result = await savePlatformConfig(updatedConfig, "theme");
if (!result) return;
updateClientConfig({
platform: updatedConfig,
});
};
// handle about save
const handleAboutSave = async (aboutContent: string) => {
setIsAboutLoading(true);
const updatedConfig = { ...platformConfig, about_page: aboutContent };
const result = await savePlatformConfig(updatedConfig, "about");
setIsAboutLoading(false);
if (!result) return;
updateClientConfig({
platform: updatedConfig,
});
};
// Render content based on active sub tab
const renderSubTabContent = () => {
switch (activeSubTab) {
case "homepage":
return <HomepageSettings />;
case "about-page":
return (
<AboutPageSettings
config={platformConfig}
onAboutSave={handleAboutSave}
onImageUpload={uploadImage}
isAboutLoading={isAboutLoading}
/>
);
case "email-admin":
return (
<EmailAndAdminSettings
emailConfig={emailConfig}
adminConfig={adminConfig}
onSaveEmailConfig={handleSaveEmailConfig}
onSaveAdminConfig={handleSaveAdminConfig}
isLoading={emailLoading}
isAdminLoading={adminLoading}
/>
);
case "login-settings":
return (
<LoginSettingsContent
onTabNavigate={onTabNavigate}
loginConfig={loginConfig}
saveLoginConfig={saveLoginConfig}
emailConfig={emailConfig}
/>
);
case "general":
default:
return (
<PlatformConfigForm
config={platformConfig}
onSave={handleSavePlatformConfig}
onThemeChange={handleThemeChange}
isLoading={platformLoading}
/>
);
}
};
return (
<DashboardDemoContent
title={t(subTab?.label || "System Settings")}
description={t(subTab?.description || "Platform basic configuration")}
>
{renderSubTabContent()}
</DashboardDemoContent>
);
};
export default SystemSettingsContent;
@@ -0,0 +1,465 @@
"use client";
import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from "react";
import {
Modal,
ModalContent,
ModalBody,
ModalHeader,
Button,
} from "@nextui-org/react";
import { useSystemConfigManagement } from "@/hooks/useSystemConfigManagement";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
import { Theme } from "@/shared/types/system";
import SystemSettingsSidebar, {
SettingsGroup,
SettingsMenuItem,
} from "./SystemSettingsSidebar";
import {
AppWindow,
Captions,
Code,
CreditCard,
GhostIcon,
GlobeIcon,
LockIcon,
Mail,
Package,
Palette,
SquareMenu,
TableOfContents,
Trello,
XIcon,
} from "lucide-react";
import SystemSettingsRightContent from "./SystemSettingsRightContent";
import { SettingModalTab } from "./console.type";
import { useHomepageConfigManagement } from "@/hooks/useHomepageConfigManagement";
import { FcGoogle } from "react-icons/fc";
import { useTranslation } from "@/shared/lib/useTranslation";
interface SystemSettingsModalProps {
isOpen: boolean;
onClose: () => void;
keyword?: string;
}
const SystemSettingsModal: React.FC<SystemSettingsModalProps> = ({
isOpen,
onClose,
keyword,
}) => {
// Left menu active state
const [activeSubTab, setActiveSubTab] = useState<SettingModalTab>(
SettingModalTab.BRANDING
);
const { t } = useTranslation();
// Search state (pure frontend)
const [searchQuery, setSearchQuery] = useState<string>(keyword || "");
// Scroll container and section refs
const rightContentRef = useRef<HTMLDivElement | null>(null);
const sectionRefs = useRef<Record<string, HTMLElement | null>>({});
const titleRefs = useRef<Record<string, HTMLElement | null>>({});
const scrollingByClickRef = useRef(false);
const activeKeyRef = useRef<SettingModalTab>(SettingModalTab.BRANDING);
useEffect(() => {
activeKeyRef.current = activeSubTab;
}, [activeSubTab]);
// Load and manage config once here to avoid duplicate network calls
const { updateClientConfig } = usePlatformConfig();
const {
// platform config
platformConfig,
savePlatformConfig,
// image upload
uploadImage,
// login config
loginConfig,
saveLoginConfig,
// email config
emailConfig,
saveEmailConfig,
emailLoading,
} = useSystemConfigManagement();
const {
homepageConfig,
saveNavigationConfig,
saveEmbeddedHtmlConfig,
saveFaqConfig,
} = useHomepageConfigManagement();
const handleSavePlatformConfig = async (config: { [key: string]: any }) => {
const newConfig = { ...platformConfig, ...config };
const result = await savePlatformConfig(newConfig);
if (!result) return false;
updateClientConfig({ platform: newConfig });
return result;
};
const handleThemeChange = async (theme: Theme) => {
const updatedConfig = { ...platformConfig, theme };
const result = await savePlatformConfig(updatedConfig, "theme");
if (!result) return;
updateClientConfig({ platform: updatedConfig });
};
const settingsMenuItems: SettingsMenuItem[] = [
// General settings
{
key: SettingModalTab.BRANDING,
label: "Branding",
icon: <Trello size={16} />,
description: "Logo, colors, and brand identity",
},
{
key: SettingModalTab.TITLE_DESCRIPTION,
label: "Title & description",
icon: <Captions size={16} />,
description: "Configure your site title and description",
},
{
key: SettingModalTab.META_DATA,
label: "Meta data",
icon: <AppWindow size={16} />,
description: "Extra content for search engines and social accounts",
},
{
key: SettingModalTab.CUSTOM_DOMAIN,
label: "Domain",
icon: <GhostIcon size={16} />,
description: "Configure your custom domain settings",
},
{
key: SettingModalTab.PLATFORM_LANGUAGE,
label: "Platform Language",
icon: <GlobeIcon size={16} />,
description: "Configure platform language",
},
// Site
{
key: SettingModalTab.THEME,
label: "Theme",
icon: <Palette size={16} />,
description: "Visual theme and appearance settings",
},
{
key: SettingModalTab.NAVIGATION,
label: "Navigation",
icon: <SquareMenu size={16} />,
description: "Configure site navigation and menus",
},
{
key: SettingModalTab.FAQ,
label: "FAQ",
icon: <TableOfContents size={16} />,
description: "Configure FAQ",
},
// Business
{
key: SettingModalTab.PAYMENT,
label: "Payment",
icon: <CreditCard size={16} />,
description: "Configure payment channels",
},
{
key: SettingModalTab.XPACK_EXPLORE,
label: "XPack Explore",
icon: <Package size={16} />,
description: "Explore XPack features and integrations",
},
// Advanced
{
key: SettingModalTab.SMTP_SETTINGS,
label: "Email Configuration",
icon: <Mail size={16} />,
description: "Configure SMTP settings for email notifications",
},
{
key: SettingModalTab.EMAIL_LOGIN_SETTINGS,
label: "Email Login Settings",
icon: <LockIcon size={16} />,
description: "Configure email-based authentication",
},
{
key: SettingModalTab.GOOGLE_LOGIN_SETTINGS,
label: "Google Login Settings",
icon: <FcGoogle size={16} />,
description: "Configure Google OAuth integration",
},
{
key: SettingModalTab.CODE_INJECTION,
label: "Code injection",
icon: <Code size={16} />,
description: "Custom code injection and scripts",
},
// Account
{
key: SettingModalTab.CHANGE_PASSWORD,
label: "Password",
icon: <LockIcon size={16} />,
description: "Change your password",
},
];
// Hierarchical groups for the sidebar
const settingsGroups: SettingsGroup[] = useMemo(() => {
const mapByKey = Object.fromEntries(
settingsMenuItems.map((it) => [it.key, it])
);
const groupItems = (keys: SettingModalTab[]) =>
keys.map((k) => mapByKey[k]).filter(Boolean) as SettingsMenuItem[];
return [
{
key: "general-settings",
title: "General settings",
items: groupItems([
SettingModalTab.BRANDING,
SettingModalTab.TITLE_DESCRIPTION,
SettingModalTab.META_DATA,
SettingModalTab.CUSTOM_DOMAIN,
SettingModalTab.PLATFORM_LANGUAGE,
]),
},
{
key: "site",
title: "Site",
items: groupItems([
SettingModalTab.THEME,
SettingModalTab.NAVIGATION,
SettingModalTab.FAQ,
]),
},
{
key: "business",
title: "Business",
items: groupItems([
SettingModalTab.PAYMENT,
SettingModalTab.XPACK_EXPLORE,
]),
},
{
key: "advanced",
title: "Advanced",
items: groupItems([
SettingModalTab.SMTP_SETTINGS,
SettingModalTab.EMAIL_LOGIN_SETTINGS,
SettingModalTab.GOOGLE_LOGIN_SETTINGS,
SettingModalTab.CODE_INJECTION,
]),
},
{
key: "account",
title: "Account",
items: groupItems([SettingModalTab.CHANGE_PASSWORD]),
},
];
}, []);
// Filter keys by search (pure frontend)
const filteredKeys = useMemo(() => {
const q = searchQuery.trim().toLowerCase();
if (!q) return settingsMenuItems.map((it) => it.key);
return settingsMenuItems
.filter(
(it) =>
t(it.label).toLowerCase().includes(q) ||
t(it.description || "")
?.toLowerCase()
.includes(q)
)
.map((it) => it.key);
}, [searchQuery]);
// Optimized scroll to section function
const scrollToSection = useCallback((key: SettingModalTab) => {
const container = rightContentRef.current;
const el = titleRefs.current[key];
if (!container || !el) return;
// Prevent multiple rapid calls
if (scrollingByClickRef.current) return;
const containerRect = container.getBoundingClientRect();
const elRect = el.getBoundingClientRect();
// scroll so that the title is aligned near the top of the container viewport
const TOP_OFFSET = 16; // small padding
const offset =
elRect.top - containerRect.top + container.scrollTop - TOP_OFFSET;
scrollingByClickRef.current = true;
setActiveSubTab(key);
// Use CSS-based scroll with better performance
const prevBehavior = container.style.scrollBehavior;
container.style.scrollBehavior = "smooth";
container.scrollTo({ top: Math.max(0, offset) });
// Reset scroll behavior and stop suppressing after animation completes
window.setTimeout(() => {
if (container) {
container.style.scrollBehavior = prevBehavior || "auto";
}
scrollingByClickRef.current = false;
}, 400);
}, []);
// Scroll-based scrollspy using rAF to avoid IO jitter
useEffect(() => {
const container = rightContentRef.current;
if (!container || !isOpen) return;
let ticking = false;
const computeActive = () => {
if (!container) return;
const keys = filteredKeys;
const rect = container.getBoundingClientRect();
const containerTop = rect.top;
const TOP_OFFSET = 16;
const scrollTop = container.scrollTop;
const scrollHeight = container.scrollHeight;
const containerHeight = container.clientHeight;
// Bottom stickiness
if (scrollTop + containerHeight >= scrollHeight - 2) {
const lastKey = keys[keys.length - 1];
if (lastKey && activeKeyRef.current !== lastKey) {
setActiveSubTab(lastKey);
}
return;
}
// Determine the last section whose title top is above the top + offset
let currentKey: SettingModalTab | null = null;
for (const k of keys) {
const el = titleRefs.current[k];
if (!el) continue;
const r = el.getBoundingClientRect();
if (r.top - containerTop <= TOP_OFFSET + 1) {
currentKey = k;
} else {
break;
}
}
if (!currentKey) {
const firstKey = keys[0];
if (firstKey && activeKeyRef.current !== firstKey) {
setActiveSubTab(firstKey);
}
return;
}
if (currentKey && activeKeyRef.current !== currentKey) {
setActiveSubTab(currentKey);
}
};
const onScroll = () => {
if (scrollingByClickRef.current) return;
if (!ticking) {
ticking = true;
requestAnimationFrame(() => {
computeActive();
ticking = false;
});
}
};
// Initial compute and bind listeners
computeActive();
container.addEventListener("scroll", onScroll, { passive: true });
return () => {
container.removeEventListener("scroll", onScroll);
};
}, [isOpen, filteredKeys]);
// When searching, auto-jump to first matched section
useEffect(() => {
if (!searchQuery.trim()) return;
if (filteredKeys.length > 0) {
const firstKey = filteredKeys[0];
if (firstKey !== activeSubTab) {
scrollToSection(firstKey);
}
}
}, [searchQuery]); // Only depend on searchQuery, not filteredKeys
return (
<Modal
isOpen={isOpen}
onClose={onClose}
size="full"
classNames={{
base: "h-screen !max-w-none !w-screen p-0",
body: "flex-1 overflow-hidden",
}}
isDismissable={false}
hideCloseButton={true}
>
<ModalContent>
<ModalHeader className="flex justify-between border-b border-default">
<h2 className="text-2xl font-bold">{t("System Settings")}</h2>
<Button onPress={onClose} isIconOnly size="sm" variant="light">
<XIcon size={24} className="text-gray-500" />
</Button>
</ModalHeader>
<ModalBody className="p-0">
<div className="flex h-full">
{/* Left Navigation */}
<SystemSettingsSidebar
activeKey={activeSubTab}
onSelect={scrollToSection}
searchQuery={searchQuery}
onSearchChange={setSearchQuery}
groups={settingsGroups}
filteredKeys={filteredKeys}
/>
{/* Right Content: stacked sections with anchors */}
<div className="flex-1">
<SystemSettingsRightContent
filteredKeys={filteredKeys}
settingsMenuItems={settingsMenuItems}
platformConfig={platformConfig}
homepageConfig={homepageConfig}
onSaveEmbeddedHtml={saveEmbeddedHtmlConfig}
sectionRefs={sectionRefs}
titleRefs={titleRefs}
onSavePlatformConfig={handleSavePlatformConfig}
handleThemeChange={handleThemeChange}
uploadImage={uploadImage}
scrollContainerRef={rightContentRef}
saveNavigationConfig={saveNavigationConfig}
saveFaqConfig={saveFaqConfig}
saveLoginConfig={saveLoginConfig}
emailConfig={emailConfig}
loginConfig={loginConfig}
onSaveEmailConfig={saveEmailConfig}
emailSubmitLoading={emailLoading}
/>
</div>
</div>
</ModalBody>
</ModalContent>
</Modal>
);
};
export default SystemSettingsModal;
@@ -0,0 +1,243 @@
"use client";
import React, { useMemo } from "react";
import { useTranslation } from "@/shared/lib/useTranslation";
import {
EmbeddedHtmlConfig,
FaqItem,
LoginConfig,
PlatformConfig,
Theme,
TopNavigationItem,
} from "@/shared/types/system";
import { SettingsMenuItem } from "./SystemSettingsSidebar";
import TitleAndDescPanel, {
TitleAndDescPanelConfig,
} from "./system-setting/TitleAndDescPanel";
import MetaDataPanel from "./system-setting/MetaDataPanel";
import BrandPanel, { BrandPanelConfig } from "./system-setting/BrandPanel";
import { ThemeSelector } from "@/components/system-setting/ThemeSelector";
import { TopNavigationSettings } from "@/components/system-setting/TopNavigationSettings";
import { EmbeddedHtmlSettings } from "@/components/system-setting/EmbeddedHtmlSettings";
import { ExplorePanel } from "./system-setting/ExplorePanel";
import DomainPanel from "./system-setting/DomainPanel";
import PaymentChannelsContent from "@/components/console/PaymentChannelsContent";
import { HomepageConfig } from "@/services/homepageConfigService";
import { FaqSettings } from "@/components/system-setting/FaqSettings";
import { AdminConfigForm } from "./AdminConfigForm";
import { systemConfigService } from "@/services/systemConfigService";
import { md5Encrypt } from "@/shared/utils/crypto";
import { AdminConfig, EmailConfig } from "@/types/system";
import { LoginSettingsContent } from "./LoginSettingsContent";
import { EmailConfigForm } from "@/components/system-setting/EmailConfigForm";
import { LanguageSetting } from "@/components/system-setting/LanguageSetting";
interface SystemSettingsRightContentProps {
filteredKeys: string[];
settingsMenuItems: SettingsMenuItem[];
platformConfig: PlatformConfig;
homepageConfig: HomepageConfig;
sectionRefs: React.MutableRefObject<Record<string, HTMLElement | null>>;
titleRefs: React.MutableRefObject<Record<string, HTMLElement | null>>; // New: refs for section titles
onSavePlatformConfig: (config: { [key: string]: any }) => Promise<boolean>;
onSaveEmbeddedHtml: (config: EmbeddedHtmlConfig) => Promise<boolean>;
handleThemeChange: (theme: Theme) => Promise<void>;
uploadImage: any;
scrollContainerRef?: React.RefObject<HTMLDivElement>;
saveNavigationConfig: (config: TopNavigationItem[]) => Promise<boolean>;
saveFaqConfig: (config: FaqItem[]) => Promise<boolean>;
saveLoginConfig: (config: LoginConfig) => Promise<boolean>;
emailConfig: EmailConfig;
loginConfig: LoginConfig;
onSaveEmailConfig: (config: EmailConfig) => Promise<boolean>;
emailSubmitLoading: boolean;
}
const SystemSettingsRightContent: React.FC<SystemSettingsRightContentProps> = ({
filteredKeys,
settingsMenuItems,
platformConfig,
homepageConfig,
onSaveEmbeddedHtml,
sectionRefs,
titleRefs, // New prop
onSavePlatformConfig,
handleThemeChange,
uploadImage,
scrollContainerRef,
saveNavigationConfig,
saveFaqConfig,
saveLoginConfig,
emailConfig,
loginConfig,
onSaveEmailConfig,
emailSubmitLoading,
}) => {
const { t } = useTranslation();
const menuItems = useMemo(() => {
return settingsMenuItems.filter((it) => filteredKeys.includes(it.key));
}, [settingsMenuItems, filteredKeys]);
const handleChangePassword = async (config: AdminConfig) => {
const result = await systemConfigService.updateSystemConfig(
{
account: {
...config,
password: md5Encrypt(config.password),
},
},
"password"
);
return result;
};
return (
<div
ref={scrollContainerRef}
className="flex-1 overflow-y-auto h-full pb-40 space-y-6"
style={{ scrollBehavior: "auto" }}
>
<div className="h-0" aria-hidden="true"></div>
{menuItems.map((section) => (
<>
<section
key={section.key}
ref={(el) => {
if (el) sectionRefs.current[section.key] = el;
}}
id={`section-${section.key}`}
className="px-6 py-6 scroll-mt-16 border-1 rounded-lg shadow-md max-w-2xl mx-auto"
>
<div className="mb-4">
<h2
className="text-xl font-semibold"
ref={(el) => {
if (el) titleRefs.current[section.key] = el;
}}
id={`title-${section.key}`}
>
{t(section.label)}
</h2>
<p className="text-sm text-default-500">
{t(section.description || "")}
</p>
</div>
{/* Content sections */}
{section.key === "title-description" && (
<TitleAndDescPanel
config={platformConfig as TitleAndDescPanelConfig}
onSave={onSavePlatformConfig}
/>
)}
{section.key === "meta-data" && (
<MetaDataPanel
metaData={platformConfig}
onSave={onSavePlatformConfig}
uploadImage={uploadImage}
platformConfig={platformConfig}
/>
)}
{section.key === "custom-domain" && (
<div className="space-y-4">
<DomainPanel
config={platformConfig}
onSave={onSavePlatformConfig}
/>
</div>
)}
{section.key === "platform-language" && (
<LanguageSetting
config={platformConfig}
onSave={onSavePlatformConfig}
/>
)}
{section.key === "branding" && (
<BrandPanel
config={platformConfig as BrandPanelConfig}
onSave={onSavePlatformConfig}
onUploadImage={uploadImage}
/>
)}
{section.key === "theme" && (
<ThemeSelector
value={platformConfig.theme || Theme.DEFAULT}
onChange={handleThemeChange}
/>
)}
{section.key === "smtp-settings" && (
<EmailConfigForm
config={emailConfig}
onSave={onSaveEmailConfig}
isLoading={emailSubmitLoading}
/>
)}
{section.key === "email-login-settings" && (
<LoginSettingsContent
loginConfig={loginConfig}
saveLoginConfig={saveLoginConfig}
emailConfig={emailConfig}
type="email"
/>
)}
{section.key === "google-login-settings" && (
<LoginSettingsContent
loginConfig={loginConfig}
saveLoginConfig={saveLoginConfig}
emailConfig={emailConfig}
type="google"
/>
)}
{section.key === "navigation" && (
<TopNavigationSettings
onSave={saveNavigationConfig}
config={homepageConfig.top_navigation}
labelPlacement="outside"
/>
)}
{section.key === "faq" && (
<FaqSettings
onSave={saveFaqConfig}
config={homepageConfig.faq}
labelPlacement="outside"
/>
)}
{section.key === "payment" && (
<PaymentChannelsContent labelPlacement="outside" />
)}
{section.key === "xpack-explore" && (
<ExplorePanel
isEnabled={!!platformConfig.is_showcased}
onSave={onSavePlatformConfig}
/>
)}
{section.key === "code-injection" && (
<EmbeddedHtmlSettings
onSave={onSaveEmbeddedHtml}
config={homepageConfig.embeded_html}
labelPlacement="outside"
/>
)}
{section.key === "change-password" && (
<AdminConfigForm onSave={handleChangePassword} />
)}
</section>
</>
))}
{/* Bottom spacer to allow last sections to scroll higher into view for better selection */}
<div className="h-40" aria-hidden="true" />
</div>
);
};
export default SystemSettingsRightContent;
@@ -0,0 +1,157 @@
"use client";
import React, { useMemo, useRef, useEffect } from "react";
import { Input, Button, ScrollShadow } from "@nextui-org/react";
import { Search } from "lucide-react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { SettingModalTab } from "./console.type";
export interface SettingsMenuItem {
key: SettingModalTab;
label: string;
description?: string;
icon?: React.ReactNode;
}
export interface SettingsGroup {
key: string;
title: string;
items: SettingsMenuItem[];
}
interface Props {
activeKey: SettingModalTab;
onSelect: (key: SettingModalTab) => void;
searchQuery: string;
onSearchChange: (val: string) => void;
groups: SettingsGroup[];
filteredKeys: SettingModalTab[]; // which item keys match the current search
}
const SystemSettingsSidebar: React.FC<Props> = ({
activeKey,
onSelect,
searchQuery,
onSearchChange,
groups,
filteredKeys,
}) => {
const { t } = useTranslation();
const sidebarScrollRef = useRef<HTMLDivElement | null>(null);
const activeItemRefs = useRef<Record<string, HTMLButtonElement | null>>({});
// filter groups based on filteredKeys
const visibleGroups = useMemo(() => {
const keySet = new Set(filteredKeys);
return groups
.map((g) => ({
...g,
items: g.items.filter((it) => keySet.has(it.key)),
}))
.filter((g) => g.items.length > 0);
}, [groups, filteredKeys]);
const hasResults = visibleGroups.length > 0;
// Auto-scroll to active item when activeKey changes
useEffect(() => {
const activeElement = activeItemRefs.current[activeKey];
const scrollContainer = sidebarScrollRef.current;
if (activeElement && scrollContainer) {
// Get the scroll container element (ScrollShadow wraps content)
const scrollElement =
(scrollContainer.querySelector(
'[data-scrollable="true"]'
) as HTMLElement) || scrollContainer;
const containerRect = scrollElement.getBoundingClientRect();
const elementRect = activeElement.getBoundingClientRect();
// Check if element is visible in container
const isElementVisible =
elementRect.top >= containerRect.top &&
elementRect.bottom <= containerRect.bottom;
if (!isElementVisible) {
// Calculate scroll position to center the active item
const containerHeight = containerRect.height;
const elementTop = activeElement.offsetTop;
const elementHeight = activeElement.offsetHeight;
const scrollTop = elementTop - containerHeight / 2 + elementHeight / 2;
scrollElement.scrollTo({
top: Math.max(0, scrollTop),
behavior: "smooth",
});
}
}
}, [activeKey]);
return (
<ScrollShadow
ref={sidebarScrollRef}
className="w-[300px] border-r border-divider bg-content1/50 scrollbar-thin"
>
<div className="p-4 space-y-4">
<Input
size="sm"
aria-label={t("Search settings")}
placeholder={t("Search settings")}
value={searchQuery}
onValueChange={onSearchChange}
startContent={<Search size={16} className="text-default-400" />}
isClearable
onClear={() => onSearchChange("")}
/>
{!hasResults ? (
<div className="text-xs text-default-400 px-1 py-2">
{t("No results")}
</div>
) : (
<nav className="space-y-6">
{visibleGroups.map((group) => (
<div key={group.key} className="space-y-1">
<div className="px-2 text-[11px] tracking-wide text-default-400">
{t(group.title)}
</div>
<div className="flex flex-col gap-2">
{group.items.map((item) => {
const isActive = activeKey === item.key;
return (
<Button
key={item.key}
ref={(el) => {
if (el) activeItemRefs.current[item.key] = el;
}}
variant={isActive ? "flat" : "light"}
color={isActive ? "primary" : "default"}
size="sm"
className={`w-full border-1 justify-start h-auto py-3 px-3 text-left rounded-md ${
isActive
? "bg-primary/10 border-primary/20"
: "hover:bg-default-100 border-transparent"
}`}
onPress={() => onSelect(item.key)}
startContent={item.icon}
>
<div className="flex flex-col items-start w-full">
<div className="font-medium text-sm">
{t(item.label)}
</div>
</div>
</Button>
);
})}
</div>
</div>
))}
</nav>
)}
</div>
</ScrollShadow>
);
};
export default SystemSettingsSidebar;
@@ -0,0 +1,17 @@
export enum SettingModalTab {
TITLE_DESCRIPTION = "title-description",
META_DATA = "meta-data",
CUSTOM_DOMAIN = "custom-domain",
BRANDING = "branding",
THEME = "theme",
PAYMENT = "payment",
CODE_INJECTION = "code-injection",
XPACK_EXPLORE = "xpack-explore",
NAVIGATION = "navigation",
FAQ = "faq",
CHANGE_PASSWORD = "change-password",
EMAIL_LOGIN_SETTINGS = "email-login-settings",
GOOGLE_LOGIN_SETTINGS = "google-login-settings",
SMTP_SETTINGS = "smtp-settings",
PLATFORM_LANGUAGE = "platform-language",
}
@@ -0,0 +1,61 @@
"use client";
import React, { useState } from "react";
import { Input, Card, CardBody } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
interface CustomDomainPanelProps {
domain: string;
setDomain: (domain: string) => void;
}
const CustomDomainPanel: React.FC<CustomDomainPanelProps> = ({
domain,
setDomain,
}) => {
const { t } = useTranslation();
const [validationError, setValidationError] = useState<string | undefined>();
// Validate domain URL
const validateDomain = (value: string): string | undefined => {
if (!value.trim()) {
return undefined; // Domain is optional
}
// Basic domain format validation ,like www.example.com
const domainRegex =
/(?=.{1,255}$)(?:(?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,}/;
if (!domainRegex.test(value)) {
return t("Please enter a valid domain");
}
return undefined;
};
const handleBlur = () => {
const error = validateDomain(domain);
setValidationError(error);
};
return (
<Card shadow="none">
<CardBody className="flex flex-col p-0">
<h3 className="font-semibold mb-2">
{"1. "}
{t("Enter the domain you want to use")}
</h3>
<Input
label={t("Domain")}
placeholder={t("Enter your full domain name (e.g., www.example.com)")}
value={domain}
onChange={(e) => setDomain(e.target.value)}
onBlur={handleBlur}
isInvalid={!!validationError}
errorMessage={validationError}
/>
</CardBody>
</Card>
);
};
export default CustomDomainPanel;
@@ -0,0 +1,66 @@
"use client";
import React from "react";
import {
Card,
CardBody,
Table,
TableHeader,
TableColumn,
TableBody,
TableRow,
TableCell,
} from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
interface DNSRecordsPanelProps {
cnameTarget: string; // e.g., subdomain.domainhost.com
apexATarget?: string; // optional A record IP for apex
}
type DnsRow = { key: string; type: string; host: string; value: string };
const DNSRecordsPanel: React.FC<DNSRecordsPanelProps> = ({
cnameTarget,
apexATarget,
}) => {
const { t } = useTranslation();
const rows: DnsRow[] = [
...(cnameTarget
? [{ key: "cname", type: "CNAME", host: "www", value: cnameTarget }]
: []),
...(apexATarget
? [{ key: "a-record", type: "A", host: "@", value: apexATarget }]
: []),
];
return (
<Card shadow="none">
<CardBody className="p-0 flex flex-col gap-2">
<h3 className="font-semibold mb-2">
{"2. "}
{t("Create your DNS records")}
</h3>
<Table aria-label={t("DNS Records Table")} shadow="none" removeWrapper>
<TableHeader>
<TableColumn>{t("Type")}</TableColumn>
<TableColumn>{t("Host")}</TableColumn>
<TableColumn>{t("Value")}</TableColumn>
</TableHeader>
<TableBody items={rows}>
{(item) => (
<TableRow key={item.key}>
<TableCell>{item.type}</TableCell>
<TableCell>{item.host}</TableCell>
<TableCell>{item.value}</TableCell>
</TableRow>
)}
</TableBody>
</Table>
</CardBody>
</Card>
);
};
export default DNSRecordsPanel;
@@ -0,0 +1,86 @@
"use client";
import React, { useState } from "react";
import {
Button,
Modal,
ModalContent,
ModalBody,
ModalHeader,
Card,
CardBody,
} from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import CustomDomainPanel from "./CustomDomainPanel";
import DNSRecordsPanel from "./DNSRecordsPanel";
export type DomainActivationPanelConfig = {
domain?: string;
subdomain?: string;
cname_a_ip?: string;
};
interface DomainActivationPanelProps {
config: DomainActivationPanelConfig;
onSave: (config: DomainActivationPanelConfig) => void;
isOpen: boolean;
onClose: () => void;
}
const DomainActivationPanel: React.FC<DomainActivationPanelProps> = ({
config,
onSave,
isOpen,
onClose,
}) => {
const { t } = useTranslation();
const [isLoading, setIsLoading] = useState(false);
const [domain, setDomain] = useState(config.domain || "");
const handleActivate = async () => {
setIsLoading(true);
try {
await onSave({
domain,
});
onClose();
} finally {
setIsLoading(false);
}
};
return (
<>
<Modal isOpen={isOpen} onClose={onClose} size="xl">
<ModalContent>
<ModalHeader>{t("Set Custom Domain")}</ModalHeader>
<ModalBody className="flex flex-col gap-4">
<CustomDomainPanel domain={domain} setDomain={setDomain} />
<DNSRecordsPanel
cnameTarget={`${config.subdomain || ""}${process.env.NEXT_PUBLIC_DOMAIN_HOST || ""}`}
apexATarget={config.cname_a_ip}
/>
<Card shadow="none">
<CardBody className="p-0 flex flex-col gap-2 pb-4">
<h3 className="font-semibold mb-2">
{"3. "}
{t("Activate your domain")}
</h3>
<Button
color="primary"
isDisabled={!domain}
isLoading={isLoading}
onPress={handleActivate}
size="sm"
>
{t("Activate")}
</Button>
</CardBody>
</Card>
</ModalBody>
</ModalContent>
</Modal>
</>
);
};
export default DomainActivationPanel;
@@ -0,0 +1,108 @@
"use client";
import React, { useEffect } from "react";
import { Input, Button } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { z } from "zod";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import UploadImage from "@/components/common/UploadImage";
export type BrandPanelConfig = {
logo: string;
name: string;
};
const brandPanelSchema = z.object({
logo: z.string(),
name: z.string().min(1, "Name is required"),
});
interface BrandPanelProps {
config: BrandPanelConfig;
onSave: (config: BrandPanelConfig) => Promise<boolean>;
onUploadImage: (file: File, sha256?: string) => Promise<string>;
}
const BrandPanel: React.FC<BrandPanelProps> = ({
config,
onSave,
onUploadImage,
}) => {
const { t } = useTranslation();
const {
handleSubmit,
control,
setValue,
formState: { errors, isSubmitting, isValid },
} = useForm<BrandPanelConfig>({
resolver: zodResolver(brandPanelSchema),
mode: "onBlur",
defaultValues: config,
});
useEffect(() => {
setValue("name", config.name);
setValue("logo", config.logo);
}, [config]);
return (
<div className="space-y-4">
<div className="flex flex-col gap-4">
<form onSubmit={handleSubmit(onSave)} className="flex flex-col gap-4">
<Controller
name="name"
control={control}
render={({ field }) => (
<>
<Input
{...field}
label={t("Your brand")}
placeholder={t("Enter your brand name")}
isInvalid={!!errors.name}
errorMessage={errors.name?.message}
labelPlacement="outside"
isRequired
/>
</>
)}
/>
<Controller
name="logo"
control={control}
render={({ field }) => (
<div className="flex flex-col gap-2">
<div>
<label className="text-sm font-medium text-foreground">
{t("Logo")}
</label>
<p className="text-xs text-gray-500">
{t("Support JPG, PNG, GIF, SVG. Max size 5MB")}
</p>
</div>
<UploadImage
onSave={onUploadImage}
setImageUrl={(imageUrl) => field.onChange(imageUrl)}
imageUrl={field.value}
/>
</div>
)}
/>
<Button
color="primary"
variant="solid"
type="submit"
isLoading={isSubmitting}
size="sm"
isDisabled={!isValid}
className="mt-2 w-fit"
>
{t("Save")}
</Button>
</form>
</div>
</div>
);
};
export default BrandPanel;
@@ -0,0 +1,70 @@
"use client";
import React, { useState, useEffect } from "react";
import { Button } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { EditIcon } from "lucide-react";
import DomainActivationPanel from "../custom-domain/DomainActivationPanel";
export type DomainPanelConfig = {
subdomain?: string;
domain?: string;
cname_a_ip?: string;
};
interface DomainPanelProps {
config: DomainPanelConfig;
onSave: (config: DomainPanelConfig) => Promise<boolean>;
}
const DomainPanel: React.FC<DomainPanelProps> = ({ config, onSave }) => {
const { t } = useTranslation();
const [formData, setFormData] = useState<DomainPanelConfig>(config);
const [showCustomDomainModal, setShowCustomDomainModal] = useState(false);
// when context config updated, sync to form
useEffect(() => {
setFormData(config);
}, [config]);
const handleCustomDomainSave = async (config: DomainPanelConfig) => {
const result = await onSave(config);
if (!result) return;
};
return (
<>
<div className="flex flex-col gap-4">
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">{t("Custom Domain")}</span>
<span className="text-xs text-gray-500">
{formData.domain || t("Set your custom domain for the platform")}
</span>
</div>
<Button
size="sm"
onPress={() => setShowCustomDomainModal(true)}
isIconOnly
startContent={<EditIcon size={16} />}
variant="flat"
></Button>
</div>
</div>
{showCustomDomainModal && (
<DomainActivationPanel
config={{
subdomain: formData.subdomain,
domain: formData.domain,
cname_a_ip: config.cname_a_ip,
}}
onSave={handleCustomDomainSave}
isOpen={showCustomDomainModal}
onClose={() => setShowCustomDomainModal(false)}
/>
)}
</>
);
};
export default DomainPanel;
@@ -0,0 +1,51 @@
"use client";
import React from "react";
import { Switch } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
export type ExplorePanelConfig = {
is_showcased: boolean;
};
interface ExplorePanelProps {
isEnabled: boolean;
onSave: (config: ExplorePanelConfig) => void;
}
export const ExplorePanel: React.FC<ExplorePanelProps> = ({
isEnabled,
onSave,
}) => {
const { t } = useTranslation();
return (
<div className="space-y-4">
<div className="flex flex-col gap-4">
{/* showcase in xpack */}
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">
{t("Featured in the XPack showcase")}
</span>
<span className="text-xs text-gray-500">
{t(
"Enable this option to feature your site in the XPack global showcase and reach users worldwide."
)}
</span>
</div>
<Switch
isSelected={isEnabled}
onValueChange={(value) => {
onSave({
is_showcased: value,
});
}}
color="primary"
size="sm"
/>
</div>
</div>
</div>
);
};
@@ -0,0 +1,159 @@
"use client";
import React, { useEffect } from "react";
import { Button, Card, CardBody, Input } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import UploadImage from "@/components/common/UploadImage";
import { z } from "zod";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { PlatformConfig } from "@/shared/types/system";
import { FaFacebook } from "react-icons/fa6";
export interface FacebookMetaData {
facebook_title: string;
facebook_description: string;
facebook_image_url?: string;
}
const formSchema = z.object({
facebook_title: z
.string()
.max(200, "Title is too long")
.optional()
.default(""),
facebook_description: z
.string()
.max(1000, "Description is too long")
.optional()
.default(""),
facebook_image_url: z.string().optional().or(z.literal("")).default(""),
});
type FormData = z.infer<typeof formSchema>;
interface MetaDataFacebookFormProps {
metaData: FacebookMetaData;
onSave: (metaData: FacebookMetaData) => Promise<boolean>;
onUploadImage: (file: File, sha256?: string) => Promise<string>;
platformConfig: PlatformConfig;
}
const MetaDataFacebookForm: React.FC<MetaDataFacebookFormProps> = ({
metaData,
onSave,
onUploadImage,
platformConfig,
}) => {
const { t } = useTranslation();
const {
control,
handleSubmit,
setValue,
formState: { errors, isSubmitting, isValid },
} = useForm<FormData>({
resolver: zodResolver(formSchema),
mode: "onBlur",
defaultValues: metaData,
});
useEffect(() => {
if (!metaData) return;
setValue("facebook_title", metaData.facebook_title || "");
setValue("facebook_description", metaData.facebook_description || "");
setValue("facebook_image_url", metaData.facebook_image_url || "");
}, [metaData, setValue]);
const onSubmit = async (data: FormData) => {
await onSave(data);
};
return (
<>
<div className="max-w-2xl">
<div className="mb-2">
<div className="flex items-center gap-2">
<FaFacebook className="text-primary" size={40} />
<div className="flex flex-col">
<span className="font-semibold text-default-900">
{platformConfig.name}
</span>
<span className="text-default-400 text-xs">2h</span>
</div>
</div>
</div>
<div className="mb-2 h-3 w-full rounded-large bg-default-100"></div>
<div className="mb-4 h-3 w-3/5 rounded-large bg-default-100"></div>
</div>
<Card shadow="none" className="border-1 max-w-2xl">
<CardBody className="px-0 py-4">
<form
onSubmit={handleSubmit(onSubmit)}
className="flex flex-col gap-4 px-4"
>
<Controller
name="facebook_image_url"
control={control}
render={({ field }) => (
<UploadImage
onSave={onUploadImage}
imageUrl={field.value}
setImageUrl={(imageUrl) => {
field.onChange(imageUrl);
}}
className="h-[280px] w-full bg-default-100"
description={t("Upload Facebook Image")}
/>
)}
/>
<Controller
name="facebook_title"
control={control}
render={({ field }) => (
<Input
{...field}
label={t("Facebook Title")}
placeholder={platformConfig.headline || " "}
isInvalid={!!errors.facebook_title}
errorMessage={errors.facebook_title?.message}
labelPlacement="outside"
/>
)}
/>
<Controller
name="facebook_description"
control={control}
render={({ field }) => (
<Input
{...field}
label={t("Facebook Description")}
placeholder={platformConfig.subheadline || " "}
isInvalid={!!errors.facebook_description}
errorMessage={errors.facebook_description?.message}
labelPlacement="outside"
/>
)}
/>
<div className="flex justify-start mt-2">
<Button
type="submit"
color="primary"
size="sm"
className="w-fit"
isLoading={isSubmitting}
isDisabled={!isValid}
>
{t("Save")}
</Button>
</div>
</form>
</CardBody>
</Card>
</>
);
};
export default MetaDataFacebookForm;
@@ -0,0 +1,82 @@
"use client";
import React, { useEffect } from "react";
import { Tabs, Tab } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import MetaDataFacebookForm from "./MetaDataFacebookForm";
import MetaDataXForm from "./MetaDataXForm";
import MetaDataSearchForm from "./MetaDataSearchForm";
import { FacebookMetaData } from "./MetaDataFacebookForm";
import { SearchMetaData } from "./MetaDataSearchForm";
import { XMetaData } from "./MetaDataXForm";
import { PlatformConfig } from "@/shared/types/system";
interface MetaData {
website_title?: string;
meta_description?: string;
x_title?: string;
x_description?: string;
x_image_url?: string;
facebook_title?: string;
facebook_description?: string;
facebook_image_url?: string;
}
interface MetaDataPanelProps {
metaData: MetaData;
onSave: (metaData: MetaData) => Promise<boolean>;
uploadImage: (file: File, sha256?: string) => Promise<string>;
platformConfig: PlatformConfig;
}
const MetaDataPanel: React.FC<MetaDataPanelProps> = ({
metaData,
onSave,
uploadImage,
platformConfig,
}) => {
const { t } = useTranslation();
const handleSave = async (data: MetaData) => {
return await onSave({
...metaData,
...data,
});
};
return (
<Tabs
aria-label="Meta data options"
variant="solid"
className="w-full"
destroyInactiveTabPanel={false}
>
<Tab key="search" title={t("Search")} className="pb-0">
<MetaDataSearchForm
metaData={metaData as SearchMetaData}
onSave={handleSave}
platformConfig={platformConfig}
/>
</Tab>
<Tab key="x" title={t("X Card")} className="pb-0">
<MetaDataXForm
metaData={metaData as XMetaData}
onSave={handleSave}
onUploadImage={uploadImage}
platformConfig={platformConfig}
/>
</Tab>
<Tab key="facebook" title={t("Facebook Card")} className="pb-0">
<MetaDataFacebookForm
metaData={metaData as FacebookMetaData}
onSave={handleSave}
onUploadImage={uploadImage}
platformConfig={platformConfig}
/>
</Tab>
</Tabs>
);
};
export default MetaDataPanel;
@@ -0,0 +1,215 @@
"use client";
import React, { useEffect } from "react";
import { Button, Card, CardBody, CardFooter, Input } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { z } from "zod";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { PlatformConfig } from "@/shared/types/system";
export interface SearchMetaData {
website_title: string;
meta_description: string;
}
const formSchema = z.object({
website_title: z.string().max(75, "Title is too long").optional().default(""),
meta_description: z
.string()
.max(156, "Description is too long")
.optional()
.or(z.literal(""))
.default(""),
});
type FormData = z.infer<typeof formSchema>;
interface MetaDataSearchFormProps {
metaData: SearchMetaData;
platformConfig: PlatformConfig;
onSave: (metaData: SearchMetaData) => Promise<boolean>;
}
const MetaDataSearchForm: React.FC<MetaDataSearchFormProps> = ({
metaData,
platformConfig,
onSave,
}) => {
const { t } = useTranslation();
const {
control,
handleSubmit,
setValue,
watch,
formState: { errors, isSubmitting, isValid },
} = useForm<FormData>({
resolver: zodResolver(formSchema),
mode: "onBlur",
defaultValues: metaData,
});
useEffect(() => {
if (!metaData) return;
setValue("meta_description", metaData.meta_description || "");
setValue("website_title", metaData.website_title || "");
}, [metaData, setValue]);
const onSubmit = async (data: FormData) => {
await onSave(data);
};
const metaDescription = watch("meta_description");
const websiteTitle = watch("website_title");
return (
<Card shadow="none" className="border-1 max-w-2xl">
<CardBody className="px-0 py-4">
<form
onSubmit={handleSubmit(onSubmit)}
className="flex flex-col gap-4 px-4"
>
<Controller
name="website_title"
control={control}
render={({ field }) => (
<Input
{...field}
label={t("Meta Title")}
placeholder={platformConfig.headline || " "}
isInvalid={!!errors.website_title}
errorMessage={errors.website_title?.message}
labelPlacement="outside"
defaultValue={t("Recommended: 70 characters")}
/>
)}
/>
<Controller
name="meta_description"
control={control}
render={({ field }) => (
<Input
{...field}
label={t("Meta Description")}
placeholder={platformConfig.subheadline || " "}
isInvalid={!!errors.meta_description}
errorMessage={errors.meta_description?.message}
labelPlacement="outside"
defaultValue={t("Recommended: 156 characters")}
/>
)}
/>
<div className="flex justify-start mt-2">
<Button
type="submit"
color="primary"
size="sm"
className="w-fit"
isLoading={isSubmitting}
isDisabled={!isValid}
>
{t("Save")}
</Button>
</div>
</form>
</CardBody>
<CardFooter className="p-0">
<div className="w-full bg-default-100">
<div className="mt-4 mb-2 text-grey-500 px-5 uppercase text-xs">
{t("Preview")}
</div>
<div className="mx-5 -mb-5 overflow-hidden rounded-b-xl bg-grey-50 pt-2 ">
<div className="rounded-t-lg bg-white px-5 py-3 shadow-lg mb-5">
<div className="mt-3 flex items-center">
<div>
<svg fill="none" viewBox="0 0 92 31" className="mr-7 h-7">
<title>google</title>
<path
d="M39.15 15.898c0 4.303-3.378 7.473-7.525 7.473s-7.526-3.17-7.526-7.473c0-4.334 3.38-7.474 7.526-7.474 4.147 0 7.526 3.14 7.526 7.474zm-3.294 0c0-2.69-1.958-4.529-4.231-4.529-2.273 0-4.231 1.84-4.231 4.529 0 2.662 1.958 4.528 4.231 4.528 2.273 0 4.231-1.87 4.231-4.528z"
fill="#EA4335"
></path>
<path
d="M55.386 15.898c0 4.303-3.379 7.473-7.526 7.473-4.146 0-7.526-3.17-7.526-7.473 0-4.33 3.38-7.474 7.526-7.474 4.147 0 7.526 3.14 7.526 7.474zm-3.294 0c0-2.69-1.959-4.529-4.232-4.529s-4.231 1.84-4.231 4.529c0 2.662 1.958 4.528 4.231 4.528 2.273 0 4.232-1.87 4.232-4.528z"
fill="#FBBC05"
></path>
<path
d="M70.945 8.875v13.418c0 5.52-3.267 7.774-7.13 7.774-3.636 0-5.825-2.423-6.65-4.404l2.868-1.19c.511 1.217 1.763 2.652 3.779 2.652 2.472 0 4.004-1.52 4.004-4.38V21.67h-.115c-.737.906-2.158 1.698-3.95 1.698-3.751 0-7.188-3.255-7.188-7.443 0-4.22 3.437-7.501 7.188-7.501 1.789 0 3.21.792 3.95 1.671h.115V8.88h3.129v-.004zm-2.895 7.05c0-2.632-1.763-4.556-4.005-4.556-2.273 0-4.177 1.924-4.177 4.556 0 2.604 1.904 4.501 4.177 4.501 2.242 0 4.005-1.897 4.005-4.501z"
fill="#4285F4"
></path>
<path
d="M76.103 1.01v21.903H72.89V1.011h3.213z"
fill="#34A853"
></path>
<path
d="M88.624 18.357l2.558 1.699c-.826 1.216-2.815 3.312-6.251 3.312-4.262 0-7.445-3.282-7.445-7.474 0-4.444 3.21-7.473 7.076-7.473 3.893 0 5.798 3.086 6.42 4.754l.341.85-10.028 4.137c.768 1.5 1.962 2.264 3.636 2.264 1.678 0 2.841-.822 3.693-2.069zm-7.87-2.688l6.703-2.774c-.368-.933-1.478-1.583-2.783-1.583-1.674 0-4.005 1.472-3.92 4.357z"
fill="#EA4335"
></path>
<path
d="M11.936 13.953v-3.17h10.726c.105.552.159 1.206.159 1.914 0 2.378-.653 5.32-2.757 7.416-2.046 2.123-4.66 3.255-8.124 3.255-6.42 0-11.818-5.21-11.818-11.605C.122 5.368 5.52.158 11.94.158c3.551 0 6.081 1.389 7.982 3.198l-2.246 2.237c-1.363-1.273-3.21-2.264-5.74-2.264-4.688 0-8.354 3.764-8.354 8.434s3.666 8.434 8.354 8.434c3.041 0 4.773-1.216 5.882-2.322.9-.896 1.492-2.176 1.725-3.925l-7.607.003z"
fill="#4285F4"
></path>
</svg>
</div>
<div className="grow">
<div className="flex w-full items-center justify-end rounded-full bg-white p-3 px-4 shadow dark:bg-grey-900">
<svg
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
stroke-width="1.5"
className="pointer-events-none size-4 stroke-[2px] text-blue-600"
>
<path
d="M0.750 9.812 A9.063 9.063 0 1 0 18.876 9.812 A9.063 9.063 0 1 0 0.750 9.812 Z"
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
transform="translate(-3.056 4.62) rotate(-23.025)"
></path>
<path
d="M16.221 16.22L23.25 23.25"
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
></path>
</svg>
</div>
</div>
</div>
<div className="mt-4 flex items-center gap-2 border-t border-grey-200 pt-4 dark:border-grey-900">
<div
className="flex size-7 items-center justify-center rounded-full bg-grey-200 dark:bg-grey-700"
style={{
backgroundImage: `url("${platformConfig.logo}")`,
backgroundSize: "contain",
}}
></div>
<div className="flex flex-col text-sm">
<span>{platformConfig.domain || window.location.host}</span>
<span className="-mt-0.5 inline-block text-xs text-grey-600">
https://
{platformConfig.domain || window.location.host}
</span>
</div>
</div>
<div className="mt-1 flex flex-col">
<span className="text-lg text-[#1a0dab] dark:text-blue">
{websiteTitle || platformConfig.headline}
</span>
<span className="text-sm text-grey-900 dark:text-grey-700">
{metaDescription || platformConfig.subheadline}
</span>
</div>
</div>
</div>
</div>
</CardFooter>
</Card>
);
};
export default MetaDataSearchForm;
@@ -0,0 +1,160 @@
"use client";
import React, { useEffect } from "react";
import { Button, Card, CardBody, Input } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import UploadImage from "@/components/common/UploadImage";
import { z } from "zod";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { PlatformConfig } from "@/shared/types/system";
import { FaXTwitter } from "react-icons/fa6";
export interface XMetaData {
x_title: string;
x_description: string;
x_image_url?: string;
}
const formSchema = z.object({
x_title: z.string().max(200, "Title is too long").optional().default(""),
x_description: z
.string()
.max(1000, "Description is too long")
.optional()
.or(z.literal(""))
.default(""),
x_image_url: z.string().optional().or(z.literal("")).default(""),
});
type FormData = z.infer<typeof formSchema>;
interface MetaDataXFormProps {
metaData: XMetaData;
onSave: (metaData: XMetaData) => Promise<boolean>;
onUploadImage: (file: File, sha256?: string) => Promise<string>;
platformConfig: PlatformConfig;
}
const MetaDataXForm: React.FC<MetaDataXFormProps> = ({
metaData,
onSave,
onUploadImage,
platformConfig,
}) => {
const { t } = useTranslation();
const {
control,
handleSubmit,
setValue,
formState: { errors, isSubmitting, isValid },
} = useForm<FormData>({
resolver: zodResolver(formSchema),
mode: "onBlur",
defaultValues: metaData,
});
useEffect(() => {
if (!metaData) return;
setValue("x_title", metaData.x_title || "");
setValue("x_description", metaData.x_description || "");
setValue("x_image_url", metaData.x_image_url || "");
}, [metaData, setValue]);
const onSubmit = async (data: FormData) => {
await onSave(data);
};
return (
<>
<div className="flex items-start gap-2 w-full">
<FaXTwitter size={40} />
<div className="w-full">
<div className="max-w-2xl">
<div className="mb-2">
<div className="flex">
<span className="mr-1 font-semibold text-default-900">
{platformConfig.name}
</span>
<span className="text-default-400">· 2h</span>
</div>
</div>
<div className="mb-2 h-3 w-full rounded-large bg-default-100"></div>
<div className="mb-4 h-3 w-3/5 rounded-large bg-default-100"></div>
</div>
<Card shadow="none" className="border-1 max-w-2xl">
<CardBody className="px-0 py-4">
<form
onSubmit={handleSubmit(onSubmit)}
className="flex flex-col gap-4 px-4"
>
<Controller
name="x_image_url"
control={control}
render={({ field }) => (
<UploadImage
onSave={onUploadImage}
imageUrl={field.value}
setImageUrl={(imageUrl) => {
field.onChange(imageUrl);
}}
className="h-[280px] w-full bg-default-100"
description={t("Upload X Image")}
/>
)}
/>
<Controller
name="x_title"
control={control}
render={({ field }) => (
<Input
{...field}
label={t("X Title")}
placeholder={platformConfig.headline || " "}
isInvalid={!!errors.x_title}
errorMessage={errors.x_title?.message}
labelPlacement="outside"
/>
)}
/>
<Controller
name="x_description"
control={control}
render={({ field }) => (
<Input
{...field}
label={t("X Description")}
placeholder={platformConfig.subheadline || " "}
isInvalid={!!errors.x_description}
errorMessage={errors.x_description?.message}
labelPlacement="outside"
/>
)}
/>
<div className="flex justify-start mt-2">
<Button
type="submit"
color="primary"
size="sm"
className="w-fit"
isLoading={isSubmitting}
isDisabled={!isValid}
>
{t("Save")}
</Button>
</div>
</form>
</CardBody>
</Card>
</div>
</div>
</>
);
};
export default MetaDataXForm;
@@ -0,0 +1,106 @@
"use client";
import React, { useEffect } from "react";
import { Input, Button } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { z } from "zod";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
export type TitleAndDescPanelConfig = {
headline: string;
subheadline: string;
};
const titleAndDescPanelSchema = z.object({
headline: z.string().min(1, "Title is required"),
subheadline: z.string(),
});
interface TitleAndDescPanelProps {
config: TitleAndDescPanelConfig;
onSave: (config: TitleAndDescPanelConfig) => Promise<boolean>;
}
const TitleAndDescPanel: React.FC<TitleAndDescPanelProps> = ({
config,
onSave,
}) => {
const { t } = useTranslation();
const {
handleSubmit,
control,
setValue,
formState: { errors, isSubmitting, isValid },
} = useForm<TitleAndDescPanelConfig>({
resolver: zodResolver(titleAndDescPanelSchema),
mode: "onBlur",
defaultValues: config,
});
useEffect(() => {
setValue("headline", config.headline);
setValue("subheadline", config.subheadline);
}, [config]);
return (
<div className="space-y-4">
<div className="flex flex-col gap-4">
<form onSubmit={handleSubmit(onSave)} className="flex flex-col gap-4">
<Controller
name="headline"
control={control}
render={({ field }) => (
<>
{/* homepage headline */}
<Input
{...field}
label={t("Site title")}
placeholder={t("Enter site title")}
description={t("Main title displayed on the home page")}
isInvalid={!!errors.headline}
errorMessage={errors.headline?.message}
labelPlacement="outside"
isRequired
/>
</>
)}
/>
<Controller
name="subheadline"
control={control}
render={({ field }) => (
<>
{/* homepage subheadline */}
<Input
{...field}
label={t("Site description")}
placeholder={t("Enter site description")}
description={t(
"Secondary description displayed below the main title"
)}
isInvalid={!!errors.subheadline}
errorMessage={errors.subheadline?.message}
labelPlacement="outside"
/>
</>
)}
/>
<Button
color="primary"
variant="solid"
type="submit"
isLoading={isSubmitting}
size="sm"
isDisabled={!isValid}
className="mt-2 w-fit"
>
{t("Save")}
</Button>
</form>
</div>
</div>
);
};
export default TitleAndDescPanel;
@@ -32,6 +32,7 @@ interface AuthKeyDetailsProps {
interface ApiAnalyticsData {
stats_day: string;
call_tool_count: number;
amount: number;
}
// Custom cursor to highlight the hovered bar with a lighter and narrower overlay
@@ -76,7 +77,7 @@ const AuthKeyDetails: React.FC<AuthKeyDetailsProps> = ({
try {
setIsLoading(true);
const response = await fetchAPI(
`/api/stats/key_call_tool_count?apikey_id=${selectedApiKey.apikey_id}`,
`/api/stats/key_call_tool?apikey_id=${selectedApiKey.apikey_id}`,
{
method: "GET",
}
@@ -86,7 +87,8 @@ const AuthKeyDetails: React.FC<AuthKeyDetailsProps> = ({
const formattedData = response.data.days.map(
(day: ApiAnalyticsData) => ({
name: new Date(day.stats_day).toISOString().split("T")[0],
value: day.call_tool_count,
value: day.amount,
count: day.call_tool_count,
})
);
setAnalyticsData(formattedData);
@@ -101,7 +103,7 @@ const AuthKeyDetails: React.FC<AuthKeyDetailsProps> = ({
}, [selectedApiKey, t]);
useEffect(() => {
if (!selectedApiKey?.apikey_id) return
if (!selectedApiKey?.apikey_id) return;
fetchAnalyticsData();
}, [selectedApiKey?.apikey_id]);
@@ -163,7 +165,9 @@ const AuthKeyDetails: React.FC<AuthKeyDetailsProps> = ({
</div>
<div className="flex items-center gap-2 bg-gray-100 p-2 rounded relative justify-between">
<span className="overflow-hidden text-ellipsis whitespace-nowrap">{getEncryptedKey(selectedApiKey.apikey)}</span>
<span className="overflow-hidden text-ellipsis whitespace-nowrap">
{getEncryptedKey(selectedApiKey.apikey)}
</span>
<Button
isIconOnly
size="sm"
@@ -213,11 +217,14 @@ const AuthKeyDetails: React.FC<AuthKeyDetailsProps> = ({
axisLine={false}
tickLine={false}
tick={{ fontSize: 12, fill: "#666" }}
allowDecimals={false}
allowDecimals={true}
/>
<RechartsTooltip
cursor={<CustomCursor />}
formatter={(value: number) => [value, t("Times")]}
formatter={(value: number) => [
value,
t("Total Spending"),
]}
contentStyle={{
backgroundColor: "#fff",
border: "1px solid #e5e7eb",
+4 -4
View File
@@ -93,17 +93,17 @@ const DashboardContent: React.FC = () => {
},
];
const handleTabNavigate = (tab: TabKey) => {
setActiveTab(tab);
const handleTabNavigate = (tab: TabKey | string) => {
setActiveTab(tab as TabKey);
// update url params
if (tab === TabKey.OVERVIEW) {
// when switch to dashboard, clear all query params, only keep base path
router.push("/dashboard", { scroll: false });
router.push("/console", { scroll: false });
} else {
// other tabs set corresponding tab params
const params = new URLSearchParams();
params.set("tab", tab);
router.push(`/dashboard?${params.toString()}`, { scroll: false });
router.push(`/console?${params.toString()}`, { scroll: false });
}
};
@@ -3,8 +3,6 @@
import React, { useEffect, useState } from "react";
import {
Switch,
AccordionItem,
Accordion,
Select,
SelectItem,
Button,
@@ -72,139 +70,115 @@ export const EmailConfigForm: React.FC<EmailConfigFormProps> = ({
const isEmailEnabled = formData.email?.is_enabled || false;
return (
<Accordion
variant="splitted"
itemClasses={{
base: "shadow-none border-1",
}}
defaultExpandedKeys={["email-login"]}
className="px-0"
>
<AccordionItem
key="email-login"
title={
<div className="flex items-center gap-3">
<div className="flex flex-col">
<h3 className="text-lg font-semibold">{t("Email Login")}</h3>
<p className="text-sm text-gray-500">
{t("Configure email-based authentication")}
</p>
</div>
</div>
}
>
<div className="space-y-4">
{/* enable email login */}
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">
{t("Enable Email Login")}
</span>
<span className="text-xs text-gray-500">
{t("Allow users to sign in with email")}
</span>
</div>
<Switch
isSelected={isEmailEnabled}
onValueChange={handleToggleEnabled}
color="primary"
size="sm"
isDisabled={isLoading || (isCaptchaMode && !isEmailConfigured)}
/>
</div>
<div className="space-y-4">
{/* enable email login */}
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">{t("Enable Email Login")}</span>
<span className="text-xs text-gray-500">
{t("Allow users to sign in with email")}
</span>
</div>
<Switch
isSelected={isEmailEnabled}
onValueChange={handleToggleEnabled}
color="primary"
size="sm"
isDisabled={isLoading || (isCaptchaMode && !isEmailConfigured)}
/>
</div>
{/* authentication mode selection */}
<div className="p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-3">
<div className="flex flex-col gap-1">
{/* authentication mode selection */}
<div className="p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-3">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">
{t("Authentication Mode")}
</span>
<span className="text-xs text-gray-500">
{t("Choose how users authenticate with email")}
</span>
</div>
<Select
selectedKeys={[formData.email?.mode || EmailMode.PASSWORD]}
onSelectionChange={(keys) => {
const mode = Array.from(keys)[0] as EmailMode;
handleModeChange(mode);
}}
size="sm"
isDisabled={isLoading || !isEmailEnabled}
renderValue={() => {
const selectedKey = formData.email?.mode || EmailMode.PASSWORD;
if (selectedKey === EmailMode.PASSWORD)
return t("Email/Password");
return t(
selectedKey === EmailMode.CAPTCHA
? "Email/Verification Code"
: "Email/Password"
);
}}
>
<SelectItem key={EmailMode.PASSWORD} value={EmailMode.PASSWORD}>
<div className="flex flex-col">
<span className="text-sm font-medium">
{t("Authentication Mode")}
{t("Email/Password")}
</span>
<span className="text-xs text-gray-500">
{t("Choose how users authenticate with email")}
{t("Traditional email and password authentication")}
</span>
</div>
<Select
selectedKeys={[formData.email?.mode || EmailMode.PASSWORD]}
onSelectionChange={(keys) => {
const mode = Array.from(keys)[0] as EmailMode;
handleModeChange(mode);
}}
size="sm"
isDisabled={isLoading || !isEmailEnabled}
renderValue={() => {
const selectedKey =
formData.email?.mode || EmailMode.PASSWORD;
if (selectedKey === EmailMode.PASSWORD)
return t("Email/Password");
return t(
selectedKey === EmailMode.CAPTCHA
? "Email/Verification Code"
: "Email/Password"
);
}}
>
<SelectItem key={EmailMode.PASSWORD} value={EmailMode.PASSWORD}>
<div className="flex flex-col">
<span className="text-sm font-medium">
{t("Email/Password")}
</span>
<span className="text-xs text-gray-500">
{t("Traditional email and password authentication")}
</span>
</div>
</SelectItem>
<SelectItem key={EmailMode.CAPTCHA} value={EmailMode.CAPTCHA}>
<div className="flex flex-col">
<span className="text-sm font-medium">
{t("Email/Verification Code")}
</span>
<span className="text-xs text-gray-500">
{t("Passwordless login with email verification code")}
</span>
</div>
</SelectItem>
</Select>
</div>
</div>
{/* email configuration hint - only show in captcha mode */}
{isEmailEnabled && isCaptchaMode && !isEmailConfigured && (
<Alert color="warning" variant="flat" className="mb-4">
<div className="flex gap-2">
<span>
{t(
"Email service is not configured. Please configure email settings first."
)}
</SelectItem>
<SelectItem key={EmailMode.CAPTCHA} value={EmailMode.CAPTCHA}>
<div className="flex flex-col">
<span className="text-sm font-medium">
{t("Email/Verification Code")}
</span>
<span className="text-xs text-gray-500">
{t("Passwordless login with email verification code")}
</span>
<Link
className="text-sm underline cursor-pointer"
onPress={() => {
onTabNavigate?.(TabKey.SYSTEM_SETTINGS, "email-admin");
}}
>
{t("Go to Settings")}
</Link>
</div>
</Alert>
)}
{/* save button - only show in enabled state */}
{isEmailEnabled && (
<div className="flex gap-3 py-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isLoading}
size="sm"
>
{t("Save")}
</Button>
</div>
)}
</SelectItem>
</Select>
</div>
</AccordionItem>
</Accordion>
</div>
{/* email configuration hint - only show in captcha mode */}
{isEmailEnabled && isCaptchaMode && !isEmailConfigured && (
<Alert color="warning" variant="flat" className="mb-4">
<div className="flex gap-2">
<span>
{t(
"SMTP is not configured. Please configure email settings first."
)}
</span>
{onTabNavigate ? (
<Link
className="text-sm underline cursor-pointer"
onPress={() => {
onTabNavigate?.(TabKey.SYSTEM_SETTINGS, "email-admin");
}}
>
{t("Go to Settings")}
</Link>
) : null}
</div>
</Alert>
)}
{/* save button - only show in enabled state */}
{isEmailEnabled && (
<div className="flex gap-3 py-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isLoading}
size="sm"
>
{t("Save")}
</Button>
</div>
)}
</div>
);
};
@@ -1,16 +1,10 @@
"use client";
import React, { useEffect, useState } from "react";
import {
Input,
Button,
Switch,
AccordionItem,
Accordion,
} from "@nextui-org/react";
import { Input, Button, Switch } from "@nextui-org/react";
import { Eye, EyeOff } from "lucide-react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { getGoogleRedirectUri } from "@/hooks/useLogin";
import { getGoogleRedirectUri } from "@/shared/hooks/useLogin";
import { GoogleAuthConfig } from "@/shared/types/system";
interface GoogleAuthConfigFormProps {
@@ -47,115 +41,94 @@ export const GoogleAuthConfigForm: React.FC<GoogleAuthConfigFormProps> = ({
const isFormValid = formData.client_id.trim() !== "";
return (
<Accordion
variant="splitted"
itemClasses={{
base: "shadow-none border-1",
}}
defaultExpandedKeys={["google-auth-config"]}
className="px-0"
>
<AccordionItem
key="google-auth-config"
title={
<div className="flex flex-col justify-between">
<h3 className="text-lg font-semibold">
{t("Google Login Settings")}
</h3>
<p className="text-sm text-gray-500">
{t("Configure Google OAuth integration")}
</p>
<>
<div className="space-y-4">
{/* enable google login */}
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">
{t("Enable Google Login")}
</span>
<span className="text-xs text-gray-500">
{t("Allow users to sign in with Google")}
</span>
</div>
}
>
<div className="space-y-4">
{/* enable google login */}
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">
{t("Enable Google Login")}
</span>
<span className="text-xs text-gray-500">
{t("Allow users to sign in with Google")}
</span>
</div>
<Switch
isSelected={formData.is_enabled}
onValueChange={(value) => {
onSave({
...formData,
is_enabled: value,
});
}}
color="primary"
size="sm"
/>
</div>
{/* Google Client ID */}
<Input
label={t("Google Client ID")}
placeholder={t("OAuth 2.0 Client ID from Google Cloud Console")}
value={formData.client_id}
onChange={(e) => handleInputChange("client_id", e.target.value)}
isRequired
isDisabled={!formData.is_enabled}
/>
{/* Google Client Secret */}
<Input
label={t("Google Client Secret")}
placeholder={t(
"OAuth 2.0 Client Secret (optional, for server-side verification)"
)}
value={formData.client_secret || ""}
onChange={(e) => handleInputChange("client_secret", e.target.value)}
type={showClientSecret ? "text" : "password"}
endContent={
<button
type="button"
onClick={() => setShowClientSecret(!showClientSecret)}
className="focus:outline-none"
disabled={!formData.is_enabled}
>
{showClientSecret ? (
<EyeOff className="w-4 h-4 text-gray-400" />
) : (
<Eye className="w-4 h-4 text-gray-400" />
)}
</button>
}
isDisabled={!formData.is_enabled}
/>
{/* Redirect URI */}
<Input
label={t("Redirect URI")}
placeholder="https://yourdomain.com/auth/google/callback"
description={t(
"Authorized redirect URI configured in Google Cloud Console"
)}
value={getGoogleRedirectUri()}
isDisabled={true}
<Switch
isSelected={formData.is_enabled}
onValueChange={(value) => {
onSave({
...formData,
is_enabled: value,
});
}}
color="primary"
size="sm"
/>
</div>
{/* Action Buttons */}
{formData.is_enabled && (
<div className="flex gap-3 py-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isLoading}
isDisabled={!isFormValid}
size="sm"
{/* Google Client ID */}
<Input
label={t("Google Client ID")}
placeholder={t("OAuth 2.0 Client ID from Google Cloud Console")}
value={formData.client_id}
onChange={(e) => handleInputChange("client_id", e.target.value)}
isRequired
isDisabled={!formData.is_enabled}
/>
{/* Google Client Secret */}
<Input
label={t("Google Client Secret")}
placeholder={t(
"OAuth 2.0 Client Secret (optional, for server-side verification)"
)}
value={formData.client_secret || ""}
onChange={(e) => handleInputChange("client_secret", e.target.value)}
type={showClientSecret ? "text" : "password"}
endContent={
<button
type="button"
onClick={() => setShowClientSecret(!showClientSecret)}
className="focus:outline-none"
disabled={!formData.is_enabled}
>
{t("Save")}
</Button>
</div>
)}
</AccordionItem>
</Accordion>
{showClientSecret ? (
<EyeOff className="w-4 h-4 text-gray-400" />
) : (
<Eye className="w-4 h-4 text-gray-400" />
)}
</button>
}
isDisabled={!formData.is_enabled}
/>
{/* Redirect URI */}
<Input
label={t("Redirect URI")}
placeholder="https://yourdomain.com/auth/google/callback"
description={t(
"Authorized redirect URI configured in Google Cloud Console"
)}
value={getGoogleRedirectUri()}
isDisabled={true}
/>
</div>
{/* Action Buttons */}
{formData.is_enabled && (
<div className="flex gap-3 py-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isLoading}
isDisabled={!isFormValid}
size="sm"
>
{t("Save")}
</Button>
</div>
)}
</>
);
};
+6 -6
View File
@@ -47,7 +47,7 @@ export const MarketplaceMain: React.FC<MarketplaceMainProps> = ({
setTotal(result.page.total);
setCurrentPage(page);
} catch (error) {
console.error('Failed to load services:', error);
console.error("Failed to load servers:", error);
} finally {
setLoading(false);
}
@@ -55,7 +55,7 @@ export const MarketplaceMain: React.FC<MarketplaceMainProps> = ({
// when search query changes, scroll to the top of the page
useEffect(() => {
window.scrollTo({ top: 0, behavior: 'smooth' });
window.scrollTo({ top: 0, behavior: "smooth" });
}, [currentPage, searchQuery]);
// update URL parameters
@@ -63,11 +63,11 @@ export const MarketplaceMain: React.FC<MarketplaceMainProps> = ({
const params = new URLSearchParams();
if (page > 1) {
params.set('page', page.toString());
params.set("page", page.toString());
}
if (search.trim()) {
params.set('search', search.trim());
params.set("search", search.trim());
}
const queryString = params.toString();
@@ -106,7 +106,7 @@ export const MarketplaceMain: React.FC<MarketplaceMainProps> = ({
onSearch={handleSearch}
/>
{/* Service List Section */}
{/* Server List Section */}
{loading ? (
<div className="mx-auto h-[200px] flex items-center justify-center">
<Spinner />
@@ -122,4 +122,4 @@ export const MarketplaceMain: React.FC<MarketplaceMainProps> = ({
)}
</>
);
};
};
@@ -1,133 +0,0 @@
"use client";
import React from 'react';
import {
Input,
Select,
SelectItem,
Chip,
} from '@nextui-org/react';
import { useTranslation } from '@/shared/lib/useTranslation';
import { AuthMethod, MCPServiceFormData } from '@/types/mcp-service';
interface BasicInfoTabProps {
formData: MCPServiceFormData;
newTag: string;
setNewTag: (value: string) => void;
onInputChange: (field: keyof MCPServiceFormData, value: any) => void;
onAddTag: () => void;
onRemoveTag: (tag: string) => void;
}
export const BasicInfoTab: React.FC<BasicInfoTabProps> = ({
formData,
newTag,
setNewTag,
onInputChange,
onAddTag,
onRemoveTag
}) => {
const { t } = useTranslation();
return (
<div className="space-y-4">
<Input
label={t('Service Name')}
placeholder={t('Enter service name')}
value={formData.name}
onChange={(e) => onInputChange('name', e.target.value)}
isRequired
/>
<Input
label={t('Short Description')}
placeholder={t('Brief description of the service')}
value={formData.short_description || ''}
onChange={(e) => onInputChange('short_description', e.target.value)}
isRequired
/>
<Input
label={t('API Endpoint')}
placeholder="https://api.example.com/v1"
value={formData.base_url || ''}
onChange={(e) => onInputChange('base_url', e.target.value)}
isRequired
/>
<Select
label={t('Authentication Type')}
selectedKeys={formData.auth_method ? [formData.auth_method] : []}
onSelectionChange={(keys) => {
const selectedKey = Array.from(keys)[0] as string;
onInputChange('auth_method', selectedKey);
// clear auth config when switch auth type
onInputChange('auth_header', '');
onInputChange('auth_token', '');
}}
>
<SelectItem key="none" value="none">{t('None')}</SelectItem>
<SelectItem key="apikey" value="apikey">{t('API Key')}</SelectItem>
<SelectItem key="token" value="token">{t('Bearer Token')}</SelectItem>
</Select>
{/* auth config input fields */}
{formData.auth_method === AuthMethod.APIKey && (
<div className="space-y-4">
<Input
label={t('API Key Header Name')}
placeholder="X-API-Key"
value={formData.auth_header || ''}
onChange={(e) => onInputChange('auth_header', e.target.value)}
description={t('The header name for the API key (e.g., X-API-Key, Authorization)')}
/>
<Input
label={t('API Key Value')}
placeholder={t('Enter API key')}
type="password"
value={formData.auth_token || ''}
onChange={(e) => onInputChange('auth_token', e.target.value)}
autoComplete='new-password'
/>
</div>
)}
{formData.auth_method === AuthMethod.BearerToken && (
<Input
label={t('Bearer Token')}
placeholder={t('Enter bearer token')}
type="password"
value={formData.auth_token || ''}
onChange={(e) => onInputChange('auth_token', e.target.value)}
description={t('The bearer token for authentication')}
autoComplete='new-password'
/>
)}
{/* tag management */}
<div className="space-y-2">
<label className="text-sm font-medium">{t('Tags')}</label>
<div className="flex gap-2">
<Input
placeholder={t('Add tag')}
value={newTag}
onChange={(e) => setNewTag(e.target.value)}
onKeyUp={(e) => e.key === 'Enter' && onAddTag()}
/>
</div>
<div className="flex flex-wrap gap-2">
{(formData.tags || []).map((tag, index) => (
<Chip
key={index}
onClose={() => onRemoveTag(tag)}
variant="flat"
>
{tag}
</Chip>
))}
</div>
</div>
</div>
);
};
@@ -1,41 +1,37 @@
"use client";
import React, { useState, useCallback, useEffect } from "react";
import { useRouter, useSearchParams } from "next/navigation";
import { useSearchParams } from "next/navigation";
import { useMCPServicesList } from "@/hooks/useMCPServicesList";
import { MCPService, MCPServiceFormData, EnabledEnum } from "@/types/mcp-service";
import { MCPService, MCPServiceFormData } from "@/shared/types/mcp-service";
import { useTranslation } from "@/shared/lib/useTranslation";
import { ServiceFiltersBar } from "./ServiceFiltersBar";
import { ServiceTable } from "./ServiceTable";
import { ServiceEditPage } from "./ServiceEditPage";
import { OpenAPIGeneratorModal } from "./OpenAPIGeneratorModal";
import { ServiceFiltersBar } from "@/shared/components/mcp-services/ServiceFiltersBar";
import { ServiceEditPage } from "@/components/mcp-services/ServiceEditPage";
import { DeleteConfirmModal } from "@/shared/components/modal/DeleteConfirmModal";
import DashboardDemoContent from "@/shared/components/DashboardDemoContent";
import { ServiceTable } from "@/shared/components/mcp-services/ServiceTable";
import { OpenAPIGeneratorModal } from "@/shared/components/mcp-services/OpenAPIGeneratorModal";
type ViewMode = "list" | "edit" | "create";
export const MCPServicesManagement: React.FC = () => {
const { t } = useTranslation();
const router = useRouter();
const searchParams = useSearchParams();
const {
services,
loading,
pagination,
searchTerm,
setSearchTerm,
statusFilter,
setStatusFilter,
onPageChange,
createService,
updateService,
deleteService,
toggleServiceStatus,
parseOpenAPIDocument,
loadServices
loadServices,
} = useMCPServicesList();
const [addServiceType, setAddServiceType] = useState<string | null>(null);
// Get initial state from URL
const getInitialViewMode = (): ViewMode => {
@@ -57,26 +53,29 @@ export const MCPServicesManagement: React.FC = () => {
);
// Update URL when view mode or service ID changes
const updateURL = useCallback((mode: ViewMode, serviceId?: string | null) => {
const params = new URLSearchParams(searchParams);
const updateURL = useCallback(
(mode: ViewMode, serviceId?: string | null) => {
const params = new URLSearchParams(searchParams);
// Always keep the tab parameter
params.set("tab", "mcp-services");
// Always keep the tab parameter
params.set("tab", "mcp-services");
if (mode === "list") {
params.delete("mode");
params.delete("serviceId");
} else {
params.set("mode", mode);
if (serviceId) {
params.set("serviceId", serviceId);
} else {
if (mode === "list") {
params.delete("mode");
params.delete("serviceId");
} else {
params.set("mode", mode);
if (serviceId) {
params.set("serviceId", serviceId);
} else {
params.delete("serviceId");
}
}
}
router.push(`/console?${params.toString()}`, { scroll: false });
}, [router, searchParams]);
window.history.pushState({}, "", `/admin/console?${params.toString()}`);
},
[searchParams]
);
// Sync state with URL on mount and URL changes
useEffect(() => {
@@ -94,29 +93,38 @@ export const MCPServicesManagement: React.FC = () => {
null
);
// Service CRUD operations
const handleCreateService = useCallback(() => {
setSelectedServiceId(null);
setViewMode("create");
updateURL("create");
}, [updateURL]);
// Server CRUD operations
const handleCreateService = (type: string) => {
setAddServiceType(type);
setIsOpenAPIModalOpen(true);
};
const handleEditService = useCallback((service: MCPService) => {
setSelectedServiceId(service.id);
setViewMode("edit");
updateURL("edit", service.id);
}, [updateURL]);
const handleEditService = useCallback(
(service: MCPService) => {
setSelectedServiceId(service.id);
setViewMode("edit");
updateURL("edit", service.id);
},
[updateURL]
);
const handleSaveService = useCallback(
async (formData: MCPServiceFormData) => {
async (formData: MCPServiceFormData, isDraft?: boolean) => {
try {
const result = selectedServiceId ? await updateService(selectedServiceId, formData) : await createService(formData);
if (!result) return
const result = selectedServiceId
? await updateService(selectedServiceId, formData)
: await createService(formData);
if (!result) return false;
if (isDraft) {
return true;
}
setViewMode("list");
setSelectedServiceId(null);
updateURL("list");
return true;
} catch (error) {
console.error("Failed to save service:", error);
console.error("Failed to save server:", error);
return false;
}
},
[selectedServiceId, updateService, createService, updateURL]
@@ -140,28 +148,22 @@ export const MCPServicesManagement: React.FC = () => {
setIsDeleteModalOpen(false);
setServiceToDelete(null);
} catch (error) {
console.error("Failed to delete service:", error);
console.error("Failed to delete server:", error);
}
}
}, [serviceToDelete, deleteService]);
const handleToggleStatus = useCallback(
async (service: MCPService) => {
async (serviceId: string) => {
try {
await toggleServiceStatus(service.id);
await toggleServiceStatus(serviceId);
} catch (error) {
console.error("Failed to toggle service status:", error);
console.error("Failed to toggle server status:", error);
}
},
[toggleServiceStatus]
);
// OpenAPI operations
const handleOpenAPIGenerate = useCallback(() => {
setIsOpenAPIModalOpen(true);
}, []);
const handleEditGeneratedService = useCallback(
async (serviceId: string) => {
try {
@@ -172,7 +174,7 @@ export const MCPServicesManagement: React.FC = () => {
setIsOpenAPIModalOpen(false);
loadServices(1);
} catch (error) {
console.error("Failed to navigate to generated service:", error);
console.error("Failed to navigate to generated server:", error);
}
},
[updateURL]
@@ -196,31 +198,26 @@ export const MCPServicesManagement: React.FC = () => {
onSave={handleSaveService}
onCancel={handleCancelEdit}
loading={loading}
onUnpublish={handleToggleStatus}
onRefreshList={() => {
loadServices(1);
}}
/>
);
}
return (
<DashboardDemoContent
title="MCP Services"
description="Manage your MCP services, configure APIs, and monitor service status"
title={t("MCP")}
description={t(
"Manage your MCP servers, configure APIs, and monitor server status"
)}
>
<div className="space-y-6 w-full">
{/* comming soon:Filters and Actions */}
<ServiceFiltersBar
filters={{
search: searchTerm,
status: statusFilter,
}}
onFiltersChange={(filters) => {
setSearchTerm(filters.search);
setStatusFilter(filters.status);
}}
onAddService={handleCreateService}
onImportOpenAPI={handleOpenAPIGenerate}
/>
<ServiceFiltersBar onAddService={handleCreateService} />
{/* Services Table */}
{/* Servers Table */}
<ServiceTable
services={services}
loading={loading}
@@ -232,25 +229,27 @@ export const MCPServicesManagement: React.FC = () => {
/>
{/* Modals */}
{
isOpenAPIModalOpen && (
<OpenAPIGeneratorModal
isOpen={true}
onClose={handleCloseOpenAPIModal}
onGenerate={parseOpenAPIDocument}
onEditGenerated={handleEditGeneratedService}
/>
)
}
{isOpenAPIModalOpen && (
<OpenAPIGeneratorModal
isOpen={true}
onClose={handleCloseOpenAPIModal}
onGenerate={parseOpenAPIDocument}
onEditGenerated={handleEditGeneratedService}
serverType={addServiceType || "openapi"}
/>
)}
<DeleteConfirmModal
isOpen={isDeleteModalOpen}
onClose={handleCloseDeleteModal}
onConfirm={handleConfirmDelete}
title={t('Confirm Delete')}
description={t('Are you sure you want to delete this "{{name}}" service?', {
name: serviceToDelete?.name || "",
})}
title={t("Confirm Delete")}
description={t(
'Are you sure you want to delete this "{{name}}" server?',
{
name: serviceToDelete?.name || "",
}
)}
/>
</div>
</DashboardDemoContent>
@@ -1,50 +1,92 @@
"use client";
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect } from "react";
import { Button, Tabs, Tab, Spinner } from "@nextui-org/react";
import { ChevronLeftIcon } from "lucide-react";
import { useTranslation } from "@/shared/lib/useTranslation";
import {
Button,
Tabs,
Tab,
Spinner,
} from '@nextui-org/react';
import { ChevronLeftIcon } from 'lucide-react';
import { useTranslation } from '@/shared/lib/useTranslation';
import { AuthMethod, MCPServiceFormData } from '@/types/mcp-service';
AuthMethod,
EnabledEnum,
MCPServiceFormData,
} from "@/shared/types/mcp-service";
import { useMCPServiceDetail } from "@/hooks/useMCPServiceDetail";
import { BasicInfoTab } from './BasicInfoTab';
import { PricingTab } from './PricingTab';
import { DescriptionTab } from './DescriptionTab';
import { ToolsTab } from './ToolsTab';
import { OpenAPIGeneratorModal } from './OpenAPIGeneratorModal';
import { ChargeType } from '@/shared/types/marketplace';
import { BasicInfoTab } from "@/shared/components/mcp-services/BasicInfoTab";
import { PricingTab } from "@/shared/components/mcp-services/PricingTab";
import { DescriptionTab } from "@/shared/components/mcp-services/DescriptionTab";
import { ToolsTab } from "@/shared/components/mcp-services/ToolsTab";
import { OpenAPIGeneratorModal } from "@/shared/components/mcp-services/OpenAPIGeneratorModal";
import { ChargeType } from "@/shared/types/marketplace";
import { withComponentInjection } from "@/shared/hooks/useComponentInjection";
const _DefaultFormData: MCPServiceFormData = {
id: '',
name: '',
short_description: '',
long_description: '',
base_url: '',
id: "",
name: "",
short_description: "",
long_description: "",
base_url: "",
auth_method: AuthMethod.None,
auth_header: '',
auth_token: '',
auth_header: "",
auth_token: "",
charge_type: ChargeType.Free,
price: '',
price: "",
enabled: 0,
tags: [],
apis: []
}
apis: [],
};
// Helper function to validate URL
const isValidUrl = (url: string) => {
if (!url) return false;
try {
const parsed = new URL(url);
return parsed.protocol === "http:" || parsed.protocol === "https:";
} catch {
return false;
}
};
const validateServiceForm = (data: MCPServiceFormData, t: any) => {
const errors: Record<string, string> = {};
if (!data.slug_name?.trim()) {
errors.slug_name = t("Server ID is required");
} else if (data.slug_name.length > 256) {
errors.slug_name = t("Server ID must be less than 256 characters");
}
if (!data.name?.trim()) {
errors.name = t("Server name is required");
} else if (data.name.length > 256) {
errors.name = t("Server Name must be less than 256 characters");
}
if (!data.base_url?.trim()) {
errors.base_url = t("API Endpoint is required");
} else if (!isValidUrl(data.base_url)) {
errors.base_url = t("API Endpoint must be a valid HTTP/HTTPS URL");
}
if (!data.short_description?.trim()) {
errors.short_description = t("Short description is required");
}
return errors;
};
interface ServiceEditPageProps {
serviceId?: string;
onSave: (data: MCPServiceFormData) => void;
onSave: (data: MCPServiceFormData, isDraft?: boolean) => void;
onCancel: () => void;
loading?: boolean;
onUnpublish?: (serviceId: string) => void;
onRefreshList?: () => void;
}
export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
const BaseServiceEditPage: React.FC<ServiceEditPageProps> = ({
serviceId,
onSave,
onCancel,
loading = false
loading = false,
}) => {
const { t } = useTranslation();
const isEditing = !!serviceId;
@@ -54,19 +96,21 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
serviceDetail: service,
detailLoading: dataLoading,
getServiceDetail,
clearServiceDetail
clearServiceDetail,
parseOpenAPIDocumentForUpdate,
updateLoading,
} = useMCPServiceDetail();
const [isSaving, setIsSaving] = useState(false);
const [isDraft, setIsDraft] = useState(false);
// use services list hook for OpenAPI update
const { parseOpenAPIDocumentForUpdate, updateLoading } = useMCPServiceDetail();
const [formData, setFormData] = useState<MCPServiceFormData>(_DefaultFormData);
const [newTag, setNewTag] = useState('');
const [formData, setFormData] =
useState<MCPServiceFormData>(_DefaultFormData);
const [newTag, setNewTag] = useState("");
// OpenAPI modal state
const [isOpenAPIModalOpen, setIsOpenAPIModalOpen] = useState(false);
// get service detail
// get server detail
useEffect(() => {
if (serviceId) {
getServiceDetail(serviceId);
@@ -80,42 +124,70 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
// when service data loaded, fill form
useEffect(() => {
if (!serviceId || !service) return
if (!serviceId || !service) return;
setFormData({
...formData,
...service
...service,
});
}, [service, serviceId]);
const handleInputChange = (field: keyof MCPServiceFormData, value: any) => {
setFormData(prev => ({
setFormData((prev) => ({
...prev,
[field]: value
[field]: value,
}));
};
const handleAddTag = () => {
if (newTag.trim() && !(formData.tags || []).includes(newTag.trim())) {
setFormData(prev => ({
setFormData((prev) => ({
...prev,
tags: [...(prev.tags || []), newTag.trim()]
tags: [...(prev.tags || []), newTag.trim()],
}));
setNewTag('');
setNewTag("");
}
};
const handleRemoveTag = (tagToRemove: string) => {
setFormData(prev => ({
setFormData((prev) => ({
...prev,
tags: (prev.tags || []).filter(tag => tag !== tagToRemove)
tags: (prev.tags || []).filter((tag) => tag !== tagToRemove),
}));
};
const handleSubmit = () => {
onSave(formData);
const handleSubmit = async (enabled?: EnabledEnum) => {
// Check if slug_name has been modified
const isSlugNameChanged =
isEditing &&
service?.slug_name &&
formData.slug_name !== service.slug_name;
if (isSlugNameChanged) {
const confirmed = window.confirm(
t(
"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?"
)
);
if (!confirmed) {
return;
}
}
// Proceed with save
setIsSaving(true);
const isDraft =
service?.enabled === EnabledEnum.Offline && enabled === undefined;
setIsDraft(isDraft);
await onSave(
{
...formData,
headers: formData.headers?.filter((header) => header.name !== ""),
...(enabled !== undefined ? { enabled } : {}),
},
isDraft
);
setIsSaving(false);
setIsDraft(false);
};
// OpenAPI update handlers
@@ -127,19 +199,26 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
setIsOpenAPIModalOpen(false);
};
const handleOpenAPIGenerate = async (url?: string, file?: File): Promise<{ service_id: string }> => {
const handleOpenAPIGenerate = async (
url?: string,
file?: File
): Promise<{ service_id: string }> => {
if (!serviceId) {
throw new Error('Service ID is required for update');
throw new Error("Server ID is required for update");
}
try {
const updatedService = await parseOpenAPIDocumentForUpdate(serviceId, url, file);
const updatedService = await parseOpenAPIDocumentForUpdate(
serviceId,
url,
file
);
// update form data
setFormData({
...formData,
...updatedService,
update_type: 'openapi'
update_type: "openapi",
});
// close modal
@@ -148,24 +227,46 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
// return service_id format to compatible with OpenAPIGeneratorModal
return { service_id: updatedService.id };
} catch (error) {
console.error('OpenAPI update failed:', error);
console.error("OpenAPI update failed:", error);
throw error;
}
};
// Helper function to validate price string
const isValidPrice = (priceStr: string | undefined): boolean => {
if (!priceStr || priceStr.trim() === "") {
return false;
}
const numValue = parseFloat(priceStr);
return !isNaN(numValue) && numValue >= 0;
};
const validationErrors = validateServiceForm(formData, t);
const isFormValid = () => {
const hasBasicInfo = formData.name.trim() && formData.short_description?.trim();
if (Object.keys(validationErrors).length > 0) {
return false;
}
// if free, no need to validate price
if (formData.charge_type === ChargeType.Free) {
return hasBasicInfo;
return true;
}
// if PerCall, validate price
if (formData.charge_type === ChargeType.PerCall) {
return isValidPrice(formData.price);
}
// if PerToken, validate both input and output token prices
if (formData.charge_type === ChargeType.PerToken) {
return (
isValidPrice(formData.input_token_price) &&
isValidPrice(formData.output_token_price)
);
}
// if paid, need to validate price
return hasBasicInfo &&
formData.price !== undefined &&
formData.price.trim() !== '';
return formData.price !== undefined && formData.price.trim() !== "";
};
return (
@@ -173,16 +274,11 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
{/* page title */}
<div className="flex items-center justify-between mb-6 px-8">
<div className="flex items-center gap-3">
<Button
isIconOnly
onPress={onCancel}
variant='flat'
size='sm'
>
<Button isIconOnly onPress={onCancel} variant="flat" size="sm">
<ChevronLeftIcon className="w-5 h-5" />
</Button>
<h1 className="text-2xl font-bold">
{isEditing ? t('Service Detail') : t('Create New Service')}
{isEditing ? t("Server Detail") : t("Create New Server")}
</h1>
</div>
<div className="flex items-center gap-2">
@@ -192,20 +288,39 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
onPress={handleOpenAPIUpdate}
isDisabled={loading || dataLoading || updateLoading}
isLoading={updateLoading}
size='sm'
size="sm"
>
{t('Update from OpenAPI')}
{t("Update from OpenAPI")}
</Button>
)}
<Button
color="primary"
onPress={handleSubmit}
isDisabled={!isFormValid() || loading || dataLoading || updateLoading}
isLoading={updateLoading}
size='sm'
onPress={() => handleSubmit()}
isDisabled={
!isFormValid() || loading || dataLoading || updateLoading
}
isLoading={
isSaving && (isDraft || service?.enabled !== EnabledEnum.Offline)
}
size="sm"
>
{t('Save')}
{service?.enabled === EnabledEnum.Offline
? t("Save Draft")
: t("Save")}
</Button>
{service?.enabled === EnabledEnum.Offline && (
<Button
color="success"
onPress={() => handleSubmit(EnabledEnum.Online)}
isDisabled={
!isFormValid() || loading || dataLoading || updateLoading
}
isLoading={isSaving && !isDraft}
size="sm"
>
{t("Publish")}
</Button>
)}
</div>
</div>
@@ -214,7 +329,7 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
<div className="flex-1 flex items-center justify-center">
<div className="flex flex-col items-center gap-4">
<Spinner size="lg" />
<p className="text-gray-600">{t('Loading service data...')}</p>
<p className="text-gray-600">{t("Loading server data...")}</p>
</div>
</div>
)}
@@ -222,17 +337,17 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
{/* form content */}
{!dataLoading && (
<Tabs
aria-label="Service edit tabs"
variant='bordered'
color='primary'
aria-label="Server edit tabs"
variant="bordered"
color="primary"
classNames={{
panel: "flex-1 overflow-y-auto px-8"
panel: "flex-1 overflow-y-auto px-8",
}}
className=' px-8'
className=" px-8"
>
<Tab key="basic" title={t('Basic Information')}>
<Tab key="basic" title={t("Basic Information")}>
<div className="pt-2 flex gap-4">
<div className='flex-1'>
<div className="flex-1">
<BasicInfoTab
formData={formData}
newTag={newTag}
@@ -240,9 +355,10 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
onInputChange={handleInputChange}
onAddTag={handleAddTag}
onRemoveTag={handleRemoveTag}
errors={validationErrors}
/>
</div>
<div className='w-[400px] max-w-[1/2]'>
<div className="w-[400px] max-w-[1/2]">
<PricingTab
formData={formData}
onInputChange={handleInputChange}
@@ -251,16 +367,13 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
</div>
</Tab>
<Tab key="tools" title={t('Tools Management')}>
<Tab key="tools" title={t("Tools Management")}>
<div className="pt-2">
<ToolsTab
formData={formData}
onInputChange={handleInputChange}
/>
<ToolsTab formData={formData} onInputChange={handleInputChange} />
</div>
</Tab>
<Tab key="description" title={t('Detailed Description')} >
<Tab key="description" title={t("Detailed Description")}>
<div className="pt-2 h-full">
<DescriptionTab
formData={formData}
@@ -272,16 +385,18 @@ export const ServiceEditPage: React.FC<ServiceEditPageProps> = ({
)}
{/* OpenAPI Generator Modal */}
{
isOpenAPIModalOpen && (
<OpenAPIGeneratorModal
isOpen={true}
onClose={handleCloseOpenAPIModal}
onGenerate={handleOpenAPIGenerate}
mode="update"
/>
)
}
{isOpenAPIModalOpen && (
<OpenAPIGeneratorModal
isOpen={true}
onClose={handleCloseOpenAPIModal}
onGenerate={handleOpenAPIGenerate}
mode="update"
/>
)}
</div>
);
};
};
export const ServiceEditPage = withComponentInjection(
"components/mcp-services/ServiceEditPage",
BaseServiceEditPage
);
@@ -1,80 +0,0 @@
"use client";
import React from "react";
import { Input, Select, SelectItem, Button } from "@nextui-org/react";
import { useTranslation } from "@/shared/lib/useTranslation";
import { ServiceFilters } from "@/types/mcp-service";
import { Search, Plus } from "lucide-react";
interface ServiceFiltersBarProps {
filters: ServiceFilters;
onFiltersChange: (filters: ServiceFilters) => void;
onAddService: () => void;
onImportOpenAPI?: () => void;
}
export const ServiceFiltersBar: React.FC<ServiceFiltersBarProps> = ({
filters,
onFiltersChange,
onImportOpenAPI,
}) => {
const { t } = useTranslation();
const handleSearchChange = (value: string) => {
onFiltersChange({ ...filters, search: value });
};
const handleStatusChange = (value: string) => {
onFiltersChange({ ...filters, status: value });
};
return (
<div className="flex flex-col sm:flex-row gap-4">
<div className="flex-1">
<Button
color="primary"
onPress={onImportOpenAPI}
startContent={<Plus size={16} />}
size="sm"
>
{t("Add Service")}
</Button>
{/* <Input
placeholder={t('Search services...')}
value={filters.search}
onValueChange={handleSearchChange}
startContent={<Search className="w-4 h-4 text-gray-400" />}
classNames={{
input: "text-sm",
inputWrapper: "h-10"
}}
/> */}
</div>
<div className="flex gap-2">
{/* <Select
placeholder={t('Filter by status')}
selectedKeys={filters.status ? [filters.status] : []}
onSelectionChange={(keys) => {
const value = Array.from(keys)[0] as string;
handleStatusChange(value || '');
}}
className="w-40"
classNames={{
trigger: "h-10"
}}
>
{[
{ key: "all", label: t('All Status') },
{ key: "enabled", label: t('Online') },
{ key: "disabled", label: t('Offline') }
].map((item) => (
<SelectItem key={item.key} value={item.key}>
{item.label}
</SelectItem>
))}
</Select> */}
</div>
</div>
);
};
@@ -1,77 +0,0 @@
"use client";
import React, { useCallback } from 'react';
import {
Input,
Table,
TableHeader,
TableColumn,
TableBody,
TableRow,
TableCell,
} from '@nextui-org/react';
import { useTranslation } from '@/shared/lib/useTranslation';
import { MCPServiceAPIItem, MCPServiceFormData } from '@/types/mcp-service';
interface ToolsTabProps {
formData: MCPServiceFormData;
onInputChange: (field: keyof MCPServiceFormData, value: any) => void;
}
export const ToolsTab: React.FC<ToolsTabProps> = ({
formData,
onInputChange
}) => {
const { t } = useTranslation();
const handleToolChange = useCallback((index: number, field: keyof MCPServiceAPIItem, value: string) => {
onInputChange('apis', (formData.apis || []).map((api, i) =>
i === index ? { ...api, [field]: value } : api
));
}, [formData.apis, onInputChange]);
return (
<div className="space-y-4">
<Table
aria-label="APIs table"
removeWrapper
>
<TableHeader>
<TableColumn className='w-1/4'>{t('Tool Name')}</TableColumn>
<TableColumn className='w-1/4'>{t('Tool URL')}</TableColumn>
<TableColumn>{t('Description')}</TableColumn>
</TableHeader>
<TableBody emptyContent={t('No tools added yet. Add your first tool using the input above.')}>
{(formData.apis || []).map((tool, index) => (
<TableRow
key={`tool-${index}`}
>
<TableCell>
<Input
value={tool.name}
size="sm"
isDisabled
/>
</TableCell>
<TableCell>
<Input
value={tool.url}
size="sm"
isDisabled
/>
</TableCell>
<TableCell>
<Input
value={tool.description || ''}
onChange={(e) => handleToolChange(index, 'description', e.target.value)}
size="sm"
/>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</div>
);
};
@@ -18,6 +18,7 @@ interface StripeConfigFormProps {
onEnable: (channelId: string) => Promise<boolean>;
onDisable: (channelId: string) => Promise<boolean>;
isLoading?: boolean;
labelPlacement?: "outside" | "inside";
}
export const StripeConfigForm: React.FC<StripeConfigFormProps> = ({
@@ -26,6 +27,7 @@ export const StripeConfigForm: React.FC<StripeConfigFormProps> = ({
onEnable,
onDisable,
isLoading = false,
labelPlacement = "inside",
}) => {
const { t } = useTranslation();
const [formData, setFormData] = useState<StripeConfig>(config);
@@ -67,6 +69,115 @@ export const StripeConfigForm: React.FC<StripeConfigFormProps> = ({
const isFormValid =
formData.secret.trim() !== "" && formData.webhook_secret.trim() !== "";
const panelContent = () => {
return (
<>
<div
className={`flex flex-col gap-4 ${formData.is_enabled ? "" : "hidden"}`}
>
{/* Secret Key */}
<Input
label={t("Secret Key")}
placeholder={t("Enter Secret Key")}
description={t("Stripe secret key for server-side API calls")}
value={formData.secret}
onChange={(e) => handleInputChange("secret", e.target.value)}
type={showSecretKey ? "text" : "password"}
endContent={
<button
type="button"
onClick={() => setShowSecretKey(!showSecretKey)}
className="focus:outline-none"
>
{showSecretKey ? (
<EyeOff className="w-4 h-4 text-gray-400" />
) : (
<Eye className="w-4 h-4 text-gray-400" />
)}
</button>
}
isRequired
autoComplete="off"
isDisabled={!formData.is_enabled}
labelPlacement="outside"
/>
{/* Webhook Secret (Optional) */}
<Input
label={t("Webhook Secret")}
placeholder={t("Enter Webhook Secret")}
description={t(
"Webhook signing secret for verifying Stripe events"
)}
value={formData.webhook_secret || ""}
onChange={(e) =>
handleInputChange("webhook_secret", e.target.value)
}
type={showWebhookSecret ? "text" : "password"}
isRequired
endContent={
<button
type="button"
onClick={() => setShowWebhookSecret(!showWebhookSecret)}
className="focus:outline-none"
>
{showWebhookSecret ? (
<EyeOff className="w-4 h-4 text-gray-400" />
) : (
<Eye className="w-4 h-4 text-gray-400" />
)}
</button>
}
autoComplete="off"
isDisabled={!formData.is_enabled}
labelPlacement="outside"
/>
</div>
{/* Action Buttons */}
{formData.is_enabled && (
<div className="flex gap-3 py-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isLoading}
isDisabled={!isFormValid}
size="sm"
>
{t("Save")}
</Button>
</div>
)}
</>
);
};
if (labelPlacement === "outside") {
return (
<div className="flex flex-col gap-4">
{/* Enable/Disable Toggle */}
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">
{t("Enable Stripe Payment")}
</span>
<span className="text-xs text-gray-500">
{t("Toggle to enable or disable Stripe payment interface")}
</span>
</div>
<Switch
isSelected={formData.is_enabled || false}
onValueChange={handleEnableDisable}
color="primary"
size="sm"
/>
</div>
{panelContent()}
</div>
);
}
return (
<Accordion
variant="splitted"
@@ -98,79 +209,7 @@ export const StripeConfigForm: React.FC<StripeConfigFormProps> = ({
</div>
}
>
<div className="space-y-4">
{/* Secret Key */}
<Input
label={t("Secret Key")}
placeholder="sk_test_... or sk_live_..."
description={t("Stripe secret key for server-side API calls")}
value={formData.secret}
onChange={(e) => handleInputChange("secret", e.target.value)}
type={showSecretKey ? "text" : "password"}
endContent={
<button
type="button"
onClick={() => setShowSecretKey(!showSecretKey)}
className="focus:outline-none"
>
{showSecretKey ? (
<EyeOff className="w-4 h-4 text-gray-400" />
) : (
<Eye className="w-4 h-4 text-gray-400" />
)}
</button>
}
isRequired
autoComplete="off"
isDisabled={!formData.is_enabled}
/>
{/* Webhook Secret (Optional) */}
<Input
label={t("Webhook Secret")}
placeholder="whsec_..."
description={t(
"Webhook signing secret for verifying Stripe events"
)}
value={formData.webhook_secret || ""}
onChange={(e) =>
handleInputChange("webhook_secret", e.target.value)
}
type={showWebhookSecret ? "text" : "password"}
isRequired
endContent={
<button
type="button"
onClick={() => setShowWebhookSecret(!showWebhookSecret)}
className="focus:outline-none"
>
{showWebhookSecret ? (
<EyeOff className="w-4 h-4 text-gray-400" />
) : (
<Eye className="w-4 h-4 text-gray-400" />
)}
</button>
}
autoComplete="off"
isDisabled={!formData.is_enabled}
/>
</div>
{/* Action Buttons */}
{formData.is_enabled && (
<div className="flex gap-3 py-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isLoading}
isDisabled={!isFormValid}
size="sm"
>
{t("Save")}
</Button>
</div>
)}
{panelContent()}
</AccordionItem>
</Accordion>
);
@@ -6,19 +6,12 @@ import DashboardDemoContent from "@/shared/components/DashboardDemoContent";
import { useRevenueManagement } from "@/hooks/useRevenueManagement";
const RevenueManagement: React.FC = () => {
// use custom hook to manage revenue data
const {
records,
loading,
pagination,
setPage,
} = useRevenueManagement();
const { records, loading, pagination, setPage } = useRevenueManagement();
return (
<DashboardDemoContent
title="Revenue Management"
title="Revenue"
description="Monitor platform revenue and view user recharge history"
>
<div className="space-y-6 w-full">
@@ -1,7 +1,7 @@
"use client";
import React, { useState, useEffect } from "react";
import { Button, AccordionItem, Accordion } from "@nextui-org/react";
import { Button } from "@nextui-org/react";
import MDEditor, { commands } from "@uiw/react-md-editor";
import { PlatformConfig } from "@/shared/types/system";
import { useTranslation } from "@/shared/lib/useTranslation";
@@ -53,7 +53,6 @@ export const AboutPageSettings: React.FC<AboutPageSettingsProps> = ({
preview="live"
hideToolbar={false}
visibleDragbar={false}
data-color-mode="light"
textareaProps={{
placeholder: t("Enter about page content (supports Markdown)"),
style: {
@@ -45,7 +45,7 @@ export const AdminConfigForm: React.FC<AdminConfigFormProps> = ({
formData.username.trim() !== "" &&
formData.password?.trim() !== "" &&
formData.password === confirmPassword &&
formData.password?.length >= 8;
formData.password?.length >= 6;
const passwordsMatch = formData.password === confirmPassword;
@@ -86,7 +86,7 @@ export const AdminConfigForm: React.FC<AdminConfigFormProps> = ({
<Input
label={t("Administrator Password")}
placeholder={t("Enter administrator password")}
description={t("Password must be at least 8 characters long")}
description={t("Password must be at least 6 characters long")}
value={formData.password}
onChange={(e) => handleInputChange("password", e.target.value)}
type={showPassword ? "text" : "password"}
@@ -106,13 +106,13 @@ export const AdminConfigForm: React.FC<AdminConfigFormProps> = ({
isRequired
autoComplete="new-password"
color={
formData.password?.length > 0 && formData.password?.length < 8
formData.password?.length > 0 && formData.password?.length < 6
? "danger"
: "default"
}
errorMessage={
formData.password?.length > 0 && formData.password?.length < 8
? t("Password must be at least 8 characters")
formData.password?.length > 0 && formData.password?.length < 6
? t("Password must be at least 6 characters")
: ""
}
/>
@@ -1,10 +1,10 @@
'use client';
"use client";
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Input, Button, AccordionItem, Accordion, Select, SelectItem } from '@nextui-org/react';
import { Eye, EyeOff } from 'lucide-react';
import { EmailConfig } from '@/types/system';
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { Input, Button, Select, SelectItem } from "@nextui-org/react";
import { Eye, EyeOff } from "lucide-react";
import { EmailConfig } from "@/types/system";
interface EmailConfigFormProps {
config: EmailConfig;
@@ -28,7 +28,7 @@ export const EmailConfigForm: React.FC<EmailConfigFormProps> = ({
{ key: "465", label: "465 (SMTPS)" },
{ key: "587", label: "587 (SMTP with STARTTLS)" },
{ key: "2525", label: "2525 (Alternative SMTP)" },
{ key: "custom", label: t('Custom') },
{ key: "custom", label: t("Custom") },
];
useEffect(() => {
@@ -39,9 +39,9 @@ export const EmailConfigForm: React.FC<EmailConfigFormProps> = ({
}, [config]);
const handleInputChange = (field: keyof EmailConfig, value: string) => {
setFormData(prev => ({
setFormData((prev) => ({
...prev,
[field]: value
[field]: value,
}));
};
@@ -50,11 +50,11 @@ export const EmailConfigForm: React.FC<EmailConfigFormProps> = ({
};
const isFormValid =
formData.smtp_host.trim() !== '' &&
formData.smtp_port.trim() !== '' &&
formData.smtp_user.trim() !== '' &&
formData.smtp_password.trim() !== '' &&
formData.smtp_sender.trim() !== '';
formData.smtp_host.trim() !== "" &&
formData.smtp_port.trim() !== "" &&
formData.smtp_user.trim() !== "" &&
formData.smtp_password.trim() !== "" &&
formData.smtp_sender.trim() !== "";
// validate email format
const isValidEmail = (email: string) => {
@@ -68,141 +68,155 @@ export const EmailConfigForm: React.FC<EmailConfigFormProps> = ({
};
return (
<Accordion variant='splitted' itemClasses={{
base: 'shadow-none border-1',
}} defaultExpandedKeys={['email-config']} className='px-0'>
<AccordionItem key="email-config" title={
<div className="flex flex-col justify-between">
<h3 className="text-lg font-semibold flex items-center gap-2">
{t('Email Configuration')}
</h3>
<p className="text-sm text-gray-500">{t('Configure SMTP settings for email notifications')}</p>
</div>
}>
<div className="space-y-4">
{/* SMTP server address */}
<Input
label={t('SMTP Host')}
placeholder={t('Enter SMTP server address')}
description={t('SMTP server hostname or IP address')}
value={formData.smtp_host}
onChange={(e) => handleInputChange('smtp_host', e.target.value)}
isRequired
/>
<>
<div className="space-y-4">
{/* SMTP server address */}
<Input
label={t("SMTP Host")}
placeholder={t("Enter SMTP server address")}
description={t("SMTP server hostname or IP address")}
value={formData.smtp_host}
onChange={(e) => handleInputChange("smtp_host", e.target.value)}
isRequired
/>
{/* SMTP port */}
<div className={`flex gap-3 ${isCustomPort ? 'flex-col' : ''}`}>
<div className="flex-1">
<Select
label={t('SMTP Port')}
placeholder={t('Select or enter port')}
description={t('SMTP server port number')}
selectedKeys={isCustomPort ? ["custom"] : (formData.smtp_port ? [formData.smtp_port] : [])}
onSelectionChange={(keys) => {
const selectedPort = Array.from(keys)[0] as string;
if (selectedPort === "custom") {
setIsCustomPort(true);
// 如果当前端口不是预定义端口,保持当前值,否则清空
const predefinedPorts = ["25", "465", "587", "2525"];
if (predefinedPorts.includes(formData.smtp_port)) {
handleInputChange('smtp_port', '');
}
} else if (selectedPort) {
setIsCustomPort(false);
handleInputChange('smtp_port', selectedPort);
{/* SMTP port */}
<div className={`flex gap-3 ${isCustomPort ? "flex-col" : ""}`}>
<div className="flex-1">
<Select
label={t("SMTP Port")}
placeholder={t("Select or enter port")}
description={t("SMTP server port number")}
selectedKeys={
isCustomPort
? ["custom"]
: formData.smtp_port
? [formData.smtp_port]
: []
}
onSelectionChange={(keys) => {
const selectedPort = Array.from(keys)[0] as string;
if (selectedPort === "custom") {
setIsCustomPort(true);
// 如果当前端口不是预定义端口,保持当前值,否则清空
const predefinedPorts = ["25", "465", "587", "2525"];
if (predefinedPorts.includes(formData.smtp_port)) {
handleInputChange("smtp_port", "");
}
}}
isRequired
>
{commonPorts.map((port) => (
<SelectItem key={port.key} value={port.key} textValue={port.label}>
{port.label}
</SelectItem>
))}
</Select>
</div>
{isCustomPort && (
<div className="flex-1">
<Input
label={t('Custom Port')}
placeholder={t('Enter custom port')}
value={formData.smtp_port}
onChange={(e) => handleInputChange('smtp_port', e.target.value)}
type="number"
min="1"
max="65535"
color={formData.smtp_port && !isValidPort(formData.smtp_port) ? "danger" : "default"}
errorMessage={formData.smtp_port && !isValidPort(formData.smtp_port) ? t('Invalid port number') : ""}
isRequired
/>
</div>
)}
} else if (selectedPort) {
setIsCustomPort(false);
handleInputChange("smtp_port", selectedPort);
}
}}
isRequired
>
{commonPorts.map((port) => (
<SelectItem
key={port.key}
value={port.key}
textValue={port.label}
>
{port.label}
</SelectItem>
))}
</Select>
</div>
{/* SMTP username */}
<Input
label={t('SMTP Username')}
placeholder={t('Enter SMTP username')}
description={t('Username for SMTP authentication')}
value={formData.smtp_user}
onChange={(e) => handleInputChange('smtp_user', e.target.value)}
isRequired
/>
{/* SMTP password */}
<Input
label={t('SMTP Password')}
placeholder={t('Enter SMTP password')}
description={t('Password for SMTP authentication')}
value={formData.smtp_password}
onChange={(e) => handleInputChange('smtp_password', e.target.value)}
type={showPassword ? "text" : "password"}
endContent={
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="focus:outline-none"
>
{showPassword ? (
<EyeOff className="w-4 h-4 text-gray-400" />
) : (
<Eye className="w-4 h-4 text-gray-400" />
)}
</button>
}
isRequired
autoComplete='new-password'
/>
{/* sender email */}
<Input
label={t('Sender Email')}
placeholder={t('Enter sender email address')}
description={t('Email address used as sender')}
value={formData.smtp_sender}
onChange={(e) => handleInputChange('smtp_sender', e.target.value)}
type="email"
isRequired
color={formData.smtp_sender && !isValidEmail(formData.smtp_sender) ? "danger" : "default"}
errorMessage={formData.smtp_sender && !isValidEmail(formData.smtp_sender) ? t('Invalid email format') : ""}
/>
{isCustomPort && (
<div className="flex-1">
<Input
label={t("Custom Port")}
placeholder={t("Enter custom port")}
value={formData.smtp_port}
onChange={(e) => handleInputChange("smtp_port", e.target.value)}
type="number"
min="1"
max="65535"
color={
formData.smtp_port && !isValidPort(formData.smtp_port)
? "danger"
: "default"
}
errorMessage={
formData.smtp_port && !isValidPort(formData.smtp_port)
? t("Invalid port number")
: ""
}
isRequired
/>
</div>
)}
</div>
{/* Action Buttons */}
<div className="flex gap-3 py-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isLoading}
isDisabled={!isFormValid}
size='sm'
>
{t('Save')}
</Button>
{/* SMTP username */}
<Input
label={t("SMTP Username")}
placeholder={t("Enter SMTP username")}
description={t("Username for SMTP authentication")}
value={formData.smtp_user}
onChange={(e) => handleInputChange("smtp_user", e.target.value)}
isRequired
/>
</div>
</AccordionItem>
</Accordion>
{/* SMTP password */}
<Input
label={t("SMTP Password")}
placeholder={t("Enter SMTP password")}
description={t("Password for SMTP authentication")}
value={formData.smtp_password}
onChange={(e) => handleInputChange("smtp_password", e.target.value)}
type={showPassword ? "text" : "password"}
endContent={
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="focus:outline-none"
>
{showPassword ? (
<EyeOff className="w-4 h-4 text-gray-400" />
) : (
<Eye className="w-4 h-4 text-gray-400" />
)}
</button>
}
isRequired
autoComplete="new-password"
/>
{/* sender email */}
<Input
label={t("Sender Email")}
placeholder={t("Enter sender email address")}
description={t("Email address used as sender")}
value={formData.smtp_sender}
onChange={(e) => handleInputChange("smtp_sender", e.target.value)}
type="email"
isRequired
color={
formData.smtp_sender && !isValidEmail(formData.smtp_sender)
? "danger"
: "default"
}
errorMessage={
formData.smtp_sender && !isValidEmail(formData.smtp_sender)
? t("Invalid email format")
: ""
}
/>
</div>
{/* Action Buttons */}
<div className="flex gap-3 py-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isLoading}
isDisabled={!isFormValid}
size="sm"
>
{t("Save")}
</Button>
</div>
</>
);
};
};
@@ -13,20 +13,25 @@ import { useTranslation } from "@/shared/lib/useTranslation";
import { EmbeddedHtmlConfig } from "@/shared/types/system";
interface EmbeddedHtmlSettingsProps {
onSave?: (config: EmbeddedHtmlConfig) => void;
config?: EmbeddedHtmlConfig;
onSave?: (config: EmbeddedHtmlConfig) => Promise<boolean>;
config?: EmbeddedHtmlConfig | null;
labelPlacement?: "outside" | "inside";
}
export const EmbeddedHtmlSettings: React.FC<EmbeddedHtmlSettingsProps> = ({
onSave,
config = { html: "", is_enabled: false },
labelPlacement = "inside",
}) => {
const { t } = useTranslation();
const [htmlData, setHtmlData] = useState<EmbeddedHtmlConfig>(config);
const [htmlData, setHtmlData] = useState<EmbeddedHtmlConfig>(
config || { html: "", is_enabled: false }
);
const [isSaving, setIsSaving] = useState(false);
useEffect(() => {
if (!config) return;
setHtmlData(config);
}, [config]);
}, [config?.html, config?.is_enabled]);
const handleSave = async () => {
setIsSaving(true);
@@ -51,84 +56,61 @@ export const EmbeddedHtmlSettings: React.FC<EmbeddedHtmlSettingsProps> = ({
setHtmlData((prev) => ({ ...prev, is_enabled: enabled }));
}
};
return (
<Accordion
variant="splitted"
itemClasses={{
base: "shadow-none border-1",
}}
className="px-0"
defaultExpandedKeys={["embedded-html"]}
>
<AccordionItem
key="embedded-html"
title={
<div className="flex flex-col justify-between">
<h3 className="text-lg font-semibold flex items-center gap-2">
{t("Embedded HTML")}
</h3>
<p className="text-sm text-gray-500">
{t("Configure custom HTML content for global injection")}
</p>
</div>
}
>
<div className="space-y-4">
{/* Enable/Disable Toggle */}
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">
{t("Enable Custom HTML")}
</span>
<span className="text-xs text-gray-500">
{t("Toggle to enable or disable custom HTML injection")}
</span>
const panelContent = () => {
return (
<>
<div className="mb-4">
<div className="space-y-4">
{/* Enable/Disable Toggle */}
<div className="flex items-center justify-between p-4 bg-gray-50 rounded-lg">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium">
{t("Enable Custom HTML")}
</span>
<span className="text-xs text-gray-500">
{t("Toggle to enable or disable custom HTML injection")}
</span>
</div>
<Switch
isSelected={htmlData.is_enabled}
onValueChange={handleToggleEnabled}
color="primary"
size="sm"
/>
</div>
<Switch
isSelected={htmlData.is_enabled}
onValueChange={handleToggleEnabled}
color="primary"
size="sm"
/>
</div>
{/* HTML Editor */}
<div className="space-y-2">
<Textarea
placeholder={t(
"Enter your custom HTML, CSS, or JavaScript code here...\n\nExample:\n<script>\n // Google Analytics\n gtag('config', 'GA_MEASUREMENT_ID');\n</script>\n\n<style>\n .custom-style {\n color: #333;\n }\n</style>"
)}
value={htmlData.html}
onValueChange={handleHtmlChange}
minRows={10}
maxRows={20}
description={t(
"This HTML will be injected globally into the application. You can include script tags, CSS styles, or any valid HTML."
)}
radius="sm"
className="text-xs"
isDisabled={!htmlData.is_enabled}
/>
{/* HTML Editor */}
<div className={`space-y-2 ${htmlData.is_enabled ? "" : "hidden"}`}>
<Textarea
value={htmlData.html}
onValueChange={handleHtmlChange}
minRows={10}
maxRows={20}
description={t(
"This HTML will be injected globally into the application. You can include script tags, CSS styles, or any valid HTML."
)}
radius="sm"
className="text-xs"
isDisabled={!htmlData.is_enabled}
/>
</div>
</div>
{/* Action Buttons */}
{htmlData.is_enabled && (
<div className="flex gap-3 mt-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isSaving}
isDisabled={!htmlData.html.trim()}
size="sm"
>
{t("Save")}
</Button>
</div>
)}
</div>
{/* Action Buttons */}
{htmlData.is_enabled && (
<div className="flex gap-3 py-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isSaving}
isDisabled={!htmlData.html.trim()}
size="sm"
>
{t("Save")}
</Button>
</div>
)}
{/* Usage Instructions */}
<Alert
color="primary"
@@ -159,6 +141,37 @@ export const EmbeddedHtmlSettings: React.FC<EmbeddedHtmlSettingsProps> = ({
</ul>
}
/>
</>
);
};
if (labelPlacement === "outside") {
return panelContent();
}
return (
<Accordion
variant="splitted"
itemClasses={{
base: "shadow-none border-1",
}}
className="px-0"
defaultExpandedKeys={["embedded-html"]}
>
<AccordionItem
key="embedded-html"
title={
<div className="flex flex-col justify-between">
<h3 className="text-lg font-semibold flex items-center gap-2">
{t("Embedded HTML")}
</h3>
<p className="text-sm text-gray-500">
{t("Configure custom HTML content for global injection")}
</p>
</div>
}
>
{panelContent()}
</AccordionItem>
</Accordion>
);
@@ -22,11 +22,13 @@ import { FaqItem } from "@/shared/types/system";
interface FaqSettingsProps {
onSave?: (config: FaqItem[]) => void;
config?: FaqItem[];
labelPlacement?: "inside" | "outside";
}
const defaultFaqs = [{ question: "", answer: "" }];
export const FaqSettings: React.FC<FaqSettingsProps> = ({
onSave,
config = [],
labelPlacement = "inside",
}) => {
const { t } = useTranslation();
const [faqs, setFaqs] = useState<FaqItem[]>(
@@ -110,6 +112,125 @@ export const FaqSettings: React.FC<FaqSettingsProps> = ({
setIsSaving(false);
}
};
const panelContent = () => {
return (
<div className="space-y-4">
{/* FAQ Table */}
<Table
aria-label="FAQ management table"
className="border-1 rounded-lg overflow-hidden"
removeWrapper
classNames={{
thead: "[&>tr]:first:rounded-none",
th: "first:rounded-none last:rounded-none",
}}
>
<TableHeader>
<TableColumn className="w-16">{t("Order")}</TableColumn>
<TableColumn className="w-1/3">{t("Question")}</TableColumn>
<TableColumn>{t("Answer")}</TableColumn>
<TableColumn className="w-32">{t("Actions")}</TableColumn>
</TableHeader>
<TableBody emptyContent={t("No FAQ items available.")}>
{faqs.map((faq, index) => (
<TableRow
key={index}
draggable
onDragStart={() => handleDragStart(index)}
onDragEnter={() => handleDragEnter(index)}
onDragEnd={handleDragEnd}
onDragOver={(e) => e.preventDefault()}
className="cursor-move"
>
<TableCell>
<div className="flex items-center gap-2">
<GripVertical className="w-4 h-4 text-gray-400" />
</div>
</TableCell>
<TableCell>
<Input
value={faq.question}
onValueChange={(value) =>
handleQuestionChange(index, value)
}
size="sm"
placeholder={t("Enter question")}
/>
</TableCell>
<TableCell>
<div className="relative">
<Input
value={faq.answer}
onValueChange={(value) =>
handleAnswerChange(index, value)
}
onFocus={() => setFocusedAnswer(index)}
size="sm"
placeholder={t("Enter answer")}
/>
{focusedAnswer === index && (
<div className="absolute top-0 left-0 right-0 z-50">
<Textarea
value={faq.answer}
onValueChange={(value) =>
handleAnswerChange(index, value)
}
size="sm"
minRows={3}
onBlur={() => setFocusedAnswer(null)}
autoFocus
/>
</div>
)}
</div>
</TableCell>
<TableCell>
<div className="flex gap-1">
<Tooltip content={t("Insert below")}>
<Button
isIconOnly
size="sm"
variant="light"
onPress={() => handleInsertBelow(index)}
>
<Plus className="w-4 h-4" />
</Button>
</Tooltip>
<Tooltip content={t("Delete")} color="danger">
<Button
isIconOnly
size="sm"
variant="light"
color="danger"
onPress={() => handleDelete(index)}
>
<Trash2 className="w-4 h-4" />
</Button>
</Tooltip>
</div>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
<div className="flex ">
<Button
color="primary"
onPress={handleSaveAll}
isLoading={isSaving}
isDisabled={faqs.length === 0}
size="sm"
>
{t("Save")}
</Button>
</div>
</div>
);
};
if (labelPlacement === "outside") {
return panelContent();
}
return (
<Accordion
@@ -133,115 +254,7 @@ export const FaqSettings: React.FC<FaqSettingsProps> = ({
</div>
}
>
<div className="space-y-4">
{/* FAQ Table */}
<Table
aria-label="FAQ management table"
className="border-1 rounded-lg p-2"
removeWrapper
>
<TableHeader>
<TableColumn className="w-16">{t("Order")}</TableColumn>
<TableColumn className="w-1/3">{t("Question")}</TableColumn>
<TableColumn>{t("Answer")}</TableColumn>
<TableColumn className="w-32">{t("Actions")}</TableColumn>
</TableHeader>
<TableBody emptyContent={t("No FAQ items available.")}>
{faqs.map((faq, index) => (
<TableRow
key={index}
draggable
onDragStart={() => handleDragStart(index)}
onDragEnter={() => handleDragEnter(index)}
onDragEnd={handleDragEnd}
onDragOver={(e) => e.preventDefault()}
className="cursor-move"
>
<TableCell>
<div className="flex items-center gap-2">
<GripVertical className="w-4 h-4 text-gray-400" />
</div>
</TableCell>
<TableCell>
<Input
value={faq.question}
onValueChange={(value) =>
handleQuestionChange(index, value)
}
placeholder={t("Enter question")}
size="sm"
/>
</TableCell>
<TableCell>
<div className="relative">
<Input
value={faq.answer}
onValueChange={(value) =>
handleAnswerChange(index, value)
}
onFocus={() => setFocusedAnswer(index)}
placeholder={t("Enter answer")}
size="sm"
/>
{focusedAnswer === index && (
<div className="absolute top-0 left-0 right-0 z-50">
<Textarea
value={faq.answer}
onValueChange={(value) =>
handleAnswerChange(index, value)
}
placeholder={t("Enter answer")}
size="sm"
minRows={3}
onBlur={() => setFocusedAnswer(null)}
autoFocus
/>
</div>
)}
</div>
</TableCell>
<TableCell>
<div className="flex gap-1">
<Tooltip content={t("Insert below")}>
<Button
isIconOnly
size="sm"
variant="light"
onPress={() => handleInsertBelow(index)}
>
<Plus className="w-4 h-4" />
</Button>
</Tooltip>
<Tooltip content={t("Delete")} color="danger">
<Button
isIconOnly
size="sm"
variant="light"
color="danger"
onPress={() => handleDelete(index)}
>
<Trash2 className="w-4 h-4" />
</Button>
</Tooltip>
</div>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
<div className="flex ">
<Button
color="primary"
onPress={handleSaveAll}
isLoading={isSaving}
isDisabled={faqs.length === 0}
size="sm"
>
{t("Save")}
</Button>
</div>
</div>
{panelContent()}
</AccordionItem>
</Accordion>
);
@@ -0,0 +1,86 @@
"use client";
import React, { useState, useEffect } from "react";
import { Button, Select, SelectItem } from "@nextui-org/react";
import { PlatformConfig } from "@/shared/types/system";
import { useTranslation } from "@/shared/lib/useTranslation";
import i18n, { SUPPORTED_LANGUAGES } from "@/shared/lib/i18n";
interface LanguageSettingProps {
config: PlatformConfig;
onSave: (config: PlatformConfig) => void;
}
export const LanguageSetting: React.FC<LanguageSettingProps> = ({
config,
onSave,
}) => {
const { t } = useTranslation();
const [isLoading, setIsLoading] = useState(false);
const [formData, setFormData] = useState<PlatformConfig>(config);
// when context config updated, sync to form
useEffect(() => {
setFormData(config);
}, [config]);
const handleInputChange = (
field: keyof PlatformConfig,
value: string | boolean
) => {
setFormData((prev) => {
const newData = {
...prev,
[field]: value,
};
return newData;
});
};
const handleSave = async () => {
setIsLoading(true);
await onSave(formData);
i18n.changeLanguage(formData.language);
setIsLoading(false);
};
return (
<div className="space-y-4">
<div className="flex flex-col gap-4">
{/* platform language */}
<Select
placeholder={t("Select platform language")}
selectedKeys={formData.language ? [formData.language] : ["en"]}
onSelectionChange={(keys) => {
const selectedKey = Array.from(keys)[0] as string;
if (selectedKey) {
handleInputChange("language", selectedKey);
}
}}
labelPlacement="outside"
>
{SUPPORTED_LANGUAGES.map((language) => (
<SelectItem key={language.name} value={language.name}>
{language.label}
</SelectItem>
))}
</Select>
</div>
{/* Action Buttons */}
<div className="flex gap-3 py-4">
<Button
color="primary"
variant="solid"
onPress={handleSave}
isLoading={isLoading}
size="sm"
>
{t("Save")}
</Button>
</div>
</div>
);
};
@@ -1,6 +1,6 @@
"use client";
import React, { useState, useEffect } from "react";
import React, { useState, useEffect, useMemo, useRef } from "react";
import {
Input,
Button,
@@ -9,6 +9,8 @@ import {
Select,
SelectItem,
Switch,
Card,
Spinner,
} from "@nextui-org/react";
import { PlatformConfig, Theme } from "@/shared/types/system";
import { useTranslation } from "@/shared/lib/useTranslation";
@@ -17,26 +19,37 @@ import { ThemeSelector } from "./ThemeSelector";
import "@uiw/react-md-editor/markdown-editor.css";
import "@uiw/react-markdown-preview/markdown.css";
import toast from "react-hot-toast";
import { UploadIcon } from "lucide-react";
import { calculateFileSha256 } from "@/shared/utils/crypto";
import { withComponentInjection } from "@/shared/hooks/useComponentInjection";
interface PlatformConfigFormProps {
config: PlatformConfig;
onSave: (config: PlatformConfig) => void;
onThemeChange?: (theme: Theme) => Promise<void>;
isLoading?: boolean;
uploadImage: (file: File, sha256?: string) => Promise<string>;
}
export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
const PlatformConfigFormBase: React.FC<PlatformConfigFormProps> = ({
config,
onSave,
onThemeChange,
isLoading = false,
uploadImage,
}) => {
const { t } = useTranslation();
const [formData, setFormData] = useState<PlatformConfig>(config);
const [validationErrors, setValidationErrors] = useState<{
domain?: string;
mcp_server_prefix?: string;
}>({});
const [isUploading, setIsUploading] = useState(false);
const fileInputRef = useRef<HTMLInputElement>(null);
const isValidate = useMemo(() => {
return formData.name.trim().length > 0 && !isUploading;
}, [formData, isUploading]);
// when context config updated, sync to form
useEffect(() => {
@@ -122,6 +135,42 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
handleInputChange("theme", theme);
onThemeChange?.(theme);
};
const handleImageUpload = async (
event: React.ChangeEvent<HTMLInputElement>
) => {
const file = event.target.files?.[0];
if (!file) return;
// Validate file type
if (!file.type.startsWith("image/")) {
toast.error(t("Please select a valid image file"));
return;
}
// Validate file size (max 5MB)
if (file.size > 5 * 1024 * 1024) {
toast.error(t("Image size should be less than 5MB"));
return;
}
setIsUploading(true);
try {
const sha256 = await calculateFileSha256(file);
const imageUrl = await uploadImage(file, sha256);
handleInputChange("logo", imageUrl);
} catch (error) {
console.error("Upload failed:", error);
toast.error(t("Failed to upload image"));
} finally {
setIsUploading(false);
}
};
const handleImageClick = () => {
if (!isUploading) {
fileInputRef.current?.click();
}
};
return (
<div className="space-y-4">
@@ -147,7 +196,7 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
</div>
}
>
<div className="space-y-4">
<div className="flex flex-col gap-4">
{/* platform name */}
<Input
label={t("Platform Name")}
@@ -155,16 +204,53 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
description={t("The name displayed across the platform")}
value={formData.name}
onChange={(e) => handleInputChange("name", e.target.value)}
isRequired
labelPlacement="outside"
/>
{/* platform logo */}
<Input
label={t("Platform Logo URL")}
placeholder="https://example.com/logo.png"
description={t("URL of the platform logo image (optional)")}
value={formData.logo || ""}
onChange={(e) => handleInputChange("logo", e.target.value)}
/>
<div className="space-y-2">
<div>
<label className="text-sm font-medium text-foreground">
{t("Platform Logo")}
</label>
<p className="text-xs text-gray-500">
{t("Support JPG, PNG, GIF. Max size 5MB")}
</p>
</div>
<Card
className={`w-32 h-32 relative group border-1 ${isUploading ? "cursor-not-allowed" : "cursor-pointer"}`}
style={{
backgroundImage: formData.logo
? `url(${formData.logo})`
: "none",
backgroundSize: "contain",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
}}
onPress={handleImageClick}
isPressable={!isUploading}
shadow="none"
>
<div
className={`absolute top-0 right-0 bg-default-500/50 w-full h-full flex items-center justify-center transition-opacity duration-300 ${formData.logo && !isUploading ? "opacity-0" : "opacity-100"
} group-hover:opacity-100`}
>
{isUploading ? (
<Spinner size="lg" color="white" />
) : (
<UploadIcon size={48} className="text-white" />
)}
</div>
</Card>
<input
ref={fileInputRef}
type="file"
accept="image/*"
onChange={handleImageUpload}
className="hidden"
/>
</div>
{/* website title */}
<Input
@@ -177,6 +263,7 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
onChange={(e) =>
handleInputChange("website_title", e.target.value)
}
labelPlacement="outside"
/>
{/* homepage headline */}
@@ -186,6 +273,7 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
description={t("Main headline displayed on the homepage")}
value={formData.headline || ""}
onChange={(e) => handleInputChange("headline", e.target.value)}
labelPlacement="outside"
/>
{/* homepage subheadline */}
@@ -197,6 +285,7 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
)}
value={formData.subheadline || ""}
onChange={(e) => handleInputChange("subheadline", e.target.value)}
labelPlacement="outside"
/>
{/* platform language */}
@@ -210,6 +299,7 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
handleInputChange("language", selectedKey);
}
}}
labelPlacement="outside"
>
{SUPPORTED_LANGUAGES.map((language) => (
<SelectItem key={language.name} value={language.name}>
@@ -229,6 +319,7 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
onChange={(e) => handleInputChange("domain", e.target.value)}
isInvalid={!!validationErrors.domain}
errorMessage={validationErrors.domain}
labelPlacement="outside"
/>
{/* mcp server prefix */}
@@ -244,6 +335,7 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
}
isInvalid={!!validationErrors.mcp_server_prefix}
errorMessage={validationErrors.mcp_server_prefix}
labelPlacement="outside"
/>
{/* showcase in xpack */}
@@ -277,6 +369,7 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
onPress={handleSave}
isLoading={isLoading}
size="sm"
isDisabled={!isValidate}
>
{t("Save")}
</Button>
@@ -315,3 +408,12 @@ export const PlatformConfigForm: React.FC<PlatformConfigFormProps> = ({
</div>
);
};
// Export the base component for direct use (avoiding circular dependency)
export { PlatformConfigFormBase };
// Export with component injection support
export const PlatformConfigForm = withComponentInjection(
"forms/PlatformConfigForm",
PlatformConfigFormBase
);
@@ -26,6 +26,7 @@ import {
interface TopNavigationSettingsProps {
onSave?: (config: TopNavigationItem[]) => void;
config?: TopNavigationItem[];
labelPlacement?: "outside" | "inside";
}
const defaultNavigationItems = [
{ title: "", link: "", target: TopNavigationTargetEnum.BLANK },
@@ -33,6 +34,7 @@ const defaultNavigationItems = [
export const TopNavigationSettings: React.FC<TopNavigationSettingsProps> = ({
onSave,
config = [],
labelPlacement = "inside",
}) => {
const { t } = useTranslation();
const [navigationItems, setNavigationItems] = useState<TopNavigationItem[]>(
@@ -129,6 +131,133 @@ export const TopNavigationSettings: React.FC<TopNavigationSettingsProps> = ({
}
};
const panelContent = () => {
return (
<div className="space-y-4">
{/* Navigation Table */}
<Table
aria-label="Navigation items management table"
className="border-1 rounded-lg overflow-hidden"
removeWrapper
classNames={{
thead: "[&>tr]:first:rounded-none",
th: "first:rounded-none last:rounded-none",
}}
>
<TableHeader>
<TableColumn className="w-8">{t("Order")}</TableColumn>
<TableColumn className="w-1/4">{t("Title")}</TableColumn>
<TableColumn>{t("Link")}</TableColumn>
<TableColumn className="w-32">{t("Target")}</TableColumn>
<TableColumn className="w-8">{t("Actions")}</TableColumn>
</TableHeader>
<TableBody emptyContent={t("No navigation items available.")}>
{navigationItems.map((item, index) => (
<TableRow
key={index}
draggable
onDragStart={() => handleDragStart(index)}
onDragEnter={() => handleDragEnter(index)}
onDragEnd={handleDragEnd}
onDragOver={(e) => e.preventDefault()}
className="cursor-move"
>
<TableCell>
<div className="flex items-center gap-2">
<GripVertical className="w-4 h-4 text-gray-400" />
</div>
</TableCell>
<TableCell>
<Input
value={item.title}
onValueChange={(value) => handleTitleChange(index, value)}
placeholder={t("Enter title")}
size="sm"
/>
</TableCell>
<TableCell>
<Input
value={item.link}
onValueChange={(value) => handleHrefChange(index, value)}
placeholder={t("Enter link URL")}
size="sm"
/>
</TableCell>
<TableCell>
<Select
selectedKeys={[item.target]}
onSelectionChange={(keys) => {
const target = Array.from(keys)[0] as
| TopNavigationTargetEnum.SELF
| TopNavigationTargetEnum.BLANK;
handleTargetChange(index, target);
}}
size="sm"
className="min-w-24"
>
<SelectItem
key={TopNavigationTargetEnum.SELF}
value={TopNavigationTargetEnum.SELF}
>
{t("Same Tab")}
</SelectItem>
<SelectItem
key={TopNavigationTargetEnum.BLANK}
value={TopNavigationTargetEnum.BLANK}
>
{t("New Tab")}
</SelectItem>
</Select>
</TableCell>
<TableCell>
<div className="flex gap-1">
<Tooltip content={t("Insert below")}>
<Button
isIconOnly
size="sm"
variant="light"
onPress={() => handleInsertBelow(index)}
>
<Plus className="w-4 h-4" />
</Button>
</Tooltip>
<Tooltip content={t("Delete")} color="danger">
<Button
isIconOnly
size="sm"
variant="light"
color="danger"
onPress={() => handleDelete(index)}
>
<Trash2 className="w-4 h-4" />
</Button>
</Tooltip>
</div>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
<div className="flex">
<Button
color="primary"
onPress={handleSaveAll}
isLoading={isSaving}
isDisabled={navigationItems.length === 0}
size="sm"
>
{t("Save")}
</Button>
</div>
</div>
);
};
if (labelPlacement === "outside") {
return panelContent();
}
return (
<Accordion
variant="splitted"
@@ -151,120 +280,7 @@ export const TopNavigationSettings: React.FC<TopNavigationSettingsProps> = ({
</div>
}
>
<div className="space-y-4">
{/* Navigation Table */}
<Table
aria-label="Navigation items management table"
className="border-1 rounded-lg p-2"
removeWrapper
>
<TableHeader>
<TableColumn className="w-16">{t("Order")}</TableColumn>
<TableColumn className="w-1/4">{t("Title")}</TableColumn>
<TableColumn className="w-1/3">{t("Link")}</TableColumn>
<TableColumn className="w-32">{t("Target")}</TableColumn>
<TableColumn className="w-32">{t("Actions")}</TableColumn>
</TableHeader>
<TableBody emptyContent={t("No navigation items available.")}>
{navigationItems.map((item, index) => (
<TableRow
key={index}
draggable
onDragStart={() => handleDragStart(index)}
onDragEnter={() => handleDragEnter(index)}
onDragEnd={handleDragEnd}
onDragOver={(e) => e.preventDefault()}
className="cursor-move"
>
<TableCell>
<div className="flex items-center gap-2">
<GripVertical className="w-4 h-4 text-gray-400" />
</div>
</TableCell>
<TableCell>
<Input
value={item.title}
onValueChange={(value) => handleTitleChange(index, value)}
placeholder={t("Enter title")}
size="sm"
/>
</TableCell>
<TableCell>
<Input
value={item.link}
onValueChange={(value) => handleHrefChange(index, value)}
placeholder={t("Enter link URL")}
size="sm"
/>
</TableCell>
<TableCell>
<Select
selectedKeys={[item.target]}
onSelectionChange={(keys) => {
const target = Array.from(keys)[0] as
| TopNavigationTargetEnum.SELF
| TopNavigationTargetEnum.BLANK;
handleTargetChange(index, target);
}}
size="sm"
className="min-w-24"
>
<SelectItem
key={TopNavigationTargetEnum.SELF}
value={TopNavigationTargetEnum.SELF}
>
{t("Same Tab")}
</SelectItem>
<SelectItem
key={TopNavigationTargetEnum.BLANK}
value={TopNavigationTargetEnum.BLANK}
>
{t("New Tab")}
</SelectItem>
</Select>
</TableCell>
<TableCell>
<div className="flex gap-1">
<Tooltip content={t("Insert below")}>
<Button
isIconOnly
size="sm"
variant="light"
onPress={() => handleInsertBelow(index)}
>
<Plus className="w-4 h-4" />
</Button>
</Tooltip>
<Tooltip content={t("Delete")} color="danger">
<Button
isIconOnly
size="sm"
variant="light"
color="danger"
onPress={() => handleDelete(index)}
>
<Trash2 className="w-4 h-4" />
</Button>
</Tooltip>
</div>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
<div className="flex">
<Button
color="primary"
onPress={handleSaveAll}
isLoading={isSaving}
isDisabled={navigationItems.length === 0}
size="sm"
>
{t("Save")}
</Button>
</div>
</div>
{panelContent()}
</AccordionItem>
</Accordion>
);
@@ -11,12 +11,14 @@ import { Navigation } from "@/shared/components/Navigation";
import { Footer } from "@/shared/components/Footer";
import { NavigationItems } from "@/components/theme/Theme.const";
import { AboutContent } from "@/components/about/AboutContent";
import { useNavigationItems } from "@/shared/providers/ConfigProvider";
export const AboutThemeSelector: React.FC = () => {
const { platformConfig, topNavigation } = usePlatformConfig();
const currentTheme = platformConfig.theme || Theme.DEFAULT;
const configNavigation = useNavigationItems() || NavigationItems;
const navigationItems = [
...NavigationItems,
...configNavigation,
...topNavigation.map((item) => ({
label: item.title,
href: item.link,
@@ -15,6 +15,9 @@ import { NavigationItems } from "./Theme.const";
import { copyToClipboard } from "@/shared/utils/clipboard";
import toast from "react-hot-toast";
import { useTranslation } from "react-i18next";
import { sanitizeMCPServerName } from "@/shared/utils/mcp";
import { useNavigationItems } from "@/shared/providers/ConfigProvider";
import { withComponentInjection } from "@/shared/hooks/useComponentInjection";
interface ProductDetailThemeSelectorProps {
product: ServiceData;
@@ -24,7 +27,7 @@ interface ProductDetailThemeSelectorProps {
}[];
}
export const ProductDetailThemeSelector: React.FC<
const BasicProductDetailThemeSelector: React.FC<
ProductDetailThemeSelectorProps
> = ({ product, breadcrumbs }) => {
const { platformConfig, topNavigation } = usePlatformConfig();
@@ -34,8 +37,10 @@ export const ProductDetailThemeSelector: React.FC<
const [url, setUrl] = useState<string>("");
const [mcpName, setMcpName] = useState<string>("");
const { t } = useTranslation();
const configNavigation = useNavigationItems() || NavigationItems;
const navigationItems = [
...NavigationItems,
...configNavigation,
...topNavigation.map((item) => ({
label: item.title,
href: item.link,
@@ -45,26 +50,9 @@ export const ProductDetailThemeSelector: React.FC<
useEffect(() => {
if (url || !product.slug_name) return;
setUrl(
`${mcpServerPrefix || `${window.location.protocol}//${window.location.hostname}:8002`}/mcp/${product.slug_name}`
`${mcpServerPrefix || window.location.origin}/mcp/${product.slug_name}`
);
}, [product.slug_name]);
function sanitizeMCPServerName(rawName: string | undefined): string {
if (!rawName) return "xpack-mcp-service";
// Lower-case & replace invalid chars with hyphen
let name = rawName
.trim()
.toLowerCase()
.replace(/[^a-z0-9-_]+/g, "-");
// Collapse multiple hyphens
name = name.replace(/-+/g, "-");
// Trim leading/trailing hyphens
name = name.replace(/^-+/, "").replace(/-+$/, "");
return name || "mcp-service";
}
useEffect(() => {
setMcpName(sanitizeMCPServerName(product.name));
}, [product.name]);
@@ -74,7 +62,7 @@ export const ProductDetailThemeSelector: React.FC<
"${mcpName || "xpack-mcp-market"}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey={Your-${platformConfig?.name}-API-Key}"
"url": "${url}?authkey={Your-${platformConfig?.name}-Auth-Key}"
}
}
}`;
@@ -154,3 +142,7 @@ export const ProductDetailThemeSelector: React.FC<
);
}
};
export const ProductDetailThemeSelector = withComponentInjection(
"components/theme/ProductDetailThemeSelector",
BasicProductDetailThemeSelector
);
+1 -10
View File
@@ -1,12 +1,3 @@
import { NavigationItem } from "@/shared/components/Navigation";
export const NavigationItems: NavigationItem[] = [
{
label: "Home",
href: "/",
},
{
label: "About",
href: "/about",
},
];
export const NavigationItems: NavigationItem[] = [];
@@ -15,6 +15,7 @@ import { MarketplaceMain } from "../marketplace/Main";
import { Footer } from "@/shared/components/Footer";
import { NavigationItems } from "./Theme.const";
import { Faq } from "../marketplace/Faq";
import { useNavigationItems } from "@/shared/providers/ConfigProvider";
interface ThemeSelectorProps {
initialServices: ServiceData[];
@@ -36,8 +37,9 @@ export const ThemeSelector: React.FC<ThemeSelectorProps> = ({
const router = useRouter();
const { platformConfig, topNavigation } = usePlatformConfig();
const currentTheme = platformConfig.theme || Theme.DEFAULT;
const configNavigation = useNavigationItems() || NavigationItems;
const navigationItems = [
...NavigationItems,
...configNavigation,
...topNavigation.map((item) => ({
label: item.title,
href: item.link,
@@ -53,7 +55,7 @@ export const ThemeSelector: React.FC<ThemeSelectorProps> = ({
const [loading, setLoading] = useState(false);
// search suggestion
const searchSuggestions = ["Search services..."];
const searchSuggestions = ["Search MCP servers"];
// loading service data
const loadServices = async (page: number, search: string) => {
@@ -69,7 +71,7 @@ export const ThemeSelector: React.FC<ThemeSelectorProps> = ({
setTotal(result.page.total);
setCurrentPage(page);
} catch (error) {
console.error("Failed to load services:", error);
console.error("Failed to load servers:", error);
} finally {
setLoading(false);
}
@@ -22,7 +22,7 @@ const ClassicDemo: React.FC = () => {
<div className="bg-gray-100 border-b border-gray-300 px-4 py-1">
<div className="flex space-x-4">
<div className="text-xs text-gray-700 font-medium">Home</div>
<div className="text-xs text-gray-500">Services</div>
<div className="text-xs text-gray-500">Servers</div>
<div className="text-xs text-gray-500">About</div>
</div>
</div>
@@ -47,13 +47,13 @@ const ClassicDemo: React.FC = () => {
{/* Content Section */}
<div className="px-4 py-4 bg-gray-50">
<div className="grid grid-cols-1 gap-3">
{/* Service Item */}
{/* Server Item */}
<div className="bg-white border border-gray-200 rounded-sm p-3 shadow-sm">
<div className="flex items-start space-x-3">
<div className="w-4 h-4 bg-slate-600 rounded-sm mt-0.5"></div>
<div className="flex-1">
<div className="text-xs font-semibold text-slate-800 mb-1">
Business Service
Business Server
</div>
<div className="text-xs text-gray-600">
Professional solutions for enterprise
@@ -62,7 +62,7 @@ const ClassicDemo: React.FC = () => {
</div>
</div>
{/* Service Item */}
{/* Server Item */}
<div className="bg-white border border-gray-200 rounded-sm p-3 shadow-sm">
<div className="flex items-start space-x-3">
<div className="w-4 h-4 bg-red-600 rounded-sm mt-0.5"></div>
@@ -13,6 +13,7 @@ import Link from "next/link";
import { Price } from "@/shared/components/marketplace/Price";
import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext";
import { NavigationItem } from "@/shared/components/Navigation";
import { ServerConfig } from "@/shared/components/marketplace/ServerConfig";
interface DetailProps {
product: ServiceData;
@@ -25,6 +26,7 @@ interface DetailProps {
// navigation items
navItems?: NavigationItem[];
onCopy: () => void;
innerHeaderNode?: React.ReactNode;
}
export const Detail: React.FC<DetailProps> = ({
@@ -33,6 +35,7 @@ export const Detail: React.FC<DetailProps> = ({
mcpName,
navItems = [],
onCopy,
innerHeaderNode,
}) => {
const { t } = useTranslation();
const [activeTab, setActiveTab] = useState("overview");
@@ -47,8 +50,8 @@ export const Detail: React.FC<DetailProps> = ({
<Navigation items={navItems} />
<div>
{/* Classic Product Header */}
<div className="bg-white border-b border-gray-200 shadow-sm pt-28 pb-6">
<div className="mx-auto p-6 max-w-7xl">
<div className="bg-white border-b border-gray-200 shadow-sm pt-20 pb-6">
<div className="mx-auto p-6 max-w-7xl relative">
<div className="bg-gray-50 rounded-sm p-6 border border-gray-200">
<Card shadow="none" className="bg-gray-50">
<CardBody>
@@ -107,6 +110,7 @@ export const Detail: React.FC<DetailProps> = ({
</CardBody>
</Card>
</div>
{innerHeaderNode}
</div>
</div>
@@ -185,7 +189,7 @@ export const Detail: React.FC<DetailProps> = ({
<Card>
<CardBody>
<p className="text-center">
{t("No tools available in this service.")}
{t("No tools available in this server.")}
</p>
</CardBody>
</Card>
@@ -211,40 +215,11 @@ export const Detail: React.FC<DetailProps> = ({
</h3>
</div>
{/* Code Snippet */}
<Card className="w-full max-w-2xl bg-black text-white p-2 sm:p-4 rounded-lg relative z-10">
<div className="text-left font-mono">
<div className="flex items-center gap-2 mb-2 justify-between">
<Chip className="text-white" size="sm" variant="flat">
{platformConfig?.name} MCP
</Chip>
<Button
isIconOnly
size="sm"
variant="flat"
className="min-w-6 w-6 h-6 p-0 text-white"
onPress={onCopy}
aria-label={t("Copy code")}
>
<Copy size={14} />
</Button>
</div>
<pre className="p-2 sm:p-4 rounded-md text-xs overflow-x-auto">
<code className="text-gray-300 whitespace-pre-wrap">
{`{
"mcpServers": {
"${mcpName}": {
"type": "sse",
"autoApprove":"all",
"url": "${url}?apikey=`}
<span className="text-success">{`{Your-${platformConfig?.name}-API-Key}`}</span>
{`"
}
}
}`}
</code>
</pre>
</div>
</Card>
<ServerConfig
mcpName={mcpName}
url={url}
className="w-full max-w-2xl"
/>
</CardBody>
</Card>
</div>
+8 -21
View File
@@ -54,7 +54,6 @@ export const Home: React.FC<HomeProps> = ({
total,
pageSize,
loading,
error,
onSearchChange,
onSearch,
onPageChange,
@@ -65,19 +64,6 @@ export const Home: React.FC<HomeProps> = ({
const { t } = useTranslation();
const totalPages = Math.ceil(total / pageSize);
// 如果有错误,显示错误信息
if (error) {
return (
<div className="min-h-screen bg-gray-50">
<div className="mx-auto h-[100px] flex items-center justify-center">
<div className="text-red-600 bg-white px-6 py-4 rounded-lg shadow-md border border-red-200">
Error: {error}
</div>
</div>
</div>
);
}
return (
<div className="min-h-screen bg-gray-50 top-0 left-0 right-0 bottom-0 flex flex-col justify-between">
<Navigation items={navItems} />
@@ -97,6 +83,7 @@ export const Home: React.FC<HomeProps> = ({
<h1 className="text-4xl lg:text-5xl font-bold mb-6 text-slate-800">
{t(
platformConfig.headline ||
platformConfig.name ||
_DefaultPlatformConfig.headline ||
""
)}
@@ -122,7 +109,7 @@ export const Home: React.FC<HomeProps> = ({
placeholder={
searchSuggestions.length > 0
? t(searchSuggestions[0])
: t("Search services...")
: t("Search MCP servers")
}
value={searchQuery}
onChange={(e) => onSearchChange(e.target.value)}
@@ -153,7 +140,7 @@ export const Home: React.FC<HomeProps> = ({
</div>
</div>
{/* Service List Section */}
{/* Server List Section */}
{loading ? (
<div className="mx-auto h-[200px] flex items-center justify-center">
<div className="bg-white p-8 rounded-lg shadow-md">
@@ -163,24 +150,24 @@ export const Home: React.FC<HomeProps> = ({
) : (
<div className="bg-gray-50 py-16">
<div className="mx-auto px-6 max-w-7xl">
{/* Services Grid */}
{/* Server Grid */}
<div className="flex flex-wrap justify-center gap-4 mb-12">
{services.map((service) => (
<Link
key={service.service_id}
href={`/marketplace/${service.service_id}`}
className="w-full md:w-[calc(50%-16px)] lg:w-[calc(33%-16px)] xl:w-[calc(25%-16px)]"
href={`/server/${service.service_id}`}
className="block group w-full md:w-[calc(50%-16px)] lg:w-[calc(33%-16px)] xl:w-[calc(25%-16px)]"
>
<Card className="group h-[200px] w-full hover:shadow-lg transition-shadow duration-200 cursor-pointer border border-gray-200 bg-white rounded-sm shadow-sm">
<CardBody className="p-4">
{/* Header */}
<div className="flex items-start justify-between mb-3">
<div className="flex items-center gap-2">
<div className="flex items-center gap-2 w-full overflow-hidden">
<div className="w-8 h-8 bg-slate-600 rounded-sm flex items-center justify-center">
<Star className="w-4 h-4 text-white" />
</div>
<div className="flex-1 min-w-0">
<h3 className="font-semibold text-gray-900 text-base mb-1 truncate group-hover:text-slate-700 transition-colors">
<h3 className="font-semibold text-gray-900 text-base mb-1 truncate group-hover:text-slate-700 transition-colors truncate">
{service.name}
</h3>
</div>
Loaded 100 of 258 files, more files were not shown because too many files have changed in this diff. Show more