From 3b4cbf8da4c5b9b8c6c2a0a30ae182dfbb0b8213 Mon Sep 17 00:00:00 2001 From: Levi Harrison Date: Sun, 8 Jan 2023 18:04:00 -0500 Subject: [PATCH] Inject readiness state through context (#11617) Signed-off-by: Levi Harrison Signed-off-by: Levi Harrison --- web/ui/react-app/public/index.html | 4 + web/ui/react-app/src/App.test.tsx | 2 +- web/ui/react-app/src/App.tsx | 84 ++++++++++--------- .../src/components/withStartingIndicator.tsx | 4 +- .../react-app/src/contexts/ReadyContext.tsx | 9 ++ web/ui/react-app/src/index.tsx | 7 +- web/web.go | 1 + 7 files changed, 68 insertions(+), 43 deletions(-) create mode 100644 web/ui/react-app/src/contexts/ReadyContext.tsx diff --git a/web/ui/react-app/public/index.html b/web/ui/react-app/public/index.html index a3f7b7a850..57131a26b6 100755 --- a/web/ui/react-app/public/index.html +++ b/web/ui/react-app/public/index.html @@ -16,10 +16,14 @@ - PROMETHEUS_AGENT_MODE is replaced by a boolean indicating if Prometheus is running in agent mode. It true, it will disable querying capacities in the UI and generally adapt the UI to the agent mode. It has to be represented as a string, because booleans can be mangled to !1 in production builds. + - PROMETHEUS_READY is replaced by a boolean indicating whether Prometheus was ready at the time the + web app was served. It has to be represented as a string, because booleans can be mangled to !1 in + production builds. -->