🐛 fix(node): Locale and form

This commit is contained in:
web@ppanel
2024-12-13 20:43:46 +07:00
parent 11ea821f52
commit 38be4d53b0
5 changed files with 18 additions and 14 deletions
@@ -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();
@@ -278,7 +278,7 @@ export default function NodeForm<T extends { [x: string]: any }>({
>
<TabsList className='h-full w-full flex-wrap md:flex-nowrap'>
{protocols.map((proto) => (
<TabsTrigger value={proto}>
<TabsTrigger value={proto} key={proto}>
{proto.charAt(0).toUpperCase() + proto.slice(1)}
</TabsTrigger>
))}
@@ -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 (
<TooltipProvider>
@@ -73,7 +73,7 @@ export function NodeStatusCell({ status }: { status: API.NodeStatus }) {
<div className='text-xs'>
{t('lastUpdated')}: {formatDate(serverStatus?.updated_at ?? 0)}
</div>
{isOnline && online_users.length > 0 && (
{isOnline && onlineCount > 0 && (
<div className='space-y-2'>
<h4 className='text-sm font-semibold'>{t('onlineUsers')}</h4>
<ScrollArea className='h-[400px] rounded-md border p-2'>