Server.Thoughts

master
Tudor Stanciu 2020-06-06 00:06:08 +03:00
parent 45e3b3ae83
commit 2abc0c9239
4 changed files with 91 additions and 60 deletions

View File

@ -55,6 +55,7 @@
"Server": { "Server": {
"Title": "Server", "Title": "Server",
"Subtitle": "Expand to see details", "Subtitle": "Expand to see details",
"Thoughts": "This reverse proxy is the only open gate to a secret creation land. There any impulse or thought can fly free and can be materialized without limits.",
"ServerHostName": "Server host", "ServerHostName": "Server host",
"ApiHostName": "API host", "ApiHostName": "API host",
"Domain": "Domain", "Domain": "Domain",
@ -64,7 +65,8 @@
"Actions": { "Actions": {
"SendMessageToAuthor": "Send message to author" "SendMessageToAuthor": "Send message to author"
}, },
"MessageForAuthor": "Message for author" "MessageForAuthor": "Message for author",
"Details": "Details"
}, },
"Charts": { "Charts": {
"Server": { "Server": {

View File

@ -46,6 +46,7 @@
"Server": { "Server": {
"Title": "Server", "Title": "Server",
"Subtitle": "Extindeţi pentru a vedea detalii", "Subtitle": "Extindeţi pentru a vedea detalii",
"Thoughts": "Acest reverse proxy este singura poartă deschisă către un teren secret al creației. Acolo orice impuls sau gând poate zbura liber și poate fi materializat fără limite.",
"ServerHostName": "Gazdă server", "ServerHostName": "Gazdă server",
"ApiHostName": "Gazdă API", "ApiHostName": "Gazdă API",
"Domain": "Domeniu", "Domain": "Domeniu",
@ -55,7 +56,8 @@
"Actions": { "Actions": {
"SendMessageToAuthor": "Trimite mesaj către autor" "SendMessageToAuthor": "Trimite mesaj către autor"
}, },
"MessageForAuthor": "Mesaj pentru autor" "MessageForAuthor": "Mesaj pentru autor",
"Details": "Detalii"
}, },
"Charts": { "Charts": {
"Server": { "Server": {

View File

@ -10,7 +10,9 @@ import {
Collapse, Collapse,
Avatar, Avatar,
IconButton, IconButton,
Tooltip Tooltip,
Menu,
MenuItem
} from "@material-ui/core"; } from "@material-ui/core";
import ShareIcon from "@material-ui/icons/Share"; import ShareIcon from "@material-ui/icons/Share";
import ExpandMoreIcon from "@material-ui/icons/ExpandMore"; import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
@ -35,12 +37,36 @@ const ServerComponent = ({
const { t } = useTranslation(); const { t } = useTranslation();
const [expanded, setExpanded] = React.useState(false); const [expanded, setExpanded] = React.useState(false);
const [anchorEl, setAnchorEl] = React.useState(null);
const handleExpandClick = () => { const handleExpandClick = () => {
setExpanded(!expanded); setExpanded(!expanded);
}; };
const handleClick = (event) => {
setAnchorEl(event.currentTarget);
};
const handleClose = () => {
setAnchorEl(null);
};
const handleDetailsClick = () => {
openAbout();
handleClose();
};
return ( return (
<>
<Menu
id="server-details-menu"
anchorEl={anchorEl}
keepMounted
open={Boolean(anchorEl)}
onClose={handleClose}
>
<MenuItem onClick={handleDetailsClick}>{t("Server.Details")}</MenuItem>
</Menu>
<Card> <Card>
<CardHeader <CardHeader
avatar={ avatar={
@ -49,7 +75,11 @@ const ServerComponent = ({
</Avatar> </Avatar>
} }
action={ action={
<IconButton aria-label="settings"> <IconButton
aria-label="settings"
onClick={handleClick}
color="primary"
>
<MoreVertIcon /> <MoreVertIcon />
</IconButton> </IconButton>
} }
@ -61,14 +91,16 @@ const ServerComponent = ({
<ServerSummary <ServerSummary
data={data} data={data}
serverHost={serverHost} serverHost={serverHost}
openAbout={openAbout}
handleOpenInNewTab={handleOpenInNewTab} handleOpenInNewTab={handleOpenInNewTab}
/> />
)} )}
</CardContent> </CardContent>
<CardActions disableSpacing> <CardActions disableSpacing>
<Tooltip title={t("Server.Actions.SendMessageToAuthor")}> <Tooltip title={t("Server.Actions.SendMessageToAuthor")}>
<IconButton aria-label="sent message" onClick={showMessageForAuthor}> <IconButton
aria-label="sent message"
onClick={showMessageForAuthor}
>
<MessageRoundedIcon /> <MessageRoundedIcon />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
@ -92,6 +124,7 @@ const ServerComponent = ({
</CardContent> </CardContent>
</Collapse> </Collapse>
</Card> </Card>
</>
); );
}; };

View File

@ -7,7 +7,7 @@ import styles from "../../../components/common/styles/gridStyles";
const useStyles = makeStyles(styles); const useStyles = makeStyles(styles);
const ServerSummary = ({ data, serverHost, openAbout, handleOpenInNewTab }) => { const ServerSummary = ({ data, serverHost, handleOpenInNewTab }) => {
const classes = useStyles(); const classes = useStyles();
const { t } = useTranslation(); const { t } = useTranslation();
@ -41,12 +41,7 @@ const ServerSummary = ({ data, serverHost, openAbout, handleOpenInNewTab }) => {
<Grid item xs={12} sm={12} md={12}> <Grid item xs={12} sm={12} md={12}>
<Typography variant="body2" gutterBottom color="textSecondary"> <Typography variant="body2" gutterBottom color="textSecondary">
{ {t("Server.Thoughts")}
"Bla bla bla, bla bla bla, bla bla bla, Bla bla bla, bla bla bla, bla bla bla, Bla bla bla, bla bla bla. Pentru mai multe detalii click "
}
<Link href="#" onClick={openAbout} variant="body2">
{"aici"}
</Link>
</Typography> </Typography>
</Grid> </Grid>
</Grid> </Grid>
@ -56,7 +51,6 @@ const ServerSummary = ({ data, serverHost, openAbout, handleOpenInNewTab }) => {
ServerSummary.propTypes = { ServerSummary.propTypes = {
data: PropTypes.object.isRequired, data: PropTypes.object.isRequired,
serverHost: PropTypes.string, serverHost: PropTypes.string,
openAbout: PropTypes.func.isRequired,
handleOpenInNewTab: PropTypes.func.isRequired handleOpenInNewTab: PropTypes.func.isRequired
}; };