From 8042876e41cac4efc24a1d17bb7eb4566ab2cb26 Mon Sep 17 00:00:00 2001 From: Mengling Ding <71745861+Meng-20@users.noreply.github.com> Date: Wed, 7 Aug 2024 14:27:48 -0500 Subject: [PATCH] Display port link details including the status, width and speed in the LinkStatus column (#22) * feat: display port link details include the status, width and speed * feat: handle the Linkup status not LinkDown status * fix: handle the format for LinkStatus --- webui/src/components/Stores/BladePortStore.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webui/src/components/Stores/BladePortStore.ts b/webui/src/components/Stores/BladePortStore.ts index 7f552a7..3e05129 100644 --- a/webui/src/components/Stores/BladePortStore.ts +++ b/webui/src/components/Stores/BladePortStore.ts @@ -46,6 +46,15 @@ export const useBladePortStore = defineStore('bladePort', { detailsResponse.data.linkedPortUri = "NOT_FOUND"; } + // Combine LinkStatus, linkWidth and linkSpeed if the port is linked up + if (detailsResponse.data.linkStatus && detailsResponse.data.linkStatus == "Link Up") { + //Remove the space in LinkStatus + const linkeStatus = detailsResponse.data.linkStatus.replace(/\s+/g, ''); + const linkSpeed = detailsResponse.data.currentSpeedGbps; + const linkWidth = detailsResponse.data.width; + detailsResponse.data.linkStatus = linkeStatus + "/" + linkWidth + "/" + linkSpeed + } + // Store port in ports list this.bladePorts.push(detailsResponse.data); }