mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-17 14:08:19 +00:00
fix(fleet): filter invalid version strings from UI display (#399)
Treat 'unknown' and '0.0.0-dev' as absent versions in the node switcher, fleet overview, and capability gate. Remote nodes running older Docker images that return these fallback values now show a clean label instead of "vunknown".
This commit is contained in:
@@ -15,7 +15,8 @@ export function CapabilityGate({ capability, featureName = 'This feature', child
|
||||
if (hasCapability(capability)) return <>{children}</>;
|
||||
|
||||
const nodeName = activeNode?.name ?? 'this node';
|
||||
const versionHint = activeNodeMeta?.version
|
||||
const hasValidVersion = activeNodeMeta?.version && activeNodeMeta.version !== 'unknown' && activeNodeMeta.version !== '0.0.0-dev';
|
||||
const versionHint = hasValidVersion
|
||||
? `${nodeName} is running v${activeNodeMeta.version}`
|
||||
: `${nodeName} does not support this capability`;
|
||||
|
||||
|
||||
@@ -1350,7 +1350,7 @@ export default function EditorLayout() {
|
||||
node.status === 'offline' ? 'bg-red-500' : 'bg-gray-400'
|
||||
}`} />
|
||||
<span>{node.name}</span>
|
||||
{meta?.version && (
|
||||
{meta?.version && meta.version !== 'unknown' && meta.version !== '0.0.0-dev' && (
|
||||
<span className="font-mono text-[10px] tabular-nums text-muted-foreground/60 ml-auto">
|
||||
v{meta.version}
|
||||
</span>
|
||||
|
||||
@@ -1218,7 +1218,7 @@ export function FleetView({ onNavigateToNode }: FleetViewProps) {
|
||||
|
||||
{/* Current version */}
|
||||
<span className="text-xs font-mono tabular-nums text-muted-foreground">
|
||||
{s.version ? `v${s.version}` : <span className="text-muted-foreground/50 italic text-[10px]">unknown</span>}
|
||||
{s.version && s.version !== 'unknown' && s.version !== '0.0.0-dev' ? `v${s.version}` : <span className="text-muted-foreground/50 italic text-[10px]">unknown</span>}
|
||||
</span>
|
||||
|
||||
{/* Latest version */}
|
||||
|
||||
Reference in New Issue
Block a user