fix: show visible properties on proxmox container mode node header
This commit is contained in:
@@ -2,6 +2,7 @@ import { Handle, Position, NodeResizer, type NodeProps, type Node } from '@xyflo
|
||||
import { Layers } from 'lucide-react'
|
||||
import type { NodeData } from '@/types'
|
||||
import { resolveNodeColors } from '@/utils/nodeColors'
|
||||
import { resolvePropertyIcon } from '@/utils/propertyIcons'
|
||||
import { useThemeStore } from '@/stores/themeStore'
|
||||
import { THEMES } from '@/utils/themes'
|
||||
import { BaseNode } from './BaseNode'
|
||||
@@ -106,6 +107,27 @@ export function ProxmoxGroupNode(props: NodeProps<Node<NodeData>>) {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Properties */}
|
||||
{data.properties?.filter((p) => p.visible).map((prop, i, arr) => {
|
||||
const Icon = resolvePropertyIcon(prop.icon)
|
||||
return (
|
||||
<div
|
||||
key={prop.key}
|
||||
className="flex items-center gap-1 font-mono text-[10px] min-w-0 overflow-hidden px-2.5 shrink-0"
|
||||
style={{
|
||||
color: theme.colors.nodeSubtextColor,
|
||||
paddingTop: i === 0 ? 4 : 2,
|
||||
paddingBottom: i === arr.length - 1 ? 4 : 2,
|
||||
borderTop: i === 0 ? `1px solid ${glow}22` : undefined,
|
||||
}}
|
||||
>
|
||||
{Icon && <Icon size={9} className="shrink-0" />}
|
||||
<span className="truncate max-w-[60px] shrink-0" title={prop.key}>{prop.key}</span>
|
||||
<span className="truncate min-w-0" title={prop.value}>· {prop.value}</span>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
|
||||
{/* Inner area — React Flow places children here */}
|
||||
<div className="flex-1 relative" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user