From 53f8471d7575873426b10c854ed99f22d02873a6 Mon Sep 17 00:00:00 2001 From: tigattack <10629864+tigattack@users.noreply.github.com> Date: Wed, 24 Sep 2025 23:55:25 +0100 Subject: [PATCH] fix(frontend): Avoid using the index of an array as key property in an element --- frontend/src/pages/Dashboard.jsx | 5 ++++- frontend/src/pages/HostDetail.jsx | 8 ++++---- frontend/src/pages/Hosts.jsx | 4 ++-- frontend/src/pages/Profile.jsx | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index ab0d3f1..2b58ebf 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -1154,7 +1154,10 @@ const Dashboard = () => { return ( <> {cardGroups.map((group, groupIndex) => ( -
+
{group.cards.map((card) => (
{renderCard(card.cardId)}
))} diff --git a/frontend/src/pages/HostDetail.jsx b/frontend/src/pages/HostDetail.jsx index 7728b09..6965591 100644 --- a/frontend/src/pages/HostDetail.jsx +++ b/frontend/src/pages/HostDetail.jsx @@ -490,7 +490,7 @@ const HostDetail = () => {
{host.dns_servers.map((dns, index) => (

{dns} @@ -510,7 +510,7 @@ const HostDetail = () => {

{host.network_interfaces.map((iface, index) => (

{iface.name} @@ -699,7 +699,7 @@ const HostDetail = () => { {host.load_average .filter((load) => load != null) .map((load, index) => ( - + {typeof load === "number" ? load.toFixed(2) : String(load)} @@ -727,7 +727,7 @@ const HostDetail = () => {

{host.disk_details.map((disk, index) => (
diff --git a/frontend/src/pages/Hosts.jsx b/frontend/src/pages/Hosts.jsx index 66e26cd..f229388 100644 --- a/frontend/src/pages/Hosts.jsx +++ b/frontend/src/pages/Hosts.jsx @@ -2139,7 +2139,7 @@ const BulkAssignModal = ({

{selectedHostNames.map((friendlyName, index) => ( -
+
• {friendlyName}
))} @@ -2250,7 +2250,7 @@ const BulkDeleteModal = ({
{selectedHostNames.map((friendlyName, index) => (
• {friendlyName} diff --git a/frontend/src/pages/Profile.jsx b/frontend/src/pages/Profile.jsx index a210adf..1794e36 100644 --- a/frontend/src/pages/Profile.jsx +++ b/frontend/src/pages/Profile.jsx @@ -987,7 +987,7 @@ const TfaTab = () => {
{backupCodes.map((code, index) => (