Add ExcludeFromAnalytics feature with translations and UI components

This commit is contained in:
Tudor Stanciu 2025-07-26 01:56:40 +03:00
parent 346f280796
commit 21040b0158
7 changed files with 72 additions and 1 deletions

View File

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

View File

@ -123,6 +123,10 @@
"Description": "Description",
"Profile": "Profile"
}
},
"ExcludeFromAnalytics": {
"Label": "Exclude from analytics",
"Tooltip": "Exclude this forward from analytics. This will prevent the reverse proxy from collecting any data about this forward."
}
}
},

View File

@ -114,6 +114,10 @@
"Description": "Descriere",
"Profile": "Profil"
}
},
"ExcludeFromAnalytics": {
"Label": "Exclude din analitice",
"Tooltip": "Exclude această redirecționare din analitice. Aceasta va împiedica reverse proxy-ul să colecteze date despre această redirecționare."
}
}
},

View File

@ -8,6 +8,7 @@ import SpecificHeadersCard from "./specificHeaders/SpecificHeadersCard";
import UpstreamSchemeCard from "./upstreamScheme/UpstreamSchemeCard";
import SslPolicyCard from "./sslPolicy/SslPolicyCard";
import IpFilteringCard from "./ipFiltering/IpFilteringCard";
import ExcludeAnalyticsCard from "./analytics/ExcludeAnalyticsCard";
const ForwardOptionsAdvancedComponent = ({ options }) => {
return (
@ -60,6 +61,12 @@ const ForwardOptionsAdvancedComponent = ({ options }) => {
<br />
</>
)}
{options.excludeFromAnalytics && (
<>
<ExcludeAnalyticsCard enabled={options.excludeFromAnalytics} />
<br />
</>
)}
</>
);
};

View File

@ -0,0 +1,27 @@
import React from "react";
import PropTypes from "prop-types";
import ExpandableCard from "../../../../../../components/common/ExpandableCard";
import { useTranslation } from "react-i18next";
import ExcludeAnalyticsSummary from "./ExcludeAnalyticsSummary";
import CancelScheduleSendIcon from "@material-ui/icons/CancelScheduleSend";
const ExcludeAnalyticsCard = ({ enabled }) => {
const { t } = useTranslation();
return (
<ExpandableCard
Icon={<CancelScheduleSendIcon />}
title={t("Forward.Options.ExcludeFromAnalytics.Label")}
subtitle={t("Forward.Options.ExcludeFromAnalytics.Tooltip")}
Summary={<ExcludeAnalyticsSummary enabled={enabled} />}
expandable={false}
Content={<div>...</div>}
/>
);
};
ExcludeAnalyticsCard.propTypes = {
enabled: PropTypes.bool.isRequired
};
export default ExcludeAnalyticsCard;

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 TrailingSlashSummary = ({ enabled }) => {
const { t } = useTranslation();
return (
<Grid container>
<Grid item xs={6} sm={3} md={3}>
{`${t("General.Enabled")}: `}
<ActiveIcon active={enabled} />
</Grid>
</Grid>
);
};
TrailingSlashSummary.propTypes = {
enabled: PropTypes.bool.isRequired
};
export default TrailingSlashSummary;

View File

@ -68,6 +68,11 @@ const ForwardOptionsComponent = ({ title, options }) => {
label: "Forward.Options.IpFiltering.Label",
tooltip: "Forward.Options.IpFiltering.Tooltip",
active: !!options.ipFiltering
},
{
label: "Forward.Options.ExcludeFromAnalytics.Label",
tooltip: "Forward.Options.ExcludeFromAnalytics.Tooltip",
active: !!options.excludeFromAnalytics
}
],
[options]