* fix the way to get the list of workspaces
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* update UI dependencies
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* Allow copying label-value pair to buffer on click
Kept similar DOM structure to keep test compatibility.
Using `navigator.clipboard` API since it is used by the current standard browsers.
React hot toast is used to notify that the text was successfully copied into clipboard.
Signed-off-by: lpessoa <luisalmeida@yape.com.pe>
* Using reactstrap for toast notification
Using the bootstrap toast notification provided by reactstrap.
Clipboard handling is managed using React.Context via a shared callback.
Updated css according to CR suggestions.
Signed-off-by: lpessoa <luisalmeida@yape.com.pe>
* Changes from CR comments
Cleaning up renderFormatted method.
Renamed Clipboard to ToastContext.
Updated tests.
Signed-off-by: Luis Pessoa <luisalmeida@yape.com.pe>
Signed-off-by: lpessoa <luisalmeida@yape.com.pe>
Signed-off-by: Luis Pessoa <luisalmeida@yape.com.pe>
* Tweak colors in the dark theme to improve contrast
Some colors from the dark theme used in the query editor have a very low
contrast ratio with the background.
Signed-off-by: Jorge Luis Betancourt Gonzalez <jorge-luis.betancourt@trivago.com>
* Avoid duplicated function call when in dark mode
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: Jorge Luis Betancourt Gonzalez <jorge-luis.betancourt@trivago.com>
* Apply styles for the matching bracket when focused in dark mode
Signed-off-by: Jorge Luis Betancourt Gonzalez <jorge-luis.betancourt@trivago.com>
* Improve style of the matching brackets when focused
Signed-off-by: Jorge Luis Betancourt Gonzalez <jorge-luis.betancourt@trivago.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
* Allow formatting PromQL expressions in the UI
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Improve error handling, also catch HTTP errors
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove now-unneeded async property
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Disable format button when already formatted
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Disable format button when there are linter errors
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove disabling of format button again for linter errors
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* enable ui module publication
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* use main changelog of Prometheus to reflect the changes of the packages
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* ignore changelog and license in the libs
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* replace perses references
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
This follow a simple function-based approach to access the count and
sum fields of a native Histogram. It might be more elegant to
implement “accessors” via the dot operator, as considered in the
brainstorming doc [1]. However, that would require the introduction of
a whole new concept in PromQL. For the PoC, we should be fine with the
function-based approch. Even the obvious inefficiencies (rate'ing a
whole histogram twice when we only want to rate each the count and the
sum once) could be optimized behind the scenes.
Note that the function-based approach elegantly solves the problem of
detecting counter resets in the sum of observations in the case of
negative observations. (Since the whole native Histogram is rate'd,
the counter reset is detected for the Histogram as a whole.)
We will decide later if an “accessor” approach is really needed. It
would change the example expression for average duration in
functions.md from
histogram_sum(rate(http_request_duration_seconds[10m]))
/
histogram_count(rate(http_request_duration_seconds[10m]))
to
rate(http_request_duration_seconds.sum[10m])
/
rate(http_request_duration_seconds.count[10m])
[1]: https://docs.google.com/document/d/1ch6ru8GKg03N02jRjYriurt-CZqUVY09evPg6yKTA1s/edit
Signed-off-by: beorn7 <beorn@grafana.com>
* bump codemirror to v0.20.x and lezer to v.0.16.x
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* bump codemirror to v6 and lezer to v1
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* stop treating warning as error for UI
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>