feat: finished

This commit is contained in:
Caio Cabral committed 2025-01-14 19:19:36 -05:00
1 parent 6cdac32bce
commit 8fe200fb8b
7 files changed
+23 -17

No files matched your search

@@ -1,3 +1,8 @@
/* TODO
Should we delete this?
*/
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import { useTheme } from "@emotion/react"; import { useTheme } from "@emotion/react";
@@ -39,7 +39,7 @@ const HttpStatusLabel = ({ status, customStyles }) => {
}, },
default: { default: {
color: theme.palette.primary.contrastText, color: theme.palette.primary.contrastText,
borderColor: theme.palette.primary.lowContrast, borderColor: theme.palette.primary.contrastText,
}, },
}; };
+4 -4
View File
@@ -31,8 +31,8 @@ const BaseLabel = ({ label, styles, children }) => {
className="label" className="label"
sx={{ sx={{
borderRadius: borderRadius, borderRadius: borderRadius,
border: `1px solid ${theme.palette.primary.contrastTextTertiary}`, border: `1px solid ${theme.palette.primary.lowContrast}`,
color: theme.palette.primary.contrastTextTertiary, color: theme.palette.primary.contrastText,
padding: padding, padding: padding,
...styles, ...styles,
}} }}
@@ -126,8 +126,8 @@ const statusToTheme = {
up: "success", up: "success",
down: "error", down: "error",
paused: "warning", paused: "warning",
pending: "secondary", pending: "warning",
"cannot resolve": "tertiary", "cannot resolve": "error",
}; };
const StatusLabel = ({ status, text, customStyles }) => { const StatusLabel = ({ status, text, customStyles }) => {
+5 -11
View File
@@ -137,14 +137,7 @@ function Infrastructure() {
id: "actions", id: "actions",
content: "Actions", content: "Actions",
render: (row) => ( render: (row) => (
<IconButton <IconButton>
sx={{
"& svg path": {
/* TODO check */
stroke: "red" /* theme.palette.other.icon */,
},
}}
>
<InfrastructureMenu <InfrastructureMenu
monitor={row} monitor={row}
isAdmin={isAdmin} isAdmin={isAdmin}
@@ -256,11 +249,12 @@ function Infrastructure() {
<DataTable <DataTable
config={{ config={{
/* TODO this behavior seems to be repeated. Put it on the root table? */
rowSX: { rowSX: {
cursor: "pointer", cursor: "pointer",
"&:hover": { "&:hover td": {
/* TODO check */ backgroundColor: theme.palette.tertiary.main,
backgroundColor: "red" /* theme.palette.background.accent */, transition: "background-color .3s ease",
}, },
}, },
onRowClick: (row) => openDetails(row.id), onRowClick: (row) => openDetails(row.id),
@@ -257,7 +257,7 @@ const UptimeDataTable = ({
height="100%" height="100%"
position="absolute" position="absolute"
sx={{ sx={{
backgroundColor: theme.palette.accent.contrastText, backgroundColor: theme.palette.primary.main,
opacity: 0.8, opacity: 0.8,
zIndex: 100, zIndex: 100,
}} }}
@@ -288,6 +288,7 @@ const UptimeDataTable = ({
cursor: "pointer", cursor: "pointer",
"&:hover td": { "&:hover td": {
backgroundColor: theme.palette.tertiary.main, backgroundColor: theme.palette.tertiary.main,
transition: "background-color .3s ease",
}, },
}, },
onRowClick: (row) => { onRowClick: (row) => {
+5
View File
@@ -169,6 +169,11 @@ const UptimeMonitors = () => {
sx={{ sx={{
fontWeight: 500, fontWeight: 500,
whiteSpace: "nowrap", whiteSpace: "nowrap",
/* TODO IMPORTANT this should be applied to all buttons */
"&:focus-visible": {
outline: `2px solid ${theme.palette.primary.contrastText}`,
outlineOffset: 4,
},
}} }}
> >
Create new Create new
+1
View File
@@ -264,6 +264,7 @@ const baseTheme = (palette) => ({
padding: "0 var(--env-var-spacing-1-minus) !important", padding: "0 var(--env-var-spacing-1-minus) !important",
}, },
"& .MuiOutlinedInput-root": { "& .MuiOutlinedInput-root": {
color: theme.palette.primary.contrastTextSecondary,
borderRadius: 4, borderRadius: 4,
}, },
"& .MuiOutlinedInput-notchedOutline": { "& .MuiOutlinedInput-notchedOutline": {