fix: prevent monitor URL and name overflow using MUI sx prop
This commit is contained in:
1 parent
1f6826e045
commit
e4ade39db7
5 files changed
+52
-24
No files matched your search
@@ -29,7 +29,12 @@ const Status = ({ monitor }) => {
|
||||
<Stack>
|
||||
<Typography
|
||||
variant="h1"
|
||||
className="monitor-name-text"
|
||||
sx={{
|
||||
maxWidth: "45vw",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
}}
|
||||
>
|
||||
{monitor?.name}
|
||||
</Typography>
|
||||
@@ -41,8 +46,14 @@ const Status = ({ monitor }) => {
|
||||
<PulseDot color={statusColor[determineState(monitor)]} />
|
||||
<Typography
|
||||
variant="h2"
|
||||
style={{ fontFamily: "monospace", fontWeight: "bolder" }}
|
||||
className="monitor-url-text"
|
||||
sx={{
|
||||
fontFamily: "monospace",
|
||||
fontWeight: "bolder",
|
||||
maxWidth: "60vw",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
}}
|
||||
>
|
||||
{monitor?.url?.replace(/^https?:\/\//, "") || "..."}
|
||||
</Typography>
|
||||
|
||||
@@ -23,7 +23,12 @@ const MonitorStatusHeader = ({ path, isLoading = false, isAdmin, monitor }) => {
|
||||
<Stack>
|
||||
<Typography
|
||||
variant="h1"
|
||||
className="monitor-name-text"
|
||||
sx={{
|
||||
maxWidth: "60vw",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
}}
|
||||
>
|
||||
{monitor?.name}
|
||||
</Typography>
|
||||
@@ -36,7 +41,14 @@ const MonitorStatusHeader = ({ path, isLoading = false, isAdmin, monitor }) => {
|
||||
<Typography
|
||||
component="h2"
|
||||
variant="h2"
|
||||
className="monitor-url-text"
|
||||
sx={{
|
||||
fontFamily: "monospace",
|
||||
fontWeight: "bolder",
|
||||
maxWidth: "60vw",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
}}
|
||||
>
|
||||
{monitor?.url?.replace(/^https?:\/\//, "") || "..."}
|
||||
</Typography>
|
||||
|
||||
@@ -203,7 +203,12 @@ const PageSpeedConfigure = () => {
|
||||
<Typography
|
||||
component="h1"
|
||||
variant="h1"
|
||||
className="monitor-name-text"
|
||||
sx={{
|
||||
maxWidth: "60vw",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
}}
|
||||
>
|
||||
{monitor.name}
|
||||
</Typography>
|
||||
@@ -236,7 +241,12 @@ const PageSpeedConfigure = () => {
|
||||
<Typography
|
||||
component="h2"
|
||||
variant="h2"
|
||||
className="monitor-url-text"
|
||||
sx={{
|
||||
maxWidth: "60vw",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
}}
|
||||
>
|
||||
{monitor.url?.replace(/^https?:\/\//, "") || "..."}
|
||||
</Typography>
|
||||
|
||||
@@ -249,7 +249,12 @@ const Configure = () => {
|
||||
<Typography
|
||||
component="h1"
|
||||
variant="h1"
|
||||
className="monitor-name-text"
|
||||
sx={{
|
||||
maxWidth: "60vw",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
}}
|
||||
>
|
||||
{monitor.name}
|
||||
</Typography>
|
||||
@@ -282,7 +287,12 @@ const Configure = () => {
|
||||
<Typography
|
||||
component="h2"
|
||||
variant="h2"
|
||||
className="monitor-url-text"
|
||||
sx={{
|
||||
maxWidth: "60vw",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
}}
|
||||
>
|
||||
{monitor.url?.replace(/^https?:\/\//, "") || "..."}
|
||||
</Typography>
|
||||
|
||||
@@ -84,21 +84,6 @@ html {
|
||||
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 {
|
||||
from {
|
||||
opacity: 1;
|
||||
|
||||
Reference in new issue
Block a user