* Support new duration format in graph range input
This is to make the duration parsing and formatting in the graph range
input field consistent with the new duration formatting introduced for
the configuration and PromQL
(https://github.com/prometheus/prometheus/pull/7713).
Ranges were previously handled in seconds - these are now handled in
milliseconds everywhere, as this makes things nicer / easier.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Fixups
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Bump jquery and @types/jquery
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Properly close color box span in graph hover detail
jQuery 3.5.0 introcuded a breaking change that was necessary to fix HTML
security issues
(https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/), and as a
result the detail-swatch span wasn't closed properly anymore, because
spans are not valid self-closing tags in
XHTML.
Fixes https://github.com/prometheus/prometheus/issues/7803
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Fix up tests
Signed-off-by: Julius Volz <julius.volz@gmail.com>
Further precision is truncated by the Prometheus API, so the
steps don't end up quite aligning subsequently.
Fixes#7711
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
* Backport custom title to React UI
Backports #4841 into the new UI.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* Fix typo
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* Display dates as well as timestamps in the status page
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
* Trim trailing whitespaces
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
Previously, hash-fragment links like this:
http://mark-t510:9090/targets#job-alertmanager
Would scroll to have the header at the top, obscured by the nav bar.
Tested in both old and new UIs.
Fixes#7434
Signed-off-by: Mark Hansen <markhansen@google.com>
jQuery prior to 3.4.0 is affected by an Object.prototype pollution
vulnerability (CVE-2019-11358). Even though our code doesn't seem to be
vulnerable to the issue, lets upgrade to the latest jQuery release so we
don't have to bother.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* value field more human readable
Signed-off-by: kisc <nuno_kisc@hotmail.com>
* fix typo
Signed-off-by: Nuno Cardoso <nuno_kisc@hotmail.com>
* add function convertSCToNumber
Signed-off-by: nunokisc <nuno_kisc@hotmail.com>
* add convertSCToNumber test
Signed-off-by: nunokisc <nuno_kisc@hotmail.com>
* normalize function name
Signed-off-by: kisc <nuno_kisc@hotmail.com>
* convertScientificNotationToNumber to parsePrometheusFloat
Signed-off-by: kisc <nuno_kisc@hotmail.com>
https://github.com/facebook/create-react-app/issues/8689 is causing our
tests to fail in the CI pipeline. As the comments suggest, downgrading
to react-scripts 3.4.0 fixes the problem.
In addition, fix a test warning due to a missing id field.
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
time.Unix attaches the local timezone, which can then
leak out (e.g. in the alert json). While this is harmless,
we should be consistent.
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
This fixes an issue where the /new/targets page will not load when there
are jobs with invalid CSS characters in them, such as the
namespace/service/0 form used by the Prometheus Operator.
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
* Add conditional rendering of Navlink for Consoles
Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>
* Replacing if else with only if conditional rendering
Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>
* Add tests and removing global declaration in Navbar
Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>
* Correct Navbar Testcases and add types for ConsolesLink
Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>
* Change names for Console link as per-naming convention
Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>
* Change prop names to AppProps and NavbarProps respectively
Signed-off-by: Drumil Patel <drumilpatel720@gmail.com>
* React UI: Support local timezone on /graph
This partially implements
https://github.com/prometheus/prometheus/issues/500 in the sense that it
only addresses the /graph page, and only allows toggling between UTC and
local (browser) time, but no arbitrary timezone selection yet.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Fixup: Also display TZ offset in tooltip
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Just show offset, not timezone name abbreviation
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* React UI: Send cookies on fetch() on older browsers
Fixes https://github.com/prometheus/prometheus/issues/6428
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Fix fetch() tests to expect new options
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* add panel state for the expression input
Signed-off-by: blalov <boiskila@gmail.com>
* remove redundant test
Signed-off-by: blalov <boiskila@gmail.com>