fix: prevent monitor URL and name overflow using MUI sx prop

This commit is contained in:
varunrmantri23 committed 2025-06-08 14:33:56 +05:30
1 parent 1f6826e045
commit e4ade39db7
5 files changed
+52 -24

No files matched your search

@@ -29,7 +29,12 @@ const Status = ({ monitor }) => {
<Stack> <Stack>
<Typography <Typography
variant="h1" variant="h1"
className="monitor-name-text" sx={{
maxWidth: "45vw",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
> >
{monitor?.name} {monitor?.name}
</Typography> </Typography>
@@ -41,8 +46,14 @@ const Status = ({ monitor }) => {
<PulseDot color={statusColor[determineState(monitor)]} /> <PulseDot color={statusColor[determineState(monitor)]} />
<Typography <Typography
variant="h2" variant="h2"
style={{ fontFamily: "monospace", fontWeight: "bolder" }} sx={{
className="monitor-url-text" fontFamily: "monospace",
fontWeight: "bolder",
maxWidth: "60vw",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
> >
{monitor?.url?.replace(/^https?:\/\//, "") || "..."} {monitor?.url?.replace(/^https?:\/\//, "") || "..."}
</Typography> </Typography>
@@ -23,7 +23,12 @@ const MonitorStatusHeader = ({ path, isLoading = false, isAdmin, monitor }) => {
<Stack> <Stack>
<Typography <Typography
variant="h1" variant="h1"
className="monitor-name-text" sx={{
maxWidth: "60vw",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
> >
{monitor?.name} {monitor?.name}
</Typography> </Typography>
@@ -36,7 +41,14 @@ const MonitorStatusHeader = ({ path, isLoading = false, isAdmin, monitor }) => {
<Typography <Typography
component="h2" component="h2"
variant="h2" variant="h2"
className="monitor-url-text" sx={{
fontFamily: "monospace",
fontWeight: "bolder",
maxWidth: "60vw",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
> >
{monitor?.url?.replace(/^https?:\/\//, "") || "..."} {monitor?.url?.replace(/^https?:\/\//, "") || "..."}
</Typography> </Typography>
+12 -2
View File
@@ -203,7 +203,12 @@ const PageSpeedConfigure = () => {
<Typography <Typography
component="h1" component="h1"
variant="h1" variant="h1"
className="monitor-name-text" sx={{
maxWidth: "60vw",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
> >
{monitor.name} {monitor.name}
</Typography> </Typography>
@@ -236,7 +241,12 @@ const PageSpeedConfigure = () => {
<Typography <Typography
component="h2" component="h2"
variant="h2" variant="h2"
className="monitor-url-text" sx={{
maxWidth: "60vw",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
> >
{monitor.url?.replace(/^https?:\/\//, "") || "..."} {monitor.url?.replace(/^https?:\/\//, "") || "..."}
</Typography> </Typography>
+12 -2
View File
@@ -249,7 +249,12 @@ const Configure = () => {
<Typography <Typography
component="h1" component="h1"
variant="h1" variant="h1"
className="monitor-name-text" sx={{
maxWidth: "60vw",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
> >
{monitor.name} {monitor.name}
</Typography> </Typography>
@@ -282,7 +287,12 @@ const Configure = () => {
<Typography <Typography
component="h2" component="h2"
variant="h2" variant="h2"
className="monitor-url-text" sx={{
maxWidth: "60vw",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
> >
{monitor.url?.replace(/^https?:\/\//, "") || "..."} {monitor.url?.replace(/^https?:\/\//, "") || "..."}
</Typography> </Typography>
-15
View File
@@ -84,21 +84,6 @@ html {
display: none; display: none;
} }
/*adding the classes for handling the overflow of url and name for monitors in one place*/
.monitor-url-text {
max-width: 70vh;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.monitor-name-text {
max-width: 70vh;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@keyframes ripple { @keyframes ripple {
from { from {
opacity: 1; opacity: 1;