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 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
|
||||||
|
|||||||
@@ -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[] = [];
|
||||||
@@ -118,16 +118,16 @@ export function transformNetworkDataToGraph(data: NetworkData): GraphTransformRe
|
|||||||
nodeHeight: 110,
|
nodeHeight: 110,
|
||||||
details: {
|
details: {
|
||||||
type: 'machine',
|
type: 'machine',
|
||||||
name: machine.machineName,
|
name: machine.machineName,
|
||||||
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user