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>
|
<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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in new issue
Block a user