From 55e3c674b6b09456f0287c469204528f62c260d1 Mon Sep 17 00:00:00 2001 From: Caio Cabral Date: Fri, 29 Nov 2024 10:53:53 -0500 Subject: [PATCH] feat: adding onclick action to tow and differentiating background main dark from background accent dark --- Client/src/Pages/Infrastructure/index.jsx | 132 ++++++++++++---------- Client/src/Utils/Theme/constants.js | 2 +- 2 files changed, 72 insertions(+), 62 deletions(-) diff --git a/Client/src/Pages/Infrastructure/index.jsx b/Client/src/Pages/Infrastructure/index.jsx index dcf8297c4..f8627744a 100644 --- a/Client/src/Pages/Infrastructure/index.jsx +++ b/Client/src/Pages/Infrastructure/index.jsx @@ -124,6 +124,7 @@ function Infrastructure(/* {isAdmin} */) { console.log({ monitors }); console.log(monitors[0]?.checks[0]?.memory.usage_percent); const monitorsAsRows = monitors.map((monitor) => ({ + id: monitor._id, url: monitor.url, name: monitor.name, status: determineState(monitor), @@ -132,10 +133,12 @@ function Infrastructure(/* {isAdmin} */) { mem: monitor?.checks[0]?.memory.usage_percent * 100, disk: monitor?.checks[0]?.disk[0]?.usage_percent * 100, })); - - /* Fix search in monitors page */ - /* Adding actions to the table */ /* Adding click on row action */ + /* Adding actions to the table */ + + function openDetails(id) { + navigate(`/infrastructure/${id}`); + } return ( - { - /* ROWS */ monitorsAsRows.map((row, index) => ( - - {/* TODO iterate over column and get column id, applying row[column.id] */} - - ( + openDetails(row.id)} + sx={{ + cursor: "pointer", + "&:hover": { + backgroundColor: theme.palette.background.accent, + }, + }} + > + {/* TODO iterate over column and get column id, applying row[column.id] */} + + + + + + + + + - - - + + + + + + + + + + + + {/* Get ActionsMenu from Monitor Table and create a component */} + + - - - - - {row.processor} - - - - - - - - - - - - - {/* Get ActionsMenu from Monitor Table and create a component */} - - - - - - )) - } + + + + ))} diff --git a/Client/src/Utils/Theme/constants.js b/Client/src/Utils/Theme/constants.js index 0626edbaa..88a097123 100644 --- a/Client/src/Utils/Theme/constants.js +++ b/Client/src/Utils/Theme/constants.js @@ -168,7 +168,7 @@ const semanticColors = { background: { main: { light: paletteColors.white, - dark: paletteColors.gray850, + dark: paletteColors.gray890, }, alt: { light: paletteColors.gray90,