From 9e791f98af9857f0a2205270df67b599be395664 Mon Sep 17 00:00:00 2001 From: Yaxue Guo Date: Tue, 16 Apr 2024 17:07:00 -0400 Subject: [PATCH] #309: added node type P4 Switch in Slice Builder --- package.json | 2 +- public/index.html | 2 +- src/components/SliceViewer/SideNodes.jsx | 9 ++- .../SliceViewer/SingleComponent.jsx | 2 +- src/pages/NewSliceForm.jsx | 12 ++++ src/services/portalData.json | 2 +- src/utils/sliceBuilder.js | 67 +++++++++++++++++++ 7 files changed, 90 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 79731389..83ad4b4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fabric-portal", - "version": "1.6.4", + "version": "1.6.5", "private": true, "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.32", diff --git a/public/index.html b/public/index.html index 029fb2e3..3f6658d8 100644 --- a/public/index.html +++ b/public/index.html @@ -10,7 +10,7 @@ content="FABRIC Portal" /> - Fabric Portal + FABRIC Portal diff --git a/src/components/SliceViewer/SideNodes.jsx b/src/components/SliceViewer/SideNodes.jsx index 44527312..ae11a94d 100644 --- a/src/components/SliceViewer/SideNodes.jsx +++ b/src/components/SliceViewer/SideNodes.jsx @@ -101,7 +101,7 @@ class SideNodes extends React.Component { } handleAddNode = () => { - // support types: 'VM', 'Facility' + // support types: 'VM', 'Facility', 'P4 Switch' if (this.state.nodeType === "VM") { const { selectedSite, nodeName, core, ram, disk, imageType, selectedImageRef, nodeComponents, BootScript } = this.state; @@ -127,6 +127,10 @@ class SideNodes extends React.Component { bandwidth: 0, vlan: "" }) + } else if (this.state.nodeType === "Switch") { + const { selectedSite, nodeName } = this.state; + this.props.onSwitchAdd(selectedSite.name, nodeName); + this.setState({ nodeName: "" }) } } @@ -385,10 +389,11 @@ class SideNodes extends React.Component { > + { - nodeType === "VM" &&
+ ["VM", "Switch"].includes(nodeType) &&