Commit graph

527 commits

Author SHA1 Message Date
Augustin Husson eca9546ba4
fix package-lock.json (#9400)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-27 18:58:41 +02:00
Julius Volz f103acd513
Merge pull request #9248 from LeviHarrison/atan2-binary-op
PromQL: Add `atan2` binary operator
2021-09-27 18:45:56 +02:00
Augustin Husson dbbfd1ccf6
change license in package.json file of cmp (#9399)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-27 10:17:30 +02:00
Levi Harrison 2f896c98ff Address review comments
Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-09-26 15:45:25 -04:00
Augustin Husson 3e494eac71
upgrade to codemirror v19 (#9363)
* upgrade to codemirror v19

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* fix autocomplete test

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* fix wording

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-24 21:40:49 +02:00
Augustin Husson 7bcca77340
provide a way to override the apiPrefix in codemirror prom client + cleanup readme (#9384)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-24 07:52:50 +02:00
Levi Harrison e27ac3e7e4 Add grammar (maybe?)
Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-09-23 10:30:46 -04:00
Augustin Husson 545fbfd7f4 specify npm version in the engine
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-16 21:15:20 +02:00
Julius Volz 447d9401fc
Merge pull request #9239 from LeviHarrison/promql-trig-functions
PromQL: Add trigonometric functions
2021-09-16 14:11:40 +02:00
Levi Harrison 2c7bec758d Tabs to spaces
Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-09-15 23:02:26 -04:00
Levi Harrison ed220c1ae7 Add grammar
Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-09-15 23:02:25 -04:00
Augustin Husson e52204e556 fix eslint warning for codemirror-promql
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-15 13:38:48 +02:00
Julius Volz d2c0eac37f Fix linter errors in codemirror-promql module
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-09-15 11:48:21 +02:00
Augustin Husson 1b740aeb6e Merge branch 'main' into feature/use-npm-workspace
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-14 19:27:44 +02:00
Augustin Husson af7aab7937 add global mock for the matchMedia function
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-14 15:49:46 +02:00
Augustin Husson 05b9a11a62 remove jest.restoreAllMock() call
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-14 15:49:46 +02:00
Augustin Husson c3306e6366 set canvas mock
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-14 15:49:46 +02:00
Julius Volz 5498ca5214 Update React 16->17, TypeScript, and some other node deps
This updates React, TypeScript, and some other node packages (but not
everything).

A couple of notes:

- `enzyme-adapter-react-16` does not have a React 17 equivalent yet, so I
  switched to the fork `@wojtekmaj/enzyme-adapter-react-17`
- A bunch of tests are still failing because I think in the enzyme testing
  environment, a browser API (`ResizeObserver`) is missing, and maybe for other
  reasons. This needs to be explored + fixed.
- The TypeScript update introduced more stringent rules, which required fixing
  up a bunch of pieces of code a bit.
- The `use-media` package doesn't work with React 17 yet, so I just built our
  own minimal `useMedia` hook instead (just a couple of lines).
- I commented out part of the code in `withStartingIndicator.tsx` because it
  fails the now-stricter lint checks. It needs to be fixed (and not commented
  out).

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-09-14 15:46:59 +02:00
Augustin Husson 22fa0aa408
remove app package in codemirror-module (#9322)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-14 12:33:10 +02:00
Augustin Husson 19f5f44bf9 remove craco, no need for it
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-11 12:10:05 +02:00
Victor Häggqvist 9aaea327a0 use same top and bottom margin for alert filename
Signed-off-by: Victor Häggqvist <victor@snilius.com>
2021-09-10 21:21:22 +02:00
Augustin Husson 27aec91914 review the UI ci and associated command
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-10 17:18:25 +02:00
Augustin Husson 5c42b04af7 move to npm workspace
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-10 15:38:20 +02:00
Augustin Husson fa56d1e43b Merge branch 'feature/cleanup-codemirror' into feature/use-npm-workspace 2021-09-09 17:55:50 +02:00
Augustin Husson 29b788a7b5 remove app package in codemirror-module
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-09 17:52:03 +02:00
Victor Häggqvist 02cedb837d use consistent margin-bottom for all alert kinds
Signed-off-by: Victor Häggqvist <victor@snilius.com>
2021-09-08 21:28:49 +02:00
Augustin Husson c83137e757 Merge branch 'main' into update-react-and-ts
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-08 17:28:46 +02:00
Augustin Husson e1d8891a73 add global mock for the matchMedia function
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-08 17:26:24 +02:00
Augustin Husson 2cfdaf915f remove jest.restoreAllMock() call
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-08 17:13:44 +02:00
Ganesh Vernekar 1a5b21b78b
Update dependencies for v2.30.0 (#9308)
* Update Go dependencies

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Update React dependencies

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-09-07 20:17:21 +05:30
Augustin Husson b67c49a9ff Merge branch 'main' into update-react-and-ts
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-07 16:39:54 +02:00
Augustin Husson e785a0a31f set canvas mock
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-07 16:34:41 +02:00
Augustin Husson c827413755 Merge branch 'main' into update-react-and-ts
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-07 11:51:39 +02:00
SuperQ 6281d26002
Update various react-app dependencies
Update several dependencies to cleanup `npm outdated`.

Signed-off-by: SuperQ <superq@gmail.com>
2021-09-07 11:34:37 +02:00
Augustin Husson 405198f430 upgrade react-app to typescript 4
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-07 10:51:59 +02:00
Augustin Husson 5bcf2e6511 upgrade react-script to v4
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-04 15:56:36 +02:00
Augustin Husson 8fe97cc614 rely on react-scripts for most of the dev-deps
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-03 15:01:32 +02:00
Augustin Husson 4f67eb3979 fix EndpointLink test
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-02 15:31:33 +02:00
Augustin Husson 242d459685 fix 'window.ResizeObserver is not a constructor' issue
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-02 14:46:46 +02:00
Augustin Husson 5d29b7b6f7 specify the type returned for most of the function that is missing it
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-02 11:12:25 +02:00
Augustin Husson 27bd8fef40 fix condition in withStartingIndicator
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-02 10:29:20 +02:00
Julius Volz ff2d297b0a Update React 16->17, TypeScript, and some other node deps
This updates React, TypeScript, and some other node packages (but not
everything).

A couple of notes:

- `enzyme-adapter-react-16` does not have a React 17 equivalent yet, so I
  switched to the fork `@wojtekmaj/enzyme-adapter-react-17`
- A bunch of tests are still failing because I think in the enzyme testing
  environment, a browser API (`ResizeObserver`) is missing, and maybe for other
  reasons. This needs to be explored + fixed.
- The TypeScript update introduced more stringent rules, which required fixing
  up a bunch of pieces of code a bit.
- The `use-media` package doesn't work with React 17 yet, so I just built our
  own minimal `useMedia` hook instead (just a couple of lines).
- I commented out part of the code in `withStartingIndicator.tsx` because it
  fails the now-stricter lint checks. It needs to be fixed (and not commented
  out).

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-09-01 16:03:09 +02:00
Levi Harrison 70f597b033
Configure Scrape Interval and Timeout Via Relabeling (#8911)
* Configure scrape interval and timeout with labels

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-08-31 17:37:32 +02:00
Julius Volz dff78eb508
Switch from Reach Router to React Router (#9273)
We want to upgrade to React 17, but Reach Router does not work with React 17:
https://github.com/reach/router/issues/429

Also, the Reach + React Router projects announced an intention to join forces
and just continue as React Router:
https://reacttraining.com/blog/reach-react-router-future/

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-08-30 14:05:49 +02:00
Augustin Husson a2665a9f73
add lezer-promql module (#9229)
* add lezer-promql module

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* integrate lezer-promql in codemirror-promql

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-08-29 15:16:25 +02:00
SuperQ e167a45c65
Add new Go build tags.
Add new go:build comments based on 1.17 formatting[0].

[0]: https://golang.org/doc/go1.17#gofmt

Signed-off-by: SuperQ <superq@gmail.com>
2021-08-27 10:24:14 +02:00
Augustin Husson 54dfee02b2
move codemirror-promql as a prometheus web module (#9188)
* move codemirror-promql as a prometheus web module

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* remove unecessary file for the codemirror module

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* change license for Apache

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* fix codemirror build

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-08-20 11:39:07 +02:00
Dorian JAMINAIS 05dba96ebf
Add option for the number of ticks in PromConsole.Graph (#9223)
Signed-off-by: Dorian Jaminais-Grellier <dorian@jaminais.fr>
2021-08-20 08:24:31 +02:00
Julius Volz bb05485c79
Fix JS/CSS asset paths for classic /config page (#9202)
Fixes https://github.com/prometheus/prometheus/issues/9130

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-08-13 18:10:31 +02:00
Augustin Husson 7291563d4d
replace yarn by npm (#9198)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-08-12 20:25:26 +02:00
Julien Pivotto cab96a06ef
Merge release 2.29 in main (#9196)
* PromQL: Fix start and end keywords masking label and metric names

This commit fixes an issue with the "at modifier" that introduced two
new keywords: `start` and `end`. In grouping options and in metric
names, these keywords took precedence over metric or label names, so
that those metrics and labels could no longer be referenced.

Signed-off-by: Clayton Peters <clayton.peters@man.com>

* Add in additional tests for metrics and/or labels called start/end.

Signed-off-by: Clayton Peters <clayton.peters@man.com>

* *: Cut 2.29.0-rc.0

Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>

* VERSION: bump to 2.29.0-rc.0

Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>

* Remove experimental wording on size-based retention

Followup of #9004

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* Fix PR reference in changelog

Signed-off-by: George Brighton <george@gebn.co.uk>

* Describe EC2 availability zone IDs at most once per refresh (#9142)

Signed-off-by: George Brighton <george@gebn.co.uk>

* Describe EC2 availability zones at most once per SD load

Closes #9142.

Signed-off-by: George Brighton <george@gebn.co.uk>

* Incorporate feedback

Signed-off-by: George Brighton <george@gebn.co.uk>

* Integrate feedback

Signed-off-by: George Brighton <george@gebn.co.uk>

* Add a compatibility note for macOS users.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* *: Cut v2.29.0-rc.1

Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>

* Fix `kuma_sd` targetgroup reporting (#9157)

* Bundle all xDS targets into a single group

Signed-off-by: austin ce <austin.cawley@gmail.com>

* *: cut v2.29.0-rc.2

Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>

* Rename links

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* bump codemirror-promql to 0.17.0

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* *: cut v2.29.0

Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>

* tsdb: align atomically accessed int64 (#9192)

This prevents a panic in 32-bit archs:
https://pkg.go.dev/sync/atomic#pkg-note-BUG

Fixed #9190

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* Release 2.29.1 (#9193)

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

Co-authored-by: Clayton Peters <clayton.peters@man.com>
Co-authored-by: Frederic Branczyk <fbranczyk@gmail.com>
Co-authored-by: George Brighton <george@gebn.co.uk>
Co-authored-by: Austin Cawley-Edwards <austin.cawley@gmail.com>
Co-authored-by: Levi Harrison <git@leviharrison.dev>
Co-authored-by: Augustin Husson <husson.augustin@gmail.com>
2021-08-12 18:38:06 +02:00
Julius Volz b7e9f2481b
Remove search keymap from new expression editor (#9184)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-08-10 17:10:41 +02:00
Frederic Branczyk fd8e8218a7
Update UI dependencies
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2021-07-29 09:11:14 +02:00
Augustin Husson f72cabb437
Add sorting and filtering to flags page (v2) (#8988)
* Add sorting and filtering to flags page

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Make filter understand

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* split big state object into smaller ones

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* use fuzzy match and sanitize html for search results

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* use fuzzy.filter

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* replace fuzzy lib by @nexucis/fuzzy + fix flags issues

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* replace fuzzy by @nexucis/fuzzy in ExpressionInput.tsx

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* remove fuzzy lib from package.json

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* fix flags test

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* simplify the input in the fuzzy search

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* cleanup html to be easily compatible with the dark theme

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* fix filtering when there is no result

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* use id to fix the test

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

Co-authored-by: Dustin Hooten <dustinhooten@gmail.com>
2021-07-01 21:15:06 +02:00
Levi Harrison 167dfa19af
React UI: Select time range with mouse drag (#8977)
* Added selection flot plugin

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added time selection

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added tests

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Removed irrelevant line in license header

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-06-30 10:40:43 +02:00
Julius Volz 664b391573
Speed up alerts page by not rendering collapsed details (#9005)
All this is doing is wrapping the inner alert details display with a
conditional `{open && ...}`.

This already improves https://github.com/prometheus/prometheus/issues/8548 a
lot for cases where there are many individual firing/pending alert elements
under each alerting rule.

E.g. for a list of 200 rules with ~100 alert elements each, this changed the page
render time from 30 seconds to 1s.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-06-28 16:14:48 +02:00
Levi Harrison 922f9babb1
Change starting show screen progress bar condition (#8946)
* Show progress bar when max is not 0

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added semicolon

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-06-17 12:48:38 +02:00
Julius Volz 00a9d77b1d
Update node dependencies before release (#8937)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-06-15 23:07:01 +02:00
Julius Volz b12622206d
Improve styling of selected exemplar details (#8945)
This isn't perfect yet, but IMO better than the initial draft.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-06-15 22:50:01 +02:00
Levi Harrison eb8ca06885
React UI: Add Starting Screen to Individual Pages (#8909)
* Fix/removed forwarding

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added global 'wasReady' and 'wasUnexpected'

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Eslint fixes

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added withStartingIndicator wrapper

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed condition

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Removed unused import

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Moved withStartingIndicator calls to pages index

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed withStartingIndicator tests

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed eslint (maybe?)

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Trailing comma

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added prettier ignore

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fix eslint (pt. 2)

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-06-15 22:37:16 +02:00
Julius Volz 676acf6a1b
Improve graph info tooltip for series and exemplars (#8929)
* Improve graph info tooltip for series and exemplars

It now shows more clearly what the label sets are about (series vs. exemplar +
associated series) and also shows the metric name for both label sets when it
is present.

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Fix up inconsistent title casing

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Explicitly indicate empty labelsets in hover tooltip

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Adjust tests to new hover detail

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-06-14 16:35:21 +02:00
Levi Harrison f0fe189d20
React UI: Add Exemplar Support to Graph (#8832)
* Added exemplar support

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Modified tests

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fix eslint suggestions

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Address review comments

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed undefined data property error

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added series label section to tooltip

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed spacing

Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed tests

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added exemplar info

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Changed exemplar symbol

Signed-off-by: Levi Harrison <git@leviharrison.dev>

Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Hide selected exemplar info when 'Show Exemplars' is unchecked

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Include series labels in exemplar info

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* De-densify exemplars

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Moved showExemplars to per-panel control

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Eslint fixes

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Address review comments

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed tests

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fix state bug

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Removed unused object

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fix eslint

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Encoded 'show_exemplars' in url

Signed-off-by: Levi Harrison <git@leviharrison.dev>

Co-authored-by: Julius Volz <julius.volz@gmail.com>
2021-06-12 18:02:40 +02:00
Julius Volz 9ed24b40c4
React UI: Make the new PromQL editor the default (#8925)
Fixes: https://github.com/prometheus/prometheus/issues/8923

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-06-11 17:40:09 +02:00
Levi Harrison d44b4c5f1d
React UI: Starting Screen Progress Bar Should Start at 0 (#8908)
* Removed min value

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added tests

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Set min value

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-06-09 18:25:47 +02:00
Levi Harrison 7bc11dcb06
React UI: Add Starting Screen (#8662)
* Added walreplay API endpoint

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added starting page to react-ui

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Documented the new endpoint

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed typos

Signed-off-by: Levi Harrison <git@leviharrison.dev>

Co-authored-by: Julius Volz <julius.volz@gmail.com>

* Removed logo

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Changed isResponding to isUnexpected

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Changed width of progress bar

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Changed width of progress bar

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added DB stats object

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Updated starting page to work with new fields

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Passing nil

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Passing nil (pt. 2)

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Passing nil (pt. 3)

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Passing nil (and also implementing a method this time) (pt. 4)

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Passing nil (and also implementing a method this time) (pt. 5)

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Changed const to let

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Passing nil (pt. 6)

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Remove SetStats method

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added comma

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Changed api

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Changed to triple equals

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed data response types

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Don't return pointer

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Changed version

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed interface issue

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed pointer

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed copying lock value error

Signed-off-by: Levi Harrison <git@leviharrison.dev>

Co-authored-by: Julius Volz <julius.volz@gmail.com>
2021-06-05 15:29:32 +01:00
Augustin Husson 1838068db5
bump codemirror-promql to v0.16.0 (#8856)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-05-20 23:00:15 +02:00
Chris Marchbanks 063ab7555d
Update javascript dependencies
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
2021-05-06 13:16:06 -06:00
Andrew Pickering 5047d36a77
Upgrade cssnano from v4.1.10 to v4.1.11 (#8759)
Removes the is-svg dependency since cssnano no longer depends on it.

Signed-off-by: Andy Pickering <anpicker@redhat.com>
2021-04-26 19:14:19 +02:00
Andrew Pickering 67514a5282
Upgrade sanitize-html from v1.27.5 to v2.3.3 (#8760)
sanitize-html v1.27.5 had several issues that are fixed in newer
versions.

Signed-off-by: Andy Pickering <anpicker@redhat.com>
2021-04-26 12:17:36 +02:00
Julien Pivotto a9a5f04ff9
UI: Move away from deprecated node-sass (#8733)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2021-04-19 09:01:45 +02:00
Łukasz Mierzwa 850dbda5c3
Add a dark theme (#8604)
* Upgrade bootstrap and reactstrap to the latest version

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add SASS support

node-sass is needed for cra to handle SCSS files instead of pure CSS.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a dark theme

This adds a dark theme and UI controls to switch between themes.
Dark theme will require some CSS changes that will follow in future commits.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a margin to Prometheus brand

There is no space between 'Prometheus' brand text and the toggle button when using mobile device.
This adds a margin to the button that's only rendered on mobile

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a dark theme for CollapsibleAlertPanel

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a dark theme for RulesContent

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a dark theme for Config

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Use bootstrap classes for margins

We can override margins via bootstrap css classes instead of loading custom css module.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a dark theme for QueryStatsView

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a dark theme for MetricsExplorer

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a dark theme for 'Clear time' button
This button had some custom css based on light bootstrap theme so it needs to be adjusted for dark theme.
This change re-uses bootstrap styles used for input components instead of copying color values

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add dark theme for Graph panel input

This makes the whole input group look consistent in dark mode as the old styles were made to blend it with the default bootstrap theme.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a dark theme for CME expression input

This change splits current CME theme into 3:
1 - base theme used for both light and dark mode
2 - light mode specific theme that overrides base
3 - dark mode specific theme that overrides base

To make it all work we also need to move theme to dynamic config, so when theme value
in ThemeContext changes CME input will apply a new theme.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Add a dark theme for /graph page tabs

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Fix metrics explorer modal scroll

bootstrap-dark breaks scrolling on the metrics modal, so we need an extra rule to fix that.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Move App.css rules to themes/_shared.scss

This completes splitting styles into light and dark theme.
It also fixes some small issues with themes as now all styles from App.css are applied correctly.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Move html{} styles to a dedicated file

html block is root document so styles for it cannot be nested under theme classes.
Move it out and add a bit of documentation to explain what which file does.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Fix reboot styles overriding other FontAwesome classes

Both bootstrap themes we use import reboot classes (https://getbootstrap.com/docs/4.6/content/reboot/) which has the side effect of overriding other classes. We need reboot to be applied as defaults for the browser, so it needs to be moved out of theme class selectors. But because reboot requires scss variables we need to feed it something, for that we use the default light theme, so it gets imported there and browser will use style of the default theme to reset default (unthemed) styles.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Move codicon font to app.scss

This needs to be applied globally, not per theme.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
2021-04-15 18:14:07 +02:00
Augustin Husson bfc022fdf4 use the metricsNames in PromQLExtension & update the import path
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-04-13 22:13:47 +02:00
Augustin Husson 7071b94a07 remove unused import
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-04-13 22:13:02 +02:00
Augustin Husson 4c25b48ed5 bump cm-promql to v0.15.0
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-04-13 22:12:42 +02:00
Augustin Husson f4db4ac7a3
move @types deps to dev-deps (#8706)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-04-11 11:35:06 +02:00
Augustin Husson f3505da306
bump cm-promql + light improvement when building the PromQL extension (#8700)
* bump cm-promql to v0.14.1

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* enhancement a bit the way to build the codemirror PromQL extension

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-04-07 12:34:04 +02:00
Bartlomiej Plotka f93b95d16e
Merge release-2.26.0 branch to main. (#8678)
* Cut 2.26.0-rc.0 release. (#8640)

* Cut 2.26.0-rc.0

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Addressed comments.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Addressed comments.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Curate 2.26 changelog

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* bump codemirror-promql to v0.14.0 (#8653)

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* fix: Wrap text in CodeMirror expression editor (#8665)

Fixes https://github.com/prometheus/prometheus/issues/8663

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Quick documentation of the exemplars feature on the disabled features (#8655)

page.

Signed-off-by: Callum Styan <callumstyan@gmail.com>

* Cut 2.26.0 (#8676)

* Cut 2.26.0-rc.1

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Moved to full release.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

Co-authored-by: Julien Pivotto <roidelapluie@inuits.eu>
Co-authored-by: Augustin Husson <husson.augustin@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Co-authored-by: Callum Styan <callumstyan@gmail.com>
2021-03-31 18:16:37 +01:00
Levi Harrison 054e9d1985
Change Error Messages in TSDB Status Page (#8659)
* Changed error wording

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added another test and moved both into the correct suite

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-03-28 11:11:00 +02:00
Levi Harrison b3feb2c2ae
Add 16w and 26w time range steps (#8656)
* Added 16w and 26w time range steps

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Fixed indentation

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-03-26 21:46:29 +01:00
Levi Harrison 1b4e4aa81a
Fix Blank TSDB Status Page (#8654)
* Check response and return alternate page if no statistics

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Added tests for alternate page

Signed-off-by: Levi Harrison <git@leviharrison.dev>

* Change error handling in unixToTime

Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-03-26 20:47:54 +01:00
Ben Kochie b524ca8447
Update react deps (#8637)
* Bump all yarn deps (rm yarn.lock ; yarn)

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-03-24 10:44:24 +00:00
Julius Volz faacb619c0
Add new codemirror-promql-based expression editor (#8634)
* Add new codemirror-promql-based expression editor

This adds advanced autocompletion, syntax highlighting, and linting
for PromQL.

Fixes https://github.com/prometheus/prometheus/issues/6160
Fixes https://github.com/prometheus/prometheus/issues/5421

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Group new editor options and float them left

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Improve history autocompletion handling

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Only show info tooltips for unabbreviated completion items

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Rename "new editor" to "experimental editor"

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Add path prefix support

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Revert accidental check-in of go.sum changes

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Remove spurious console.log

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Fix completion item type icon styling

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-03-23 23:55:52 +01:00
Dustin Hooten 0d8db52954
Feature: Add collapse/expand all button to target page for react ui (#8486)
* Feature: Add collapse/expand all button to target page for react ui

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* update local storage key to prevent bad state

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* PR feedback

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* split big state object into smaller ones

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* fix duplication typo

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>
2021-03-22 11:54:12 +01:00
Łukasz Mierzwa e4f076f813
[UI] Fix small issues generating console errors (#8622)
* Checkbox should use onChange, not onClick

This fixes react console errors:

You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Correctly pass key in metrics exporer

Instead of passing metric variable we pass 'metric' string, which causes console errors due to duplicated keys.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* Update tests

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
2021-03-19 13:20:04 +01:00
Łukasz Mierzwa 36417663ea
Avoid overflow on /rules page (#8608)
If I have a rule with a very long name it will force the table to be wider then the viewport.
This forces the browser to wrap long rule names and uses smaller font, to avoid having overflow.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
2021-03-17 10:15:58 +01:00
Łukasz Mierzwa 8ca29cb636
Avoid overflow on /targets page (#8609)
Target errors are rendered as badges. If error text is very long it will expand the table since badges are not allowed to wrap.
Replace badge with a span which is allowed to wrap around.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
2021-03-17 10:14:47 +01:00
Matthias Loibl 369aae93a8
web/ui: Hitting enter on range input creates a new query (#8581)
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2021-03-11 14:37:26 +01:00
alex-petrov-vt 4f03df8c55
Fix inconsistent display of word 'ago' on rules page (#8566)
* Fix inconsistent display of word 'ago' in last evaluation column on rules page

Signed-off-by: Alex Petrov <alex.petrov.vt@gmail.com>

* Extract adding word 'ago' to relativeDuration util function

Signed-off-by: Alex Petrov <alex.petrov.vt@gmail.com>
2021-03-08 19:10:09 +01:00
Simon Pasquier fe23360d0f
web/ui/react-app: update dependencies (#8529)
Fix lodash security issue.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2021-02-24 21:01:28 +01:00
Lucas Hild d35cf369f2
Add expression explorer (Closes #8211) (#8404)
* Add expression explorer

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Add final new line to all files

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Rename expression to metric

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Pass dedicated metrics array to metrics explorer

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Fix styling of button

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Use append instead of prepend

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Update max width of modal

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Fix code style

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Fix inconsistent variable naming

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Fix modal title

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Fix tests

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Prevent request from being cached

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Remove timestamp from request

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Update button selector in test

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Refactor passing down metric names and query history

Signed-off-by: Lucas Hild <git@lucas-hild.de>

* Fix code style

Signed-off-by: Lucas Hild <git@lucas-hild.de>
2021-02-19 23:42:20 +01:00
Ben Kochie f8779137d0
Update web UI package.json
Update several NPM version pinnings.

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-02-11 15:51:56 +01:00
Ben Kochie 000d7edec9 Remove inline Go vendor dir
Remove the inline Go vendoring per Prometheus 2020 Dev Summit[0].

[0]: https://docs.google.com/document/d/1yuaPKLDvhJNXMF1ubsOOm5kE2_6dvCxHowBQIDs0KdU/edit

Signed-off-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2021-02-11 11:53:22 +01:00
Julien Pivotto b61d7b3b69
Update javascript dependencies (#8465)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2021-02-10 18:00:20 +01:00
Julius Volz b6544c9048 Fix label name leak into class name
Similar to https://github.com/prometheus/prometheus/pull/7902, this could lead
to style bugs for label names that correspond to styled CSS class names.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-02-08 22:24:49 +01:00
Łukasz Mierzwa 885674c5c0
[UI] Fix duplicated keys on /targets page (#8456)
* [UI] Add a test for duplicated keys in EndpointLink component

I've noticed that I'm getting warnings about multiple children with the same key on /targets page.
This adds a test that fails when that happens.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>

* [UI] Fix duplicated keys on /targets page

Since any URI we render on /targets page can have multi-value params we should use both name and value as components keys.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
2021-02-08 22:17:04 +01:00
Julien Pivotto 41247b6950
Merge pull request #8431 from phith0n/missing-ui-on-windows
fix: UI error while compiling on Windows
2021-02-01 22:30:57 +01:00
phith0n 3825f5837e fix #4596
Signed-off-by: phith0n <phith0n.ph2f@gmail.com>
2021-02-02 01:13:48 +08:00
alex-petrov-vt 91eef5e3bf
Added warnings into react Panel on the Graph page (#8427)
Signed-off-by: Alex Petrov <alex.petrov.vt@gmail.com>
2021-01-31 13:48:32 +01:00
Nguyen Le Vu Long cd1dafc2fd
tsdb: Expose total number of label pairs in head in TSDB stats page (#8343)
* tsdb: Expose total number of label pairs in head

Signed-off-by: Nguyen Le Vu Long <vulongvn98@gmail.com>

* fix: add comment for NumLabelPairs

Signed-off-by: Nguyen Le Vu Long <vulongvn98@gmail.com>

* fix: remove comment

Signed-off-by: Nguyen Le Vu Long <vulongvn98@gmail.com>
2021-01-07 12:11:32 +05:30
beorn7 2346fd934c Update React dependencies prior to v2.24 release
Signed-off-by: beorn7 <beorn@grafana.com>
2020-12-30 00:15:12 +01:00
dependabot[bot] abe85ce052
Bump ini from 1.3.5 to 1.3.8 in /web/ui/react-app
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-15 22:50:00 +00:00
Ganesh Vernekar c2ce236de1
Upgrade react deps (#8207)
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2020-11-19 17:10:29 +01:00
Julien Pivotto f97fba7cc9
React UI: Change "metrics autocomplete" with "autocomplete" (#8174)
- First, it is currently not only removing "metric" autocomplete, but
also "query history autocomplete", so the checkbox is confusing.
- Then, in the future, we will want also "functions" autocomplete.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-11-12 11:48:48 +01:00
Julien Pivotto 386e5010b8
Make the brand link in classic UI come back to classic UI home (#8160)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-11-08 21:54:29 +01:00
Julien Pivotto 8dd0a3e9a3
Fix button display when there is no panels (#8155)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-11-06 16:34:35 +01:00
Julius Volz 3470ee1fbf
Make React UI the default, keep old UI under /classic (#8142)
The React app's assets are now served under /assets, while all old
custom web assets (including the ones for console templates) are now
served from /classic/static.

I tested different combinations of --web.external-url and
--web.route-prefix with proxies in front, and I couldn't find a problem
yet with the routing. Console templates also still work.

While migrating old endpoints to /classic, I noticed that /version was
being treated like a lot of the old UI pages, with readiness check
handler in front of it, etc. I kept it in /version and removed that
readiness wrapper, since it doesn't seem to be needed for that endpoint.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2020-11-03 14:51:48 +01:00
Jarod Watkins 388a2d20c9
UI: Add toggle to enable/disable metric autocomplete (#8134)
* UI: Add toggle to enable/disable metric autocomplete

This change adds a toggle to enable or disable the metric autocomplete
functionality. By default it is enabled. This is a port of a change I
did in [Thanos][1].

[1]: https://github.com/thanos-io/thanos/pull/3381

Signed-off-by: Jarod Watkins <jarod@42lines.net>

* Adding full variable name

Signed-off-by: Jarod Watkins <jarod@42lines.net>
2020-11-02 16:16:54 +01:00
James Ranson 1cffda5de7
react updates for pathPrefix (#7979)
* dynamically determine path prefix

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* minor changes per PR review

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* use Context for apiPath and pathPrefix

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* remove unhandled "/version" path

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* only process index once instead of on every req

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* remove unneeded tag fragment

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* switch api path to const

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* revert

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* update tests

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* linter updates

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* simplify

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>

* updates per peer review

Signed-off-by: James Ranson <james_ranson@cable.comcast.com>
2020-10-22 17:22:32 +02:00
Frederic Branczyk b97a1bb7d1
web/ui/react-app/yarn.lock: Update UI dependencies
Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
2020-10-08 09:32:17 +02:00
TAY TS c9d827c1d0
Fix callback function bind with object as parameter (#7984)
Signed-off-by: TAY TS <taytzushieh@gmail.com>
2020-09-30 11:06:42 +02:00
Dustin Hooten 916dbd4c8a
React UI: Implement missing TSDB head stats section (#7876)
* React UI: Implement missing TSDB head stats section

Signed-off-by: Dustin Hooten <dhooten@splunk.com>

* Add break

Signed-off-by: Dustin Hooten <dhooten@splunk.com>
2020-09-29 22:05:33 +02:00
Christian Hoffmann db13003721
ui: clarify alert state toggle via checkbox icon (#7936)
The current meaning of the alert firing/pending/inactive
toggle seems ambiguouos as #7460 demonstrates.
This commit adds a checkbox icon to clarify the
active state of the button.

Signed-off-by: Christian Hoffmann <mail@hoffmann-christian.info>
2020-09-16 15:02:37 +02:00
Luke Chen 68d65a8ac5
Add the "assets" make target and change directory note in readme (#7908)
* add the "assets" make target and change directory note in readme

Signed-off-by: Luke Chen <showuon@gmail.com>

* address reviewer's comment

Signed-off-by: Luke Chen <showuon@gmail.com>
2020-09-16 15:01:48 +02:00
Julien Pivotto a6ee1f8517
Merge pull request #7913 from prometheus/release-2.21
Merge release 2.21 into master
2020-09-09 11:08:32 +02:00
Deepjyoti Mondal c8ad79efdc
Fixes #6127 : Add Collapse All button (#6957)
The collapse all option as suggested in the corresponding issue
has been implemented in this PR.

Signed-off-by: Deepjyoti Mondal <djmdeveloper060796@gmail.com>
2020-09-07 16:54:54 +02:00
Julius Volz 01daddeb75
Fix styling bug for target labels with special names (#7902)
Adding the label name as a CSS class can break styling and other
behavior when the label name has a special meaning in CSS. E.g. the
"container" label was displayed at 100% width because it was interpreted
to be a bootstrap container layout element.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2020-09-06 22:10:25 +02:00
Jaga Santagostino 3ebffa7e20
add key to StatusWithStatusIndicator component in loop (#6879)
Signed-off-by: Jaga Santagostino <jagasantagostino@gmail.com>
2020-08-31 16:47:35 +02:00
Julien Pivotto a5366cb236
Fix rules.html afte name cleaup in #7841 (#7865)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-08-31 14:00:46 +02:00
Stefan Büringer d30f202c08
Fix Experimental UI for cookie based authentication (#7827)
We're using Prometheus behind a reverse proxy which authenticates everything based on cookies.
Without this attribute the cookie is not send with the request for the manifest.json

Signed-off-by: Stefan Bueringer <sbueringer@gmail.com>
2020-08-27 22:50:32 +02:00
Julien Pivotto 88d563eb2e
Fix react UI bug with series going on and off (#7804)
* Fix react UI bug with series going on and off

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-08-22 21:03:19 +02:00
Ben Kochie b9437cba50
Bump various react versions (#7820)
Update several `yarn outdated` pacakges.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-08-22 21:02:50 +02:00
Julius Volz a1601274ba
Support new duration format in graph range input (#7833)
* 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>
2020-08-21 11:53:11 +02:00
Harkishen-Singh cadf8f11bc Resolve conflicts.
Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>
2020-08-18 12:36:03 +05:30
Ben Kochie 8cccbf5b0e
Update various UI components (#7807)
* Correct jquery version in prom.lib.
* Update to bootstrap 4.5.2.
* Bump yarn versions.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-08-15 22:31:30 +02:00
Julius Volz 818bd96381
Fix detail swatch glitch (#7805)
* 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>
2020-08-15 01:44:13 +02:00
Simon Pasquier 1380e6c885
web/ui/react-app: bump version of create-react-app (#7778)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2020-08-11 17:49:09 +02:00
Brian Brazil ce838ad6fc
Ensure that step is in milliseconds in console graphs. (#7773)
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>
2020-08-11 12:33:40 +01:00
Julien Pivotto a92ae7196b
React: update dependencies (#7709)
- Fix lodash security issue
- Fix minors style issues detected by the upgrade

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-08-04 23:30:35 +02:00
Navaneesh Kumar 213b38613c
Change dropdown hover color to white (#5593)
Signed-off-by: Navaneesh Kumar <navaneeshkumarb@gmail.com>
2020-08-03 21:47:25 +02:00
Julien Pivotto 38fec5345d
React UI: Multiple improvements on /rules page (#7606)
* Add duration on rules page, hide annotation and labels if empty

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-07-21 11:55:09 +02:00
Julien Pivotto fe8d412ce9
React UI: Add duration, labels, annotations to alerts page (#7605)
* React UI: Add duration, labels, annotation to alerts page

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* lint

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* make expression shorter

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* Check for null

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

* Use object.keys

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-07-21 10:49:33 +02:00
Julien Pivotto a3ac9fa5f5
Add custom title to React UI (#7607)
* 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>
2020-07-21 10:48:29 +02:00
Sylvain Rabot 6a00626ee9
Display dates as well as timestamps in status page (#7544)
* 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>
2020-07-10 00:08:43 +02:00
Simon Pasquier 3155642108
web/ui/react-app: bump elliptic package version (#7477)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2020-06-29 10:28:05 +02:00
Mark Hansen f0a439bfc5
Web: Scroll hash-fragment links with navbar height (#7456)
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>
2020-06-27 09:12:11 +02:00
Simon Pasquier cf6890a3a8
web/ui: bump jQuery to 3.5.1 for the legacy UI (#7447)
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>
2020-06-24 16:14:28 +02:00
Nuno Cardoso f97d2ddb6e
REACT UI: CollapsibleAlertPanel - value field more friendly human readable (scientific notation -> number) (#7426)
* 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>
2020-06-23 20:10:56 +02:00
Lisa Carpenter dff31c2826
preserve state on page reload for alert status filters and annotations with useLocalStorage(), add toggleAnnotations method, and add passing tests (#7374)
Signed-off-by: Lisa Carpenter <carpenter.lisa@gmail.com>
2020-06-10 16:44:07 +02:00
Ben Kochie e963d953ea
Update yarn.lock (#7356)
Fixes websocket-extensions security warning.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-06-07 17:56:31 +02:00
Ben Kochie c7d9516695
Bump jquery to fix secuirty warning (#7311)
* Use major version dependency to make updates easier.
* Pin to >= 3.5.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-05-29 15:40:39 +02:00
Julius Volz 6e19c4697d
React UI: Don't null out data when clicking on current tab (#7243)
Fixes https://github.com/prometheus/prometheus/issues/7241

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2020-05-15 14:03:15 +02:00
Chris Marchbanks 62bd77bf93
Fix react tests (#7077)
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>
2020-04-01 16:37:52 +02:00
Brian Brazil 7646cbca32
Use .UTC everywhere we use time.Unix (#7066)
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>
2020-03-29 17:35:39 +01:00
Ben Kochie 269e7c8091
Fix golint issues.
Signed-off-by: Ben Kochie <superq@gmail.com>
2020-03-23 20:38:43 +01:00
Ben Kochie 24ecae9956
Update yarn deps (#7027)
Fix security warnings.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-03-22 20:38:48 +01:00
Jaga Santagostino 350f25eed3
changes from PR requests (#6880)
Signed-off-by: Jaga Santagostino <jagasantagostino@gmail.com>
2020-03-16 08:22:08 +01:00
李国忠 3fff701b77
[comments] change word ‘dependencie’ to ‘dependencies’ (#6904)
Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
2020-03-01 09:34:27 +01:00
Simon Kirsten 45fbed94d6
React UI: Fixed data table for matrix always showing 1 as value (#6896)
Signed-off-by: Simon Kirsten <1972314+skirsten@users.noreply.github.com>

React UI: Fixed data table for matrix always showing 1 as value
2020-02-29 07:45:48 +01:00
Chris Marchbanks 0e78908407
Escape target selector for tooltip on targets page (#6892)
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>
2020-02-28 20:27:45 +01:00
LongKB 82f7ed208b
Remove some duplicated words (#6882)
Signed-off-by: Pham Duc Hanh <hanhpd@fujitsu.com>
2020-02-27 07:08:31 +01:00