From f0ccfbe39691e088204750d8d7291cd2f273ebea Mon Sep 17 00:00:00 2001 From: ByteBaker <42913098+ByteBaker@users.noreply.github.com> Date: Wed, 28 Jan 2026 20:08:08 +0530 Subject: [PATCH] fix: use correct config flag on UI for incidents Earlier, the UI code was using `service_graph_enabled` to show (or hide) the incidents screen, this was wrong. Now `incidents_enabled` is used and sent by the backend as part of `/config` API call. --- src/handler/http/request/status/mod.rs | 16 +++++++--------- web/src/layouts/MainLayout.vue | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/handler/http/request/status/mod.rs b/src/handler/http/request/status/mod.rs index f854f5c29e..bf001c41ef 100644 --- a/src/handler/http/request/status/mod.rs +++ b/src/handler/http/request/status/mod.rs @@ -158,19 +158,11 @@ struct ConfigResponse<'a> { log_page_default_field_list: String, query_values_default_num: i64, mysql_deprecated_warning: bool, - #[cfg(feature = "enterprise")] service_graph_enabled: bool, - #[cfg(not(feature = "enterprise"))] - service_graph_enabled: bool, - #[cfg(feature = "enterprise")] - service_streams_enabled: bool, - #[cfg(not(feature = "enterprise"))] + incidents_enabled: bool, service_streams_enabled: bool, /// Available FQN priority dimensions from O2_FQN_PRIORITY_DIMENSIONS env var /// Used by UI to populate the FQN priority dimension selector - #[cfg(feature = "enterprise")] - fqn_priority_dimensions: Vec, - #[cfg(not(feature = "enterprise"))] fqn_priority_dimensions: Vec, } @@ -344,6 +336,11 @@ pub async fn zo_config() -> impl IntoResponse { #[cfg(not(feature = "enterprise"))] let service_graph_enabled = false; + #[cfg(feature = "enterprise")] + let incidents_enabled = o2cfg.incidents.enabled; + #[cfg(not(feature = "enterprise"))] + let incidents_enabled = false; + #[cfg(feature = "enterprise")] let service_streams_enabled = o2cfg.service_streams.enabled; #[cfg(not(feature = "enterprise"))] @@ -455,6 +452,7 @@ pub async fn zo_config() -> impl IntoResponse { query_values_default_num: cfg.limit.query_values_default_num, mysql_deprecated_warning: cfg.common.meta_store.starts_with("mysql"), service_graph_enabled, + incidents_enabled, service_streams_enabled, #[cfg(feature = "enterprise")] fqn_priority_dimensions: o2_enterprise::enterprise::common::config::get_config() diff --git a/web/src/layouts/MainLayout.vue b/web/src/layouts/MainLayout.vue index 3d32d83314..868cc354d9 100644 --- a/web/src/layouts/MainLayout.vue +++ b/web/src/layouts/MainLayout.vue @@ -361,7 +361,7 @@ export default defineComponent({ const isIncidentsEnabled = computed(() => { return ( (config.isEnterprise == "true" || config.isCloud == "true") && - store.state.zoConfig.service_graph_enabled + store.state.zoConfig.incidents_enabled ); });