mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-02-16 05:11:10 -05:00
🐛 fix(node): Handle potential null value for online users count
This commit is contained in:
parent
8d49daca21
commit
fa2fb2864f
@ -38,7 +38,7 @@ export function NodeStatusCell({ status }: { status: API.NodeStatus }) {
|
|||||||
const isOnline = updated_at > 0;
|
const isOnline = updated_at > 0;
|
||||||
const badgeVariant = isOnline ? 'default' : 'destructive';
|
const badgeVariant = isOnline ? 'default' : 'destructive';
|
||||||
const badgeText = isOnline ? t('normal') : t('abnormal');
|
const badgeText = isOnline ? t('normal') : t('abnormal');
|
||||||
const onlineCount = Object.keys(online).length || 0;
|
const onlineCount = (online && Object.keys(online).length) || 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user