fix(#3): Address PR comments

This commit is contained in:
Josh Creek
2026-02-22 14:35:12 +00:00
parent c80ae75550
commit 4fe428ef70
2 changed files with 15 additions and 13 deletions
+4 -2
View File
@@ -3,7 +3,7 @@
import cytoscape from 'cytoscape'; import cytoscape from 'cytoscape';
import dagre from 'cytoscape-dagre'; import dagre from 'cytoscape-dagre';
import loadNetworkData from '../data/loadNetworkData'; import loadNetworkData from '../data/loadNetworkData';
import { transformNetworkDataToGraph } from '../graph/transformNetworkData'; import transformNetworkDataToGraph from '../graph/transformNetworkData';
import Modal from './Modal.svelte'; import Modal from './Modal.svelte';
import type { NetworkData } from '../types'; import type { NetworkData } from '../types';
import type { import type {
@@ -1139,6 +1139,7 @@
<button <button
type="button" type="button"
class:active={cameraMode === 'readable'} class:active={cameraMode === 'readable'}
aria-pressed={cameraMode === 'readable'}
on:click={() => applyCameraMode('readable')} on:click={() => applyCameraMode('readable')}
> >
Readable Fit Readable Fit
@@ -1146,11 +1147,12 @@
<button <button
type="button" type="button"
class:active={cameraMode === 'overview'} class:active={cameraMode === 'overview'}
aria-pressed={cameraMode === 'overview'}
on:click={() => applyCameraMode('overview')} on:click={() => applyCameraMode('overview')}
> >
Overview Overview
</button> </button>
<button type="button" on:click={toggleEthernetLabels}> <button type="button" aria-pressed={showEthernetLabels} on:click={toggleEthernetLabels}>
{showEthernetLabels ? 'Hide Ethernet Labels' : 'Show Ethernet Labels'} {showEthernetLabels ? 'Hide Ethernet Labels' : 'Show Ethernet Labels'}
</button> </button>
<button <button
+4 -4
View File
@@ -63,7 +63,7 @@ function edgeSpeed(a: number | undefined, b: number | undefined): number | undef
return undefined; return undefined;
} }
export function transformNetworkDataToGraph(data: NetworkData): GraphTransformResult { export default function transformNetworkDataToGraph(data: NetworkData): GraphTransformResult {
const nodes: GraphNodeElement[] = []; const nodes: GraphNodeElement[] = [];
const edges: GraphEdgeElement[] = []; const edges: GraphEdgeElement[] = [];
const warnings: string[] = []; const warnings: string[] = [];
@@ -122,9 +122,9 @@ export function transformNetworkDataToGraph(data: NetworkData): GraphTransformRe
ip: machine.ipAddress, ip: machine.ipAddress,
role: machine.role, role: machine.role,
os: machine.operatingSystem, os: machine.operatingSystem,
cpu: machine.hardware.cpu, cpu: machine.hardware?.cpu ?? 'Unknown',
ram: machine.hardware.ram, ram: machine.hardware?.ram ?? 'Unknown',
gpu: machine.hardware.gpu, gpu: machine.hardware?.gpu ?? undefined,
ports: machinePortsList, ports: machinePortsList,
vmCount: machineVms.length, vmCount: machineVms.length,
vms: machineVms vms: machineVms