Adds card for showing response times

This commit is contained in:
Alicia Sykes
2023-06-29 23:40:51 +01:00
parent 2907e7b570
commit 0bc0c54e40
9 changed files with 59 additions and 9 deletions

View File

@@ -14,11 +14,11 @@ img {
}
`;
const ScreenshotCard = (screenshot: string): JSX.Element => {
const ScreenshotCard = (screenshot: { data: string }): JSX.Element => {
return (
<Outer>
<Heading as="h3" align="left" color={colors.primary}>Screenshot</Heading>
<img src={screenshot} alt="Full page screenshot" />
<img src={screenshot.data} alt="Full page screenshot" />
</Outer>
);
}

View File

@@ -0,0 +1,29 @@
import styled from 'styled-components';
import colors from 'styles/colors';
import Card from 'components/Form/Card';
import Heading from 'components/Form/Heading';
import Row from 'components/Form/Row';
const Outer = styled(Card)`
span.val {
&.up { color: ${colors.success}; }
&.down { color: ${colors.danger}; }
}
`;
const ServerStatusCard = (serverStatus: any): JSX.Element => {
return (
<Outer>
<Heading as="h3" align="left" color={colors.primary}>Server Status</Heading>
<Row lbl="" val="">
<span className="lbl">Is Up?</span>
{ serverStatus.isUp ? <span className="val up"> Online</span> : <span className="val down"> Offline</span>}
</Row>
<Row lbl="Status Code" val={serverStatus.responseCode} />
{ serverStatus.responseTime && <Row lbl="Response Time" val={`${Math.round(serverStatus.responseTime)}ms`} /> }
</Outer>
);
}
export default ServerStatusCard;

View File

@@ -8,7 +8,6 @@ import Row from 'components/Form/Row';
const Outer = styled(Card)``;
const TxtRecordCard = (records: any): JSX.Element => {
console.log(records);
return (
<Outer>
<Heading as="h3" align="left" color={colors.primary}>TXT Config</Heading>