Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7a10ca678 | ||
|
|
8f0796c031 |
No files matched your search
@@ -328,7 +328,7 @@
|
|||||||
"Current Balance": "Current Balance",
|
"Current Balance": "Current Balance",
|
||||||
"User recharged successfully": "User recharged successfully",
|
"User recharged successfully": "User recharged successfully",
|
||||||
"Please enter a valid amount": "Please enter a valid amount",
|
"Please enter a valid amount": "Please enter a valid amount",
|
||||||
"Minimum recharge amount is $1": "Minimum recharge amount is $1",
|
"Minimum recharge amount is ¥1": "Minimum recharge amount is ¥1",
|
||||||
"User not selected": "User not selected",
|
"User not selected": "User not selected",
|
||||||
"Recharge failed": "Recharge failed",
|
"Recharge failed": "Recharge failed",
|
||||||
"Network error, please try again": "Network error, please try again",
|
"Network error, please try again": "Network error, please try again",
|
||||||
|
|||||||
@@ -330,7 +330,7 @@
|
|||||||
"Current Balance": "当前余额",
|
"Current Balance": "当前余额",
|
||||||
"User recharged successfully": "用户充值成功",
|
"User recharged successfully": "用户充值成功",
|
||||||
"Please enter a valid amount": "请输入有效金额",
|
"Please enter a valid amount": "请输入有效金额",
|
||||||
"Minimum recharge amount is $1": "最低充值金额为 $1",
|
"Minimum recharge amount is ¥1": "最低充值金额为 ¥1",
|
||||||
"User not selected": "未选择用户",
|
"User not selected": "未选择用户",
|
||||||
"Recharge failed": "充值失败",
|
"Recharge failed": "充值失败",
|
||||||
"Network error, please try again": "网络错误,请重试",
|
"Network error, please try again": "网络错误,请重试",
|
||||||
|
|||||||
@@ -233,9 +233,9 @@ const ConsoleStats: React.FC = () => {
|
|||||||
return transformToChartData(analyticsData);
|
return transformToChartData(analyticsData);
|
||||||
}, [analyticsData]);
|
}, [analyticsData]);
|
||||||
|
|
||||||
// Format revenue as currency (USD by default)
|
// Format revenue as currency (CNY by default)
|
||||||
const formatCurrency = (value: number, currency: string = "USD") =>
|
const formatCurrency = (value: number, currency: string = "CNY") =>
|
||||||
new Intl.NumberFormat("en-US", { style: "currency", currency }).format(
|
new Intl.NumberFormat("zh-CN", { style: "currency", currency }).format(
|
||||||
value
|
value
|
||||||
);
|
);
|
||||||
if (loading) {
|
if (loading) {
|
||||||
|
|||||||
@@ -170,25 +170,25 @@ const AccountBalanceTable: React.FC<AccountBalanceTableProps> = ({ userId, sourc
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 格式化金额,带正负号和美元符号
|
// 格式化金额,带正负号和人民币符号
|
||||||
const formatAmount = (amount: string | number): string => {
|
const formatAmount = (amount: string | number): string => {
|
||||||
const numAmount = typeof amount === 'string' ? parseFloat(amount) : amount;
|
const numAmount = typeof amount === 'string' ? parseFloat(amount) : amount;
|
||||||
if (isNaN(numAmount)) return '$0.00';
|
if (isNaN(numAmount)) return '¥0.00';
|
||||||
const absAmount = Math.abs(numAmount).toFixed(2);
|
const absAmount = Math.abs(numAmount).toFixed(2);
|
||||||
if (numAmount > 0) {
|
if (numAmount > 0) {
|
||||||
return `+$${absAmount}`;
|
return `+¥${absAmount}`;
|
||||||
} else if (numAmount < 0) {
|
} else if (numAmount < 0) {
|
||||||
return `-$${absAmount}`;
|
return `-¥${absAmount}`;
|
||||||
}
|
}
|
||||||
return `$${absAmount}`;
|
return `¥${absAmount}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 格式化余额,只显示美元符号,不带正负号
|
// 格式化余额,只显示人民币符号,不带正负号
|
||||||
const formatBalance = (balance: string | number): string => {
|
const formatBalance = (balance: string | number): string => {
|
||||||
const numBalance = typeof balance === 'string' ? parseFloat(balance) : balance;
|
const numBalance = typeof balance === 'string' ? parseFloat(balance) : balance;
|
||||||
if (isNaN(numBalance)) return '$0.00';
|
if (isNaN(numBalance)) return '¥0.00';
|
||||||
|
|
||||||
return `$${Math.abs(numBalance).toFixed(2)}`;
|
return `¥${Math.abs(numBalance).toFixed(2)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getStatusColor = (status: number) => {
|
const getStatusColor = (status: number) => {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ const DefaultDemo: React.FC = () => {
|
|||||||
<span className="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs">
|
<span className="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs">
|
||||||
Beta
|
Beta
|
||||||
</span>
|
</span>
|
||||||
<span className="text-xs text-gray-500">$0.02 /Per Call</span>
|
<span className="text-xs text-gray-500">¥0.02 /Per Call</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ const DefaultDemo: React.FC = () => {
|
|||||||
<span className="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs">
|
<span className="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs">
|
||||||
Beta
|
Beta
|
||||||
</span>
|
</span>
|
||||||
<span className="text-xs text-gray-500">$0.02 /Per Call</span>
|
<span className="text-xs text-gray-500">¥0.02 /Per Call</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const TemuDemo: React.FC = () => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span className="text-xs font-bold text-orange-600">$9.99</span>
|
<span className="text-xs font-bold text-orange-600">¥9.99</span>
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
<Star className="w-2 h-2 text-yellow-400 fill-current" />
|
<Star className="w-2 h-2 text-yellow-400 fill-current" />
|
||||||
<span className="text-xs text-gray-500">4.8</span>
|
<span className="text-xs text-gray-500">4.8</span>
|
||||||
@@ -87,7 +87,7 @@ const TemuDemo: React.FC = () => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span className="text-xs font-bold text-orange-600">$14.99</span>
|
<span className="text-xs font-bold text-orange-600">¥14.99</span>
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
<Star className="w-2 h-2 text-yellow-400 fill-current" />
|
<Star className="w-2 h-2 text-yellow-400 fill-current" />
|
||||||
<span className="text-xs text-gray-500">4.9</span>
|
<span className="text-xs text-gray-500">4.9</span>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export const AdminRechargeModal: React.FC<AdminRechargeModalProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (numAmount < 1) {
|
if (numAmount < 1) {
|
||||||
setError(t("Minimum recharge amount is $1"));
|
setError(t("Minimum recharge amount is ¥1"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ export const AdminRechargeModal: React.FC<AdminRechargeModalProps> = ({
|
|||||||
onChange={handleAmountChange}
|
onChange={handleAmountChange}
|
||||||
startContent={
|
startContent={
|
||||||
<div className="pointer-events-none flex items-center">
|
<div className="pointer-events-none flex items-center">
|
||||||
<span className="text-default-400 text-small">$</span>
|
<span className="text-default-400 text-small">¥</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
isInvalid={!!error}
|
isInvalid={!!error}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const useSystemConfigManagement = () => {
|
|||||||
const [platformConfig, setPlatformConfig] = useState<PlatformConfig>({
|
const [platformConfig, setPlatformConfig] = useState<PlatformConfig>({
|
||||||
name: "",
|
name: "",
|
||||||
logo: "",
|
logo: "",
|
||||||
currency: "USD",
|
currency: "CNY",
|
||||||
});
|
});
|
||||||
const [platformLoading, setPlatformLoading] = useState(false);
|
const [platformLoading, setPlatformLoading] = useState(false);
|
||||||
const [platformError, setPlatformError] = useState<string | null>(null);
|
const [platformError, setPlatformError] = useState<string | null>(null);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export const Price: React.FC<PriceProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
<span className="text-sm font-medium text-green-600">
|
<span className="text-sm font-medium text-green-600">
|
||||||
${priceText.toFixed(2)}
|
¥{priceText.toFixed(2)}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-xs text-gray-500">/{t("Per Call")}</span>
|
<span className="text-xs text-gray-500">/{t("Per Call")}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -51,14 +51,14 @@ export const Price: React.FC<PriceProps> = ({
|
|||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
<span className="text-gray-600">{t("Input")}:</span>
|
<span className="text-gray-600">{t("Input")}:</span>
|
||||||
<span className="font-medium text-green-600">
|
<span className="font-medium text-green-600">
|
||||||
${inputPrice.toFixed(2)}
|
¥{inputPrice.toFixed(2)}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-xs text-gray-500">/{t("1M tokens")}</span>
|
<span className="text-xs text-gray-500">/{t("1M tokens")}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
<span className="text-gray-600">{t("Output")}:</span>
|
<span className="text-gray-600">{t("Output")}:</span>
|
||||||
<span className="font-medium text-blue-600">
|
<span className="font-medium text-blue-600">
|
||||||
${outputPrice.toFixed(2)}
|
¥{outputPrice.toFixed(2)}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-xs text-gray-500">/{t("1M tokens")}</span>
|
<span className="text-xs text-gray-500">/{t("1M tokens")}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const RechargeModal: React.FC<RechargeModalProps> = ({
|
|||||||
// payment channels arrive asynchronously -- fall back to the first one so the
|
// payment channels arrive asynchronously -- fall back to the first one so the
|
||||||
// confirm button is not stuck disabled on a modal opened before they load.
|
// confirm button is not stuck disabled on a modal opened before they load.
|
||||||
const effectiveChannel = selectedPaymentChannel || paymentChannels[0]?.id || "";
|
const effectiveChannel = selectedPaymentChannel || paymentChannels[0]?.id || "";
|
||||||
const currencySymbol = effectiveChannel === "epay" ? "¥" : "$";
|
const currencySymbol = effectiveChannel === "epay" ? "¥" : "¥";
|
||||||
|
|
||||||
const channelLabel = (id: string, name: string) => {
|
const channelLabel = (id: string, name: string) => {
|
||||||
if (id === "epay") return t("Epay (Alipay / WeChat)");
|
if (id === "epay") return t("Epay (Alipay / WeChat)");
|
||||||
@@ -55,7 +55,7 @@ export const RechargeModal: React.FC<RechargeModalProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (numAmount < 1) {
|
if (numAmount < 1) {
|
||||||
setError(t("Minimum recharge amount is $1"));
|
setError(t("Minimum recharge amount is ¥1"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
export const _DefaultPlatformConfig: PlatformConfig = {
|
export const _DefaultPlatformConfig: PlatformConfig = {
|
||||||
name: "XPack",
|
name: "XPack",
|
||||||
logo: "/static/logo/logo.png",
|
logo: "/static/logo/logo.png",
|
||||||
currency: "USD",
|
currency: "CNY",
|
||||||
language: "en",
|
language: "en",
|
||||||
website_title: "Connect Your AI Agent to the Real World - XPack",
|
website_title: "Connect Your AI Agent to the Real World - XPack",
|
||||||
headline: "Connect Your AI Agent to the Real World",
|
headline: "Connect Your AI Agent to the Real World",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export interface CurrencyFormatOptions {
|
|||||||
*/
|
*/
|
||||||
export const formatCurrency = (
|
export const formatCurrency = (
|
||||||
amount: number | undefined | null,
|
amount: number | undefined | null,
|
||||||
currency: string = 'USD',
|
currency: string = 'CNY',
|
||||||
options: CurrencyFormatOptions = {}
|
options: CurrencyFormatOptions = {}
|
||||||
): string => {
|
): string => {
|
||||||
// 处理无效值
|
// 处理无效值
|
||||||
@@ -33,7 +33,7 @@ export const formatCurrency = (
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (showSymbol) {
|
if (showSymbol) {
|
||||||
return new Intl.NumberFormat('en-US', {
|
return new Intl.NumberFormat('zh-CN', {
|
||||||
style: 'currency',
|
style: 'currency',
|
||||||
currency: currency,
|
currency: currency,
|
||||||
minimumFractionDigits,
|
minimumFractionDigits,
|
||||||
@@ -64,7 +64,7 @@ export const formatCurrency = (
|
|||||||
*/
|
*/
|
||||||
export const formatPrice = (
|
export const formatPrice = (
|
||||||
priceInCents: number | undefined | null,
|
priceInCents: number | undefined | null,
|
||||||
currency: string = 'USD',
|
currency: string = 'CNY',
|
||||||
options: CurrencyFormatOptions = {}
|
options: CurrencyFormatOptions = {}
|
||||||
): string => {
|
): string => {
|
||||||
if (priceInCents === undefined || priceInCents === null || isNaN(priceInCents)) {
|
if (priceInCents === undefined || priceInCents === null || isNaN(priceInCents)) {
|
||||||
@@ -80,9 +80,9 @@ export const formatPrice = (
|
|||||||
* @param currency 货币代码
|
* @param currency 货币代码
|
||||||
* @returns 货币符号
|
* @returns 货币符号
|
||||||
*/
|
*/
|
||||||
export const getCurrencySymbol = (currency: string = 'USD'): string => {
|
export const getCurrencySymbol = (currency: string = 'CNY'): string => {
|
||||||
try {
|
try {
|
||||||
const formatter = new Intl.NumberFormat('en-US', {
|
const formatter = new Intl.NumberFormat('zh-CN', {
|
||||||
style: 'currency',
|
style: 'currency',
|
||||||
currency: currency,
|
currency: currency,
|
||||||
minimumFractionDigits: 0,
|
minimumFractionDigits: 0,
|
||||||
@@ -114,7 +114,7 @@ export const getCurrencySymbol = (currency: string = 'USD'): string => {
|
|||||||
*/
|
*/
|
||||||
export const formatBalance = (
|
export const formatBalance = (
|
||||||
balance: number | undefined | null,
|
balance: number | undefined | null,
|
||||||
currency: string = 'USD'
|
currency: string = 'CNY'
|
||||||
): string => {
|
): string => {
|
||||||
return formatCurrency(balance, currency, {
|
return formatCurrency(balance, currency, {
|
||||||
minimumFractionDigits: 2,
|
minimumFractionDigits: 2,
|
||||||
|
|||||||
@@ -3,6 +3,12 @@
|
|||||||
# Description: Dockerfile for XPack
|
# Description: Dockerfile for XPack
|
||||||
FROM python:3.12.11-alpine3.22
|
FROM python:3.12.11-alpine3.22
|
||||||
|
|
||||||
|
# Build-time proxy (needed for apk/pip in restricted networks)
|
||||||
|
ARG HTTP_PROXY
|
||||||
|
ARG HTTPS_PROXY
|
||||||
|
ARG NO_PROXY
|
||||||
|
ENV HTTP_PROXY=$HTTP_PROXY HTTPS_PROXY=$HTTPS_PROXY NO_PROXY=$NO_PROXY
|
||||||
|
|
||||||
RUN apk add nodejs=~22 npm uv nginx
|
RUN apk add nodejs=~22 npm uv nginx
|
||||||
# ENV TZ=Asia/Shanghai
|
# ENV TZ=Asia/Shanghai
|
||||||
# RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
# RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ class Config:
|
|||||||
"/api/web/mcp_services",
|
"/api/web/mcp_services",
|
||||||
"/api/web/mcp_service_info",
|
"/api/web/mcp_service_info",
|
||||||
"/api/payment/callback_stripe",
|
"/api/payment/callback_stripe",
|
||||||
|
# epay (易支付) async notify — called by the gateway, no user token.
|
||||||
|
"/api/payment/callback_epay",
|
||||||
|
"/api/payment/refund_callback_epay",
|
||||||
# "/api/payment/callback_alipay",
|
# "/api/payment/callback_alipay",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user