1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-03 01:18:43 +02:00

refactor: rename networkViewEnabled to prometheusAPIAvailable (#9330)

https://linear.app/unleash/issue/2-3290/rename-networkviewenabled-to-prometheusapiavailable

Follow-up to: https://github.com/Unleash/unleash/pull/9325

See: https://github.com/Unleash/unleash/pull/9325#discussion_r1960085303

Renames `networkViewEnabled` to `prometheusAPIAvailable`. This new name
better reflects what it stands for.
This commit is contained in:
Nuno Góis 2025-02-19 14:38:59 +00:00 committed by GitHub
parent e095411de4
commit 7340c74b1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 8 additions and 8 deletions

View File

@ -2,10 +2,10 @@ import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
export const NetworkPrometheusAPIWarning = () => { export const NetworkPrometheusAPIWarning = () => {
const { const {
uiConfig: { networkViewEnabled }, uiConfig: { prometheusAPIAvailable },
} = useUiConfig(); } = useUiConfig();
if (networkViewEnabled) return null; if (prometheusAPIAvailable) return null;
return ( return (
<p> <p>

View File

@ -20,11 +20,11 @@ export const useInstanceMetrics = (
options: SWRConfiguration = {}, options: SWRConfiguration = {},
): IInstanceMetricsResponse => { ): IInstanceMetricsResponse => {
const { const {
uiConfig: { networkViewEnabled }, uiConfig: { prometheusAPIAvailable },
} = useUiConfig(); } = useUiConfig();
const { data, error, mutate } = useConditionalSWR( const { data, error, mutate } = useConditionalSWR(
networkViewEnabled, prometheusAPIAvailable,
{}, {},
formatApiPath(`api/admin/metrics/rps`), formatApiPath(`api/admin/metrics/rps`),
fetcher, fetcher,

View File

@ -27,7 +27,7 @@ export const defaultValue: IUiConfig = {
title: 'Source code on GitHub', title: 'Source code on GitHub',
}, },
], ],
networkViewEnabled: false, prometheusAPIAvailable: false,
resourceLimits: { resourceLimits: {
segmentValues: 1000, segmentValues: 1000,
strategySegments: 5, strategySegments: 5,

View File

@ -24,7 +24,7 @@ export interface IUiConfig {
links: ILinks[]; links: ILinks[];
disablePasswordAuth?: boolean; disablePasswordAuth?: boolean;
emailEnabled?: boolean; emailEnabled?: boolean;
networkViewEnabled: boolean; prometheusAPIAvailable: boolean;
maintenanceMode?: boolean; maintenanceMode?: boolean;
toast?: IProclamationToast; toast?: IProclamationToast;
segmentValuesLimit?: number; segmentValuesLimit?: number;

View File

@ -99,7 +99,7 @@ export const uiConfigSchema = {
), ),
}, },
}, },
networkViewEnabled: { prometheusAPIAvailable: {
type: 'boolean', type: 'boolean',
description: 'Whether a Prometheus API is available.', description: 'Whether a Prometheus API is available.',
example: true, example: true,

View File

@ -186,7 +186,7 @@ class ConfigController extends Controller {
strategySegmentsLimit: this.config.resourceLimits.strategySegments, strategySegmentsLimit: this.config.resourceLimits.strategySegments,
frontendApiOrigins: frontendSettings.frontendApiOrigins, frontendApiOrigins: frontendSettings.frontendApiOrigins,
versionInfo: await this.versionService.getVersionInfo(), versionInfo: await this.versionService.getVersionInfo(),
networkViewEnabled: this.config.prometheusApi !== undefined, prometheusAPIAvailable: this.config.prometheusApi !== undefined,
resourceLimits: this.config.resourceLimits, resourceLimits: this.config.resourceLimits,
disablePasswordAuth, disablePasswordAuth,
maintenanceMode, maintenanceMode,