feat: some colors fixed, table alignment
This commit is contained in:
1 parent
d54272ba30
commit
6cdac32bce
6 files changed
+40
-43
No files matched your search
@@ -24,7 +24,7 @@ const BaseLabel = ({ label, styles, children }) => {
|
|||||||
// Grab the default borderRadius from the theme to match button style
|
// Grab the default borderRadius from the theme to match button style
|
||||||
const { borderRadius } = theme.shape;
|
const { borderRadius } = theme.shape;
|
||||||
// Calculate padding for the label to mimic button. Appears to scale correctly, not 100% sure though.
|
// Calculate padding for the label to mimic button. Appears to scale correctly, not 100% sure though.
|
||||||
const padding = theme.spacing(1 * 0.75, 2);
|
const padding = theme.spacing(3, 5);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
@@ -43,12 +43,22 @@ const DataTable = ({ headers, data, config = { emptyView: "No data" } }) => {
|
|||||||
<Table
|
<Table
|
||||||
stickyHeader
|
stickyHeader
|
||||||
sx={{
|
sx={{
|
||||||
"& :is(th)": { color: theme.palette.primary.contrastText },
|
"&.MuiTable-root :is(.MuiTableHead-root, .MuiTableBody-root) :is(th, td)": {
|
||||||
"& :is(td)": { color: theme.palette.primary.contrastTextSecondary },
|
paddingLeft: theme.spacing(8),
|
||||||
|
},
|
||||||
|
"& :is(th)": {
|
||||||
|
backgroundColor: theme.palette.secondary.main,
|
||||||
|
color: theme.palette.secondary.contrastText,
|
||||||
|
fontWeight: 600,
|
||||||
|
fontSize: "12px",
|
||||||
|
},
|
||||||
|
"& :is(td)": {
|
||||||
|
backgroundColor: theme.palette.primary.main,
|
||||||
|
color: theme.palette.primary.contrastTextSecondary,
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* TODO Check */}
|
<TableHead>
|
||||||
<TableHead sx={{ backgroundColor: theme.palette.secondary.main }}>
|
|
||||||
<TableRow>
|
<TableRow>
|
||||||
{headers.map((header, index) => (
|
{headers.map((header, index) => (
|
||||||
<TableCell
|
<TableCell
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ const UptimeDataTable = ({
|
|||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.spacing(4)}
|
gap={theme.spacing(4)}
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
width="max-content"
|
display={"inline-flex"}
|
||||||
onClick={() => handleSort("status")}
|
onClick={() => handleSort("status")}
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
@@ -168,9 +168,9 @@ const UptimeDataTable = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{sort.order === "asc" ? (
|
{sort.order === "asc" ? (
|
||||||
<ArrowUpwardRoundedIcon />
|
<ArrowUpwardRoundedIcon fontSize="18px" />
|
||||||
) : (
|
) : (
|
||||||
<ArrowDownwardRoundedIcon />
|
<ArrowDownwardRoundedIcon fontSize="18px" />
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -222,17 +222,22 @@ const UptimeDataTable = ({
|
|||||||
direction="row"
|
direction="row"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
mb={theme.spacing(8)}
|
mb={theme.spacing(8)}
|
||||||
|
gap={theme.spacing(2)}
|
||||||
>
|
>
|
||||||
<Heading component="h2">Uptime monitors</Heading>
|
<Heading component="h2">Uptime monitors</Heading>
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
className="current-monitors-counter"
|
className="current-monitors-counter"
|
||||||
/* TODO Check */
|
color={theme.palette.tertiary.contrastText}
|
||||||
color={"red" /* theme.palette.text.primary */}
|
border={2}
|
||||||
border={1}
|
borderColor={theme.palette.accent.main}
|
||||||
/* TODO Check */
|
backgroundColor={theme.palette.tertiary.main}
|
||||||
borderColor={"red" /* theme.palette.border.light */}
|
sx={{
|
||||||
backgroundColor={"red" /* theme.palette.background.accent */}
|
padding: ".25em .75em",
|
||||||
|
borderRadius: "50%",
|
||||||
|
fontSize: "12px",
|
||||||
|
fontWeight: 500,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{monitorCount}
|
{monitorCount}
|
||||||
</Box>
|
</Box>
|
||||||
@@ -252,8 +257,7 @@ const UptimeDataTable = ({
|
|||||||
height="100%"
|
height="100%"
|
||||||
position="absolute"
|
position="absolute"
|
||||||
sx={{
|
sx={{
|
||||||
/* TODO check */
|
backgroundColor: theme.palette.accent.contrastText,
|
||||||
backgroundColor: "red" /* theme.palette.background.main */,
|
|
||||||
opacity: 0.8,
|
opacity: 0.8,
|
||||||
zIndex: 100,
|
zIndex: 100,
|
||||||
}}
|
}}
|
||||||
@@ -270,8 +274,7 @@ const UptimeDataTable = ({
|
|||||||
>
|
>
|
||||||
<CircularProgress
|
<CircularProgress
|
||||||
sx={{
|
sx={{
|
||||||
/* TODO check */
|
color: theme.palette.accent.main,
|
||||||
color: "red" /* theme.palette.other.icon */,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -283,9 +286,8 @@ const UptimeDataTable = ({
|
|||||||
config={{
|
config={{
|
||||||
rowSX: {
|
rowSX: {
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
"&:hover": {
|
"&:hover td": {
|
||||||
/* TODO check */
|
backgroundColor: theme.palette.tertiary.main,
|
||||||
backgroundColor: "red" /* theme.palette.background.accent */,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onRowClick: (row) => {
|
onRowClick: (row) => {
|
||||||
|
|||||||
@@ -4,17 +4,3 @@
|
|||||||
height: var(--env-var-height-2);
|
height: var(--env-var-height-2);
|
||||||
min-width: fit-content;
|
min-width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
.current-monitors-counter {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
padding: 5px;
|
|
||||||
min-width: 25px;
|
|
||||||
min-height: 25px;
|
|
||||||
border-radius: 50%;
|
|
||||||
font-size: var(--env-var-font-size-medium);
|
|
||||||
font-weight: 500;
|
|
||||||
margin-left: 10px;
|
|
||||||
line-height: 0.8;
|
|
||||||
}
|
|
||||||
@@ -58,7 +58,7 @@ const UptimeMonitors = () => {
|
|||||||
|
|
||||||
const getMonitorWithPercentage = useCallback((monitor, theme) => {
|
const getMonitorWithPercentage = useCallback((monitor, theme) => {
|
||||||
let uptimePercentage = "";
|
let uptimePercentage = "";
|
||||||
let percentageColor = "red"; /* theme.palette.percentage.uptimeExcellent */
|
let percentageColor = "";
|
||||||
|
|
||||||
if (monitor.uptimePercentage !== undefined) {
|
if (monitor.uptimePercentage !== undefined) {
|
||||||
uptimePercentage =
|
uptimePercentage =
|
||||||
@@ -66,15 +66,14 @@ const UptimeMonitors = () => {
|
|||||||
? "0"
|
? "0"
|
||||||
: (monitor.uptimePercentage * 100).toFixed(2);
|
: (monitor.uptimePercentage * 100).toFixed(2);
|
||||||
|
|
||||||
/* TODO check */
|
|
||||||
percentageColor =
|
percentageColor =
|
||||||
monitor.uptimePercentage < 0.25
|
monitor.uptimePercentage < 0.25
|
||||||
? "red" /* theme.palette.percentage.uptimePoor */
|
? theme.palette.error.main
|
||||||
: monitor.uptimePercentage < 0.5
|
: monitor.uptimePercentage < 0.5
|
||||||
? "red" /* theme.palette.percentage.uptimeFair */
|
? theme.palette.warning.main
|
||||||
: monitor.uptimePercentage < 0.75
|
: monitor.uptimePercentage < 0.75
|
||||||
? /* theme.palette.percentage.uptimeGood */ "red"
|
? theme.palette.success.main
|
||||||
: "red" /* theme.palette.percentage.uptimeExcellent */;
|
: theme.palette.success.main;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ const semanticColors = {
|
|||||||
const newColors = {
|
const newColors = {
|
||||||
offWhite: "#FEFEFE",
|
offWhite: "#FEFEFE",
|
||||||
offBlack: "#131315",
|
offBlack: "#131315",
|
||||||
gray100: "#EFEFEF",
|
gray100: "#F3F3F3",
|
||||||
gray200: "#E3E3E3",
|
gray200: "#EFEFEF",
|
||||||
gray500: "#A2A3A3",
|
gray500: "#A2A3A3",
|
||||||
blueGray50: "#E8F0FE",
|
blueGray50: "#E8F0FE",
|
||||||
blueGray500: "#475467",
|
blueGray500: "#475467",
|
||||||
|
|||||||
Reference in new issue
Block a user