mirror of
https://github.com/jcreek/OpenNetworkDiagram.git
synced 2026-07-12 18:43:44 +00:00
fix(#3): Address PR comments
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import cytoscape from 'cytoscape';
|
||||
import dagre from 'cytoscape-dagre';
|
||||
import loadNetworkData from '../data/loadNetworkData';
|
||||
import { transformNetworkDataToGraph } from '../graph/transformNetworkData';
|
||||
import transformNetworkDataToGraph from '../graph/transformNetworkData';
|
||||
import Modal from './Modal.svelte';
|
||||
import type { NetworkData } from '../types';
|
||||
import type {
|
||||
@@ -1139,6 +1139,7 @@
|
||||
<button
|
||||
type="button"
|
||||
class:active={cameraMode === 'readable'}
|
||||
aria-pressed={cameraMode === 'readable'}
|
||||
on:click={() => applyCameraMode('readable')}
|
||||
>
|
||||
Readable Fit
|
||||
@@ -1146,11 +1147,12 @@
|
||||
<button
|
||||
type="button"
|
||||
class:active={cameraMode === 'overview'}
|
||||
aria-pressed={cameraMode === 'overview'}
|
||||
on:click={() => applyCameraMode('overview')}
|
||||
>
|
||||
Overview
|
||||
</button>
|
||||
<button type="button" on:click={toggleEthernetLabels}>
|
||||
<button type="button" aria-pressed={showEthernetLabels} on:click={toggleEthernetLabels}>
|
||||
{showEthernetLabels ? 'Hide Ethernet Labels' : 'Show Ethernet Labels'}
|
||||
</button>
|
||||
<button
|
||||
|
||||
@@ -63,7 +63,7 @@ function edgeSpeed(a: number | undefined, b: number | undefined): number | undef
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function transformNetworkDataToGraph(data: NetworkData): GraphTransformResult {
|
||||
export default function transformNetworkDataToGraph(data: NetworkData): GraphTransformResult {
|
||||
const nodes: GraphNodeElement[] = [];
|
||||
const edges: GraphEdgeElement[] = [];
|
||||
const warnings: string[] = [];
|
||||
@@ -118,16 +118,16 @@ export function transformNetworkDataToGraph(data: NetworkData): GraphTransformRe
|
||||
nodeHeight: 110,
|
||||
details: {
|
||||
type: 'machine',
|
||||
name: machine.machineName,
|
||||
ip: machine.ipAddress,
|
||||
role: machine.role,
|
||||
os: machine.operatingSystem,
|
||||
cpu: machine.hardware.cpu,
|
||||
ram: machine.hardware.ram,
|
||||
gpu: machine.hardware.gpu,
|
||||
ports: machinePortsList,
|
||||
vmCount: machineVms.length,
|
||||
vms: machineVms
|
||||
name: machine.machineName,
|
||||
ip: machine.ipAddress,
|
||||
role: machine.role,
|
||||
os: machine.operatingSystem,
|
||||
cpu: machine.hardware?.cpu ?? 'Unknown',
|
||||
ram: machine.hardware?.ram ?? 'Unknown',
|
||||
gpu: machine.hardware?.gpu ?? undefined,
|
||||
ports: machinePortsList,
|
||||
vmCount: machineVms.length,
|
||||
vms: machineVms
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user