[1.4.10] Display UpstreamScheme option

This commit is contained in:
Tudor Stanciu 2023-03-23 00:25:21 +02:00
parent 4fc6d90866
commit 201fdbf7b8
8 changed files with 72 additions and 2 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "reverse-proxy-frontend",
"version": "1.4.9",
"version": "1.4.10",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "reverse-proxy-frontend",
"version": "1.4.9",
"version": "1.4.10",
"private": true,
"description": "Reverse proxy frontend application",
"author": {

View File

@ -57,6 +57,10 @@
"Label": "Trailing slash",
"Tooltip": "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."
},
"UpstreamScheme": {
"Label": "Upstream scheme",
"Tooltip": "UpstreamScheme option will force the reverse proxy to set on the HttpRequest the scheme found in the headers 'X-Forwarded-Scheme' or 'X-Forwarded-Proto'."
},
"PathOverwrite": {
"Label": "Path overwrite",
"Tooltip": "Option by which the base path of the application is automatically overwritten in all http text responses received from it."

View File

@ -48,6 +48,10 @@
"Label": "Trailing slash",
"Tooltip": "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."
},
"UpstreamScheme": {
"Label": "Upstream scheme",
"Tooltip": "Opțiunea UpstreamScheme va forța proxy-ul invers să seteze pe HttpRequest schema găsită în anteturile 'X-Forwarded-Scheme' sau 'X-Forwarded-Proto'."
},
"PathOverwrite": {
"Label": "Path overwrite",
"Tooltip": "Opțiune prin care calea de bază a aplicației este suprascrisă automat în toate răspunsurile de text http primite de la aceasta."

View File

@ -5,6 +5,7 @@ import PathOverwriteCard from "./pathOverwrite/PathOverwriteCard";
import PathInjectionCard from "./pathInjection/PathInjectionCard";
import KeyOverwriteCard from "./keyOverwrite/KeyOverwriteCard";
import SpecificHeadersCard from "./specificHeaders/SpecificHeadersCard";
import UpstreamSchemeCard from "./upstreamScheme/UpstreamSchemeCard";
const ForwardOptionsAdvancedComponent = ({ options }) => {
return (
@ -39,6 +40,12 @@ const ForwardOptionsAdvancedComponent = ({ options }) => {
<br />
</>
)}
{options.upstreamScheme && (
<>
<UpstreamSchemeCard enabled={options.upstreamScheme} />
<br />
</>
)}
</>
);
};

View File

@ -0,0 +1,26 @@
import React from "react";
import PropTypes from "prop-types";
import ExpandableCard from "../../../../../../components/common/ExpandableCard";
import { useTranslation } from "react-i18next";
import UpstreamSchemeSummary from "./UpstreamSchemeSummary";
import FlipToFrontIcon from "@material-ui/icons/FlipToFront";
const UpstreamSchemeCard = ({ enabled }) => {
const { t } = useTranslation();
return (
<ExpandableCard
Icon={<FlipToFrontIcon />}
title={t("Forward.Options.UpstreamScheme.Label")}
subtitle={t("Forward.Options.UpstreamScheme.Tooltip")}
Summary={<UpstreamSchemeSummary enabled={enabled} />}
Content={<div>...</div>}
/>
);
};
UpstreamSchemeCard.propTypes = {
enabled: PropTypes.bool.isRequired
};
export default UpstreamSchemeCard;

View File

@ -0,0 +1,24 @@
import React from "react";
import PropTypes from "prop-types";
import { Grid } from "@material-ui/core";
import { useTranslation } from "react-i18next";
import ActiveIcon from "../../../../../../components/common/ActiveIcon";
const UpstreamSchemeSummary = ({ enabled }) => {
const { t } = useTranslation();
return (
<Grid container>
<Grid item xs={6} sm={3} md={3}>
{`${t("General.Enabled")}: `}
<ActiveIcon active={enabled} />
</Grid>
</Grid>
);
};
UpstreamSchemeSummary.propTypes = {
enabled: PropTypes.bool.isRequired
};
export default UpstreamSchemeSummary;

View File

@ -53,6 +53,11 @@ const ForwardOptionsComponent = ({ title, options }) => {
label: "Forward.Options.SpecificHeaders.Label",
tooltip: "Forward.Options.SpecificHeaders.Tooltip",
active: options.specificHeaders?.on
},
{
label: "Forward.Options.UpstreamScheme.Label",
tooltip: "Forward.Options.UpstreamScheme.Tooltip",
active: options.upstreamScheme
}
],
[options]