diff --git a/apps/admin/app/dashboard/server/form-schema.ts b/apps/admin/app/dashboard/server/form-schema.ts index b71638d..411d3c7 100644 --- a/apps/admin/app/dashboard/server/form-schema.ts +++ b/apps/admin/app/dashboard/server/form-schema.ts @@ -13,7 +13,7 @@ const securityConfigSchema = z reality_public_key: nullableString, reality_short_id: nullableString, reality_server_addr: nullableString, - reality_server_port: portSchema, + reality_server_port: portSchema.nullish(), }) .nullish(); diff --git a/apps/admin/app/dashboard/server/node-form.tsx b/apps/admin/app/dashboard/server/node-form.tsx index 285eb70..6f001ce 100644 --- a/apps/admin/app/dashboard/server/node-form.tsx +++ b/apps/admin/app/dashboard/server/node-form.tsx @@ -278,7 +278,7 @@ export default function NodeForm({ > {protocols.map((proto) => ( - + {proto.charAt(0).toUpperCase() + proto.slice(1)} ))} diff --git a/apps/admin/app/dashboard/server/node-status.tsx b/apps/admin/app/dashboard/server/node-status.tsx index b17c1d3..728ee5a 100644 --- a/apps/admin/app/dashboard/server/node-status.tsx +++ b/apps/admin/app/dashboard/server/node-status.tsx @@ -31,7 +31,7 @@ export function NodeStatusCell({ status }: { status: API.NodeStatus }) { const isOnline = last_at > 0; const badgeVariant = isOnline ? 'default' : 'destructive'; const badgeText = isOnline ? t('normal') : t('abnormal'); - const onlineCount = Array.isArray(online_users) ? online_users.length : 0; + const onlineCount = Array.isArray(online_users) ? online_users?.length : 0; return ( @@ -73,7 +73,7 @@ export function NodeStatusCell({ status }: { status: API.NodeStatus }) {
{t('lastUpdated')}: {formatDate(serverStatus?.updated_at ?? 0)}
- {isOnline && online_users.length > 0 && ( + {isOnline && onlineCount > 0 && (

{t('onlineUsers')}

diff --git a/apps/admin/locales/en-US/server.json b/apps/admin/locales/en-US/server.json index 84bcc53..4db599d 100644 --- a/apps/admin/locales/en-US/server.json +++ b/apps/admin/locales/en-US/server.json @@ -37,6 +37,7 @@ "delete": "Delete", "deleteSuccess": "Deleted successfully", "deleteWarning": "Data will not be recoverable after deletion. Please proceed with caution.", + "disk": "Disk", "edit": "Edit", "editNode": "Edit Node", "enable": "Enable", @@ -85,7 +86,7 @@ "selectEncryptionMethod": "Select Encryption Method", "selectNodeGroup": "Select Node Group", "selectProtocol": "Select Protocol", - "serverAddr": "Server IP", + "serverAddr": "Server Address", "serverName": "Service Name", "speedLimit": "Speed Limit", "speedLimitPlaceholder": "Unlimited", @@ -96,14 +97,17 @@ "transportPath": "Transport Path", "transportServerName": "Transport Server Name" }, + "lastUpdated": "Last Updated", + "memory": "Memory", "name": "Name", "node": "Node", "nodeGroup": "Node Group", "normal": "Normal", "onlineCount": "Online users", + "onlineUsers": "Online Users", "rate": "Rate", "relay": "Relay", - "serverAddr": "Server IP", + "serverAddr": "Server Address", "speedLimit": "Speed Limit", "status": "Status", "trafficRatio": "Traffic Rate", diff --git a/apps/admin/locales/zh-CN/server.json b/apps/admin/locales/zh-CN/server.json index 54f84ab..28b2781 100644 --- a/apps/admin/locales/zh-CN/server.json +++ b/apps/admin/locales/zh-CN/server.json @@ -37,13 +37,10 @@ "delete": "删除", "deleteSuccess": "删除成功", "deleteWarning": "删除后,数据将无法恢复。请谨慎操作。", + "disk": "磁盘", "edit": "编辑", "editNode": "编辑节点", "enable": "启用", - "memory": "内存", - "disk": "磁盘", - "lastUpdated": "最后更新", - "onlineUsers": "在线用户", "form": { "allowInsecure": "允许不安全", "cancel": "取消", @@ -54,8 +51,8 @@ "enableTLS": "启用TLS", "encryptionMethod": "加密方法", "flow": "流控算法", - "hopInterval": "中继间隔", - "hopPorts": "中继端口", + "hopInterval": "跳跃间隔", + "hopPorts": "跳跃端口", "hopPortsPlaceholder": "多个端口用逗号分隔", "name": "名称", "nodeGroupId": "节点组ID", @@ -89,7 +86,7 @@ "selectEncryptionMethod": "选择加密方法", "selectNodeGroup": "选择节点组", "selectProtocol": "选择协议", - "serverAddr": "服务器IP", + "serverAddr": "服务器地址", "serverName": "服务名称", "speedLimit": "速度限制", "speedLimitPlaceholder": "无限制", @@ -100,14 +97,17 @@ "transportPath": "传输路径", "transportServerName": "传输服务名称" }, + "lastUpdated": "最后更新", + "memory": "内存", "name": "名称", "node": "节点", "nodeGroup": "节点组", "normal": "正常", "onlineCount": "在线人数", + "onlineUsers": "在线用户", "rate": "速率", "relay": "中继", - "serverAddr": "服务器IP", + "serverAddr": "服务器地址", "speedLimit": "速度限制", "status": "状态", "trafficRatio": "流量速率",