mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: improve traffic messaging summary (#6922)
Minor tweaks to traffic messaging summary.
This commit is contained in:
parent
f5061bc3ff
commit
1b2f983974
@ -85,7 +85,9 @@ const getSelectablePeriods = (): SelectablePeriod[] => {
|
||||
current.getMonth() - subtractMonthCount,
|
||||
1,
|
||||
);
|
||||
selectablePeriods.push(toSelectablePeriod(date));
|
||||
if (date > new Date('2024-03-31')) {
|
||||
selectablePeriods.push(toSelectablePeriod(date));
|
||||
}
|
||||
}
|
||||
return selectablePeriods;
|
||||
};
|
||||
@ -357,7 +359,7 @@ export const NetworkTrafficUsage: VFC = () => {
|
||||
return (
|
||||
<ConditionallyRender
|
||||
condition={isOss() || !flagEnabled}
|
||||
show={<Alert severity='warning'>No data available.</Alert>}
|
||||
show={<Alert severity='warning'>Not enabled.</Alert>}
|
||||
elseShow={
|
||||
<>
|
||||
<StyledBox>
|
||||
|
@ -53,6 +53,7 @@ export const NetworkTrafficUsagePlanSummary = ({
|
||||
planIncludedRequests,
|
||||
}: INetworkTrafficUsagePlanSummary) => {
|
||||
const { isPro } = useUiConfig();
|
||||
const overages = usageTotal - planIncludedRequests;
|
||||
return (
|
||||
<StyledContainer>
|
||||
<Grid item>
|
||||
@ -61,7 +62,7 @@ export const NetworkTrafficUsagePlanSummary = ({
|
||||
</StyledCardTitleRow>
|
||||
<StyledCardDescription>
|
||||
<RowContainer>
|
||||
Incoming requests for selection{' '}
|
||||
Incoming requests selected month{' '}
|
||||
<StyledNumbersDiv>
|
||||
<ConditionallyRender
|
||||
condition={isPro()}
|
||||
@ -107,6 +108,19 @@ export const NetworkTrafficUsagePlanSummary = ({
|
||||
</StyledCardDescription>
|
||||
}
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={isPro() && overages > 0}
|
||||
show={
|
||||
<StyledCardDescription>
|
||||
<RowContainer>
|
||||
Requests overages this month
|
||||
<StyledNumbersDiv>
|
||||
{overages.toLocaleString()} requests
|
||||
</StyledNumbersDiv>
|
||||
</RowContainer>
|
||||
</StyledCardDescription>
|
||||
}
|
||||
/>
|
||||
</Grid>
|
||||
</StyledContainer>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user