Added all options

master
Tudor Stanciu 2021-05-15 02:50:05 +03:00
parent a8825a69d6
commit 9498033838
3 changed files with 51 additions and 30 deletions

View File

@ -44,7 +44,11 @@
"TrailingSlash": "Trailing slash", "TrailingSlash": "Trailing slash",
"TrailingSlashTooltip": "A trailing slash is the forward slash placed at the end of a URL. The trailing slash is generally used to mark a directory, and if a URL is not terminated using a trailing slash, this generally points to a file.", "TrailingSlashTooltip": "A trailing slash is the forward slash placed at the end of a URL. The trailing slash is generally used to mark a directory, and if a URL is not terminated using a trailing slash, this generally points to a file.",
"PathOverwrite": "Path overwrite", "PathOverwrite": "Path overwrite",
"PathOverwriteTooltip": "Option by which the base path of the application is automatically overwritten in all http text responses received from it." "PathOverwriteTooltip": "Option by which the base path of the application is automatically overwritten in all http text responses received from it.",
"PathInjection": "Path injection",
"PathInjectionTooltip": "PathInjection is useful for applications that doesn't have a configuration for base path. With this option, the reverse proxy server will try to inject the base path in each link from each reasponse content.",
"KeyOverwrite": "Key overwrite",
"KeyOverwriteTooltip": "KeyOverwrite can be used to replace any key from all http responses of a forward."
} }
} }
}, },

View File

@ -35,7 +35,11 @@
"TrailingSlash": "Trailing slash", "TrailingSlash": "Trailing slash",
"TrailingSlashTooltip": "Bara oblică plasată la sfarșitul unei adrese URL. Slash-ul final este de obicei utilizat pentru a marca un director și dacă o adresă URL nu este încheiată folosind o bară oblică, aceasta indică în general un fișier.", "TrailingSlashTooltip": "Bara oblică plasată la sfarșitul unei adrese URL. Slash-ul final este de obicei utilizat pentru a marca un director și dacă o adresă URL nu este încheiată folosind o bară oblică, aceasta indică în general un fișier.",
"PathOverwrite": "Path overwrite", "PathOverwrite": "Path overwrite",
"PathOverwriteTooltip": "Opțiune prin care calea de bază a aplicației este suprascrisă automat în toate răspunsurile de text http primite de la aceasta." "PathOverwriteTooltip": "Opțiune prin care calea de bază a aplicației este suprascrisă automat în toate răspunsurile de text http primite de la aceasta.",
"PathInjection": "Path injection",
"PathInjectionTooltip": "PathInjection este util pentru aplicațiile care nu au o configurație pentru calea de bază. Cu această opțiune, serverul proxy invers va încerca să injecteze calea de bază în fiecare link din fiecare conținut de răspuns.",
"KeyOverwrite": "Key overwrite",
"KeyOverwriteTooltip": "KeyOverwrite poate fi utilizat pentru a înlocui orice cheie din toate răspunsurile http ale unei redirecționări."
} }
} }
}, },

View File

@ -1,4 +1,4 @@
import React from "react"; import React, { useMemo } from "react";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { makeStyles } from "@material-ui/core/styles"; import { makeStyles } from "@material-ui/core/styles";
import { import {
@ -27,6 +27,32 @@ const ForwardOptionsComponent = ({ title, options }) => {
const loading = !options || options.loading; const loading = !options || options.loading;
const elements = useMemo(
() => [
{
label: "Session.Forwards.Options.TrailingSlash",
tooltip: "Session.Forwards.Options.TrailingSlashTooltip",
active: options.trailingSlash
},
{
label: "Session.Forwards.Options.PathOverwrite",
tooltip: "Session.Forwards.Options.PathOverwriteTooltip",
active: options.pathOverwrite?.on
},
{
label: "Session.Forwards.Options.PathInjection",
tooltip: "Session.Forwards.Options.PathInjectionTooltip",
active: options.pathInjection?.on
},
{
label: "Session.Forwards.Options.KeyOverwrite",
tooltip: "Session.Forwards.Options.KeyOverwriteTooltip",
active: options.keyOverwrite?.on
}
],
[options]
);
return ( return (
<> <>
<TableContainer component={Paper}> <TableContainer component={Paper}>
@ -46,33 +72,20 @@ const ForwardOptionsComponent = ({ title, options }) => {
</TableRow> </TableRow>
</TableHead> </TableHead>
<TableBody> <TableBody>
<StyledTableRow> <>
<Tooltip {elements.map(element => {
title={t("Session.Forwards.Options.TrailingSlashTooltip")} return (
> <StyledTableRow key={element.label}>
<StyledTableCell> <Tooltip title={t(element.tooltip)}>
{t("Session.Forwards.Options.TrailingSlash")} <StyledTableCell>{t(element.label)}</StyledTableCell>
</StyledTableCell> </Tooltip>
</Tooltip> <StyledTableCell align="center">
<StyledTableCell align="center"> <ActiveIcon active={element.active} loading={loading} />
<ActiveIcon active={options.trailingSlash} loading={loading} /> </StyledTableCell>
</StyledTableCell> </StyledTableRow>
</StyledTableRow> );
<StyledTableRow> })}
<Tooltip </>
title={t("Session.Forwards.Options.PathOverwriteTooltip")}
>
<StyledTableCell>
{t("Session.Forwards.Options.PathOverwrite")}
</StyledTableCell>
</Tooltip>
<StyledTableCell align="center">
<ActiveIcon
active={options.pathOverwrite?.on}
loading={loading}
/>
</StyledTableCell>
</StyledTableRow>
</TableBody> </TableBody>
</Table> </Table>
</TableContainer> </TableContainer>