feat: adding onclick action to tow and differentiating background main dark from background accent dark
This commit is contained in:
1 parent
273294cbb0
commit
55e3c674b6
2 files changed
+19
-9
No files matched your search
@@ -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 (
|
||||
<Stack
|
||||
@@ -211,9 +214,17 @@ function Infrastructure(/* {isAdmin} */) {
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{
|
||||
/* ROWS */ monitorsAsRows.map((row, index) => (
|
||||
<TableRow key={index}>
|
||||
{monitorsAsRows.map((row) => (
|
||||
<TableRow
|
||||
key={row.id}
|
||||
onClick={() => openDetails(row.id)}
|
||||
sx={{
|
||||
cursor: "pointer",
|
||||
"&:hover": {
|
||||
backgroundColor: theme.palette.background.accent,
|
||||
},
|
||||
}}
|
||||
>
|
||||
{/* TODO iterate over column and get column id, applying row[column.id] */}
|
||||
<TableCell>
|
||||
<Host
|
||||
@@ -269,8 +280,7 @@ function Infrastructure(/* {isAdmin} */) {
|
||||
</IconButton>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))
|
||||
}
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
|
||||
@@ -168,7 +168,7 @@ const semanticColors = {
|
||||
background: {
|
||||
main: {
|
||||
light: paletteColors.white,
|
||||
dark: paletteColors.gray850,
|
||||
dark: paletteColors.gray890,
|
||||
},
|
||||
alt: {
|
||||
light: paletteColors.gray90,
|
||||
|
||||
Reference in new issue
Block a user