From 590f229f585500db4044deabacdb808a6e65f1e6 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Tue, 19 May 2020 02:27:05 +0300 Subject: [PATCH] server card update --- public/locales/en/translations.json | 3 +++ public/locales/ro/translations.json | 3 +++ src/features/server/components/ServerComponent.js | 9 +++++++-- src/features/server/components/ServerSummary.js | 13 +++++++++---- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index 7c89a2a..a70e2bf 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -52,6 +52,9 @@ "Version": "Version" }, "Server": { + "Title": "Server", + "Host": "Host", + "ServerHostName": "Server host", "ApiHostName": "API host", "Domain": "Domain", "ActiveSession": "Active session", diff --git a/public/locales/ro/translations.json b/public/locales/ro/translations.json index 7f46415..1e0b036 100644 --- a/public/locales/ro/translations.json +++ b/public/locales/ro/translations.json @@ -43,6 +43,9 @@ "Version": "Versiune" }, "Server": { + "Title": "Server", + "Host": "Gazdă", + "ServerHostName": "Gazdă server", "ApiHostName": "Gazdă API", "Domain": "Domeniu", "ActiveSession": "Sesiune activă", diff --git a/src/features/server/components/ServerComponent.js b/src/features/server/components/ServerComponent.js index b7468f9..9c8bb8c 100644 --- a/src/features/server/components/ServerComponent.js +++ b/src/features/server/components/ServerComponent.js @@ -17,11 +17,14 @@ import MoreVertIcon from "@material-ui/icons/MoreVert"; import DnsRoundedIcon from "@material-ui/icons/DnsRounded"; import styles from "../../../components/common/styles/expandableCardStyles"; import ServerSummary from "./ServerSummary"; +import { useTranslation } from "react-i18next"; const useStyles = makeStyles(styles); const ServerComponent = ({ data }) => { const classes = useStyles(); + const { t } = useTranslation(); + const [expanded, setExpanded] = React.useState(false); const handleExpandClick = () => { @@ -41,8 +44,10 @@ const ServerComponent = ({ data }) => { } - title={Server} - subheader="Host: StaWebSrv" + title={{t("Server.Title")}} + subheader={`${t("Server.Host")}: ${ + data.hosts ? data.hosts.server : "" + }`} /> {data.loaded && } diff --git a/src/features/server/components/ServerSummary.js b/src/features/server/components/ServerSummary.js index d41fca4..ac0b21d 100644 --- a/src/features/server/components/ServerSummary.js +++ b/src/features/server/components/ServerSummary.js @@ -14,13 +14,18 @@ const ServerSummary = ({ data }) => { return ( - {`${t("Server.ApiHostName")}: `} - {data.hosts.api} + {`${t("Server.Domain")}: `} + {data.domain} - {`${t("Server.Domain")}: `} - {data.domain} + {`${t("Server.ServerHostName")}: `} + {data.hosts.server} + + + + {`${t("Server.ApiHostName")}: `} + {data.hosts.api} );