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 = () => {
const {
uiConfig: { networkViewEnabled },
uiConfig: { prometheusAPIAvailable },
} = useUiConfig();
if (networkViewEnabled) return null;
if (prometheusAPIAvailable) return null;
return (
<p>

View File

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

View File

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

View File

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

View File

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

View File

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