From c78fcd29ba5a46859becf6148401c8e5f1388210 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Tue, 30 Nov 2021 11:21:07 +0100 Subject: [PATCH] Adapt UI for Prometheus Agent (#9851) * Adapt UI for Prometheus Agent UI is not my strongest skill, but I'd like to have something minimal for the initial release of the agent. Signed-off-by: Julien Pivotto * Address review comments Signed-off-by: Julien Pivotto * Add tests Signed-off-by: Julien Pivotto * Add tests, serve only current mode paths Signed-off-by: Julien Pivotto * Update js style, add agent test Signed-off-by: Julien Pivotto --- web/ui/react-app/public/index.html | 3 +- web/ui/react-app/src/App.test.tsx | 4 +- web/ui/react-app/src/App.tsx | 12 +++-- web/ui/react-app/src/Navbar.tsx | 55 +++++++++++++--------- web/ui/react-app/src/index.tsx | 4 +- web/ui/react-app/src/pages/agent/Agent.tsx | 16 +++++++ web/ui/react-app/src/pages/index.ts | 3 ++ web/web.go | 36 +++++++++++--- web/web_test.go | 3 ++ 9 files changed, 102 insertions(+), 34 deletions(-) create mode 100644 web/ui/react-app/src/pages/agent/Agent.tsx diff --git a/web/ui/react-app/public/index.html b/web/ui/react-app/public/index.html index eac493853..a3f7b7a85 100755 --- a/web/ui/react-app/public/index.html +++ b/web/ui/react-app/public/index.html @@ -15,10 +15,11 @@ It will render a "Consoles" link in the navbar when it is non-empty. - 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. -->