Commit graph

17 commits

Author SHA1 Message Date
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 <[email protected]>
2020-11-03 14:51:48 +01:00
TAY TS c9d827c1d0
Fix callback function bind with object as parameter (#7984)
Signed-off-by: TAY TS <[email protected]>
2020-09-30 11:06:42 +02:00
李国忠 d276b5fb65
[format]Js: format checktimedrift() success (#6850)
Signed-off-by: fuling <[email protected]>
2020-02-20 11:36:22 +01:00
David Leadbeater 129dbdaf74 Ensure warnings are escaped (#6279)
Signed-off-by: David Leadbeater <[email protected]>
2019-11-06 07:55:28 +00:00
Giedrius Statkevičius ad58fc4765 ui: handle null response properly (#6071)
* web/ui: handle null case

The call might sometimes return /api/v1/label/__name__/values the
following:

```
{"status":"success","data":null}
```

Then the `index.js` file assumes that `data` is not `null`. However,
that assumption fails and then we get this error in the console:

```
graph.js?v=foo:317 Uncaught TypeError: Cannot read property 'length' of null
    at Object.success (graph.js?v=foo:317)
...
```

Then it becomes impossible to, for example, send a simple query like
`time()` and graph the results.

Fix it by using an empty array as the result if it is `null`.

Signed-off-by: Giedrius Statkevičius <[email protected]>

* ui: update static assets data

Signed-off-by: Giedrius Statkevičius <[email protected]>
2019-10-08 19:52:12 -06:00
Simon Pasquier 26e8d25e0b
web/ui: avoid truncated Y-axis values (#6014)
* web/ui: avoid truncated Y-axis values

Signed-off-by: Simon Pasquier <[email protected]>

* Fix missing semi-colon

Signed-off-by: Simon Pasquier <[email protected]>
2019-09-12 09:42:19 +02:00
Stanislav Putrya 6141a8bd7c Show warnings in UI if query have returned some warnings (#5964)
* Show warnings in UI if query have returned some warnings
+ improve warning (error) text if query to remote was finished with error
* Add prefixes for remote_read errors

Signed-off-by: Stan Putrya <[email protected]>
2019-08-28 14:25:28 +01:00
slava 5e974d3170 Fix context for the showWarning function (#5833)
* Fix context for the showWarning function

If the difference between the current time on a client and time on a server is quite big, Prometheus tries to show a related warning in UI on the Graph tab. But in the code, an incorrect context is used to invoke this method. As a result, an error is showed in the web developer console and the whole page stop working at all. This commit fixes the context.

CC @juliusv

Signed-off-by: Vyacheslav Kulakov <[email protected]>

* Fix context for the showWarning function

Fixed assets

CC @juliusv

Signed-off-by: Vyacheslav Kulakov <[email protected]>
2019-08-05 20:03:12 +02:00
David 38fea83c1f Debounce input key press handling (#5309)
- input key handler causes 2 layout cycles on each keypress which can
clog up browser rendering when typing quickly
- this change adds a debounce to the key press handler of 500ms

Fixes #5308
Signed-off-by: David Kaltschmidt <[email protected]>
2019-03-06 16:16:55 +01:00
Maria Nemtinova 8e3a39f725 Web UI QoL improvements (#5201)
1. Added an ability to resize text area on mouseclick
2. Remember selected target status button on page reload

Signed-off-by: Maria Nemtinova <[email protected]>
2019-02-12 00:22:05 +01:00
Simon Pasquier a60431f3cd Merge v2.7.1 into master (#5170)
Signed-off-by: Simon Pasquier <[email protected]>
2019-02-01 09:54:12 +01:00
Vishnunarayan K I 108b9b0e5f Limit number of merics in prometheus UI (#5139)
Signed-off-by: Vishnunarayan K I <[email protected]>
2019-01-31 17:03:50 +00:00
Wei Guo 742583e836 Support to query elements by a specific time (#4764)
* support to query elements by a specific time

Signed-off-by: Wei Guo <[email protected]>
2018-10-26 14:16:40 +02:00
Ivan Voronchihin b3441cb0e7 Fix graph page for IE11 (#4148)
Signed-off-by: bege13mot <[email protected]>
2018-05-07 13:26:38 +01:00
Lovisa Svallingson 04f723ca44 [Fix 3789]: storing/loading multiple graphs from URL (#3813)
* Fix JS error: cannot read source of undefined

When the page was refreshed with queries on the page,
the updateTypeaheadMetricsSet function was called before
the typeahead had been initialized.

* Fix: updates URL when query submits

When queries were submitted by pressing enter, the URL did not update
to reflect the change. Not sure why, but this was only the case when
the queries were non-simple, meaning when either labels werre specified
or other promql functions were used.

* Rebase master and make assets
2018-02-15 13:23:12 +07:00
Lovisa Svallingson 460fe4dd0c Fix: Improve typeahead on /graph page (#3742)
* Do not autoselect the first item in the dropdown

* Historical queries only show in dropdown when toggled on

* Move shared behavior to queryHistory.isEnabled function

* Do not auto submit selected history queries
2018-02-02 19:16:29 +01:00
Lovisa Svallingson a8ff643464 Implement browsing of previous query expressions (#3486) 2017-12-21 18:58:05 +01:00
Renamed from web/ui/static/js/graph.js (Browse further)