reverse-proxy-frontend/src/features/server/components/ServerSummary.js

68 lines
1.8 KiB
JavaScript
Raw Normal View History

2020-05-19 02:18:43 +03:00
import React from "react";
import PropTypes from "prop-types";
2020-05-19 11:40:49 +03:00
import { Grid, Typography, Link } from "@material-ui/core";
2020-05-19 02:18:43 +03:00
import { makeStyles } from "@material-ui/core/styles";
import { useTranslation } from "react-i18next";
import styles from "../../../components/common/styles/gridStyles";
const useStyles = makeStyles(styles);
2020-06-06 01:42:11 +03:00
const ServerSummary = ({
data,
serverHost,
handleOpenInNewTab,
summonWizard
}) => {
2020-05-19 02:18:43 +03:00
const classes = useStyles();
const { t } = useTranslation();
return (
<Grid container>
<Grid item xs={6} sm={3} md={3}>
2020-05-19 02:27:05 +03:00
{`${t("Server.Domain")}: `}
2020-05-19 03:25:42 +03:00
<span className={classes.value}>{data.domain.name}</span>
2020-05-19 02:18:43 +03:00
</Grid>
<Grid item xs={6} sm={3} md={3}>
2020-05-19 02:27:05 +03:00
{`${t("Server.ServerHostName")}: `}
2020-05-19 11:49:32 +03:00
<span className={classes.value}>{serverHost || ""}</span>
2020-05-19 02:27:05 +03:00
</Grid>
<Grid item xs={6} sm={3} md={3}>
2020-05-19 02:27:05 +03:00
{`${t("Server.ApiHostName")}: `}
<span className={classes.value}>{data.hosts.api}</span>
2020-05-19 02:18:43 +03:00
</Grid>
2020-05-19 03:00:28 +03:00
<Grid item xs={6} sm={3} md={3}>
{`${t("Server.DDNSProvider")}: `}
<Link
href="#"
onClick={handleOpenInNewTab(data.domain.provider.url)}
variant="subtitle1"
>
{data.domain.provider.name}
</Link>
</Grid>
2020-05-19 03:00:28 +03:00
<Grid item xs={12} sm={12} md={12}>
<Typography variant="body2" gutterBottom color="textSecondary">
2020-06-06 00:06:08 +03:00
{t("Server.Thoughts")}
2020-06-06 01:42:11 +03:00
<Link href="#" onClick={summonWizard} variant="body2">
{t("Server.Wizard")}
</Link>
.
2020-05-19 03:00:28 +03:00
</Typography>
</Grid>
2020-05-19 02:18:43 +03:00
</Grid>
);
};
ServerSummary.propTypes = {
2020-05-19 03:00:28 +03:00
data: PropTypes.object.isRequired,
2020-05-19 11:49:32 +03:00
serverHost: PropTypes.string,
2020-06-06 01:42:11 +03:00
handleOpenInNewTab: PropTypes.func.isRequired,
summonWizard: PropTypes.func.isRequired
2020-05-19 02:18:43 +03:00
};
export default ServerSummary;