mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-27 11:02:16 +01:00
chore: show edge instances in license info (#10810)
https://linear.app/unleash/issue/2-3981/show-edge-instances-in-license-information-in-unleash Show edge instances in license info. Adapts to new logic, so resources are only shown if they are present.
This commit is contained in:
parent
f37fde2a27
commit
1b60ed5df8
@ -68,6 +68,12 @@ export const License = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const resources = {
|
||||||
|
Seats: license.resources.seats,
|
||||||
|
'Release templates': license.resources.releaseTemplates,
|
||||||
|
'Edge instances': license.resources.edgeInstances,
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent header={<PageHeader title='Unleash Enterprise License' />}>
|
<PageContent header={<PageHeader title='Unleash Enterprise License' />}>
|
||||||
<StyledBox>
|
<StyledBox>
|
||||||
@ -97,20 +103,21 @@ export const License = () => {
|
|||||||
{license.plan}
|
{license.plan}
|
||||||
</StyledPropertyDetails>
|
</StyledPropertyDetails>
|
||||||
</StyledDataCollectionPropertyRow>
|
</StyledDataCollectionPropertyRow>
|
||||||
<StyledDataCollectionPropertyRow>
|
{Object.entries(resources).map(
|
||||||
<StyledPropertyName>Seats</StyledPropertyName>
|
([resourceName, resourceValue]) =>
|
||||||
<StyledPropertyDetails>
|
resourceValue && (
|
||||||
{license.seats}
|
<StyledDataCollectionPropertyRow
|
||||||
</StyledPropertyDetails>
|
key={resourceName}
|
||||||
</StyledDataCollectionPropertyRow>
|
>
|
||||||
<StyledDataCollectionPropertyRow>
|
|
||||||
<StyledPropertyName>
|
<StyledPropertyName>
|
||||||
Release templates
|
{resourceName}
|
||||||
</StyledPropertyName>
|
</StyledPropertyName>
|
||||||
<StyledPropertyDetails>
|
<StyledPropertyDetails>
|
||||||
{license.releaseTemplates}
|
{resourceValue}
|
||||||
</StyledPropertyDetails>
|
</StyledPropertyDetails>
|
||||||
</StyledDataCollectionPropertyRow>
|
</StyledDataCollectionPropertyRow>
|
||||||
|
),
|
||||||
|
)}
|
||||||
<StyledDataCollectionPropertyRow>
|
<StyledDataCollectionPropertyRow>
|
||||||
<StyledPropertyName>
|
<StyledPropertyName>
|
||||||
Expire at
|
Expire at
|
||||||
|
|||||||
@ -18,14 +18,19 @@ const fallback = {
|
|||||||
loading: false,
|
loading: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type LicenseResources = {
|
||||||
|
seats?: number;
|
||||||
|
releaseTemplates?: number;
|
||||||
|
edgeInstances?: number;
|
||||||
|
};
|
||||||
|
|
||||||
export interface License {
|
export interface License {
|
||||||
license?: {
|
license?: {
|
||||||
token: string;
|
token: string;
|
||||||
customer: string;
|
customer: string;
|
||||||
instanceName: string;
|
instanceName: string;
|
||||||
plan: string;
|
plan: string;
|
||||||
seats: number;
|
resources: LicenseResources;
|
||||||
releaseTemplates: number;
|
|
||||||
expireAt: Date;
|
expireAt: Date;
|
||||||
};
|
};
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
@ -58,7 +63,7 @@ export const useLicense = (): License => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
license: { ...data },
|
license: data,
|
||||||
loading: !error && !data,
|
loading: !error && !data,
|
||||||
refetchLicense: () => mutate(),
|
refetchLicense: () => mutate(),
|
||||||
error,
|
error,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user