Commit graph

297 commits

Author SHA1 Message Date
Boyko 731ca08acd React UI: Graph legend (#6321)
* initial commit

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* eslint fixes

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* hover bug fix

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* refactoring

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* remove unnecessary check

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* fix tests

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* lint fix

https://github.com/prometheus/prometheus/issues/6268
Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* fix typos

Fixes<https://github.com/prometheus/prometheus/issues/6268>

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* init hover events if can

Fixes: <https://github.com/prometheus/prometheus/issues/6268>

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* review changes

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* fix activeIndex bug

Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* extend plot options types

Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* adding more types

Signed-off-by: blalov <boyko.lalov@tick42.com>

* fix branch after wrong force push

Signed-off-by: blalov <boyko.lalov@tick42.com>

* unit test fixes

Signed-off-by: blalov <boyko.lalov@tick42.com>

* remove unused variables

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-11-24 13:14:57 +01:00
Julius Volz cb92a45bf3
React UI: Make test spy attachment more jest-y (#6361)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-24 13:14:01 +01:00
Julius Volz 22d884b38e
React UI: Fix tests harder (#6316)
* React UI: Fix tests harder

Again not sure why this passed last time (?), but now I was getting an
error about 'NaN' not being a valid value to assign to the 'height'
property of the input element. This changes it so that only the blur()
function is actually mocked out on the active input element.

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

* Fixup

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-22 16:20:07 +01:00
Julius Volz 20ec57160c
React UI: Clarify VSCode usage requirements (#6357)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-22 14:55:32 +01:00
Julius Volz d2cb05846b
React UI: Add /tsdb-status to React-handled routes (#6313)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-20 15:50:52 +01:00
Boyko 3e3b7ceb0b React UI: Change the dynamic react key with static id (#6325)
* change the dynamic key with static id for react key prop

Signed-off-by: blalov <boyko.lalov@tick42.com>

* test fix

Signed-off-by: blalov <boyko.lalov@tick42.com>

* add initial panel on did mount

Signed-off-by: blalov <boyko.lalov@tick42.com>

* lint fix

Signed-off-by: blalov <boyko.lalov@tick42.com>

* remove filter for empty expression

Signed-off-by: blalov <boyko.lalov@tick42.com>

* refactoring

Signed-off-by: blalov <boyko.lalov@tick42.com>

* refactor encodePanelOptionsToQueryString

Signed-off-by: blalov <boyko.lalov@tick42.com>

* refactor encodePanelOptionsToQueryString

Signed-off-by: blalov <boyko.lalov@tick42.com>

* revert to format range/endTime

Signed-off-by: blalov <boyko.lalov@tick42.com>

* urlParams unit tests

Signed-off-by: blalov <boyko.lalov@tick42.com>

* unit tests adjustments

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
2019-11-20 15:33:03 +01:00
Julius Volz 85cae37107
React UI: Add better docs for the React UI (#6315)
* React UI: Add better docs for the React UI

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

* Fixups

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

* Fixup

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-14 19:53:10 +01:00
Julius Volz 2a6df53416
React UI: Make link to classic UI work (#6320)
It being a Reach Router <Link> caused the Reach router to not actually
leave the React app, even though the destination path was not a path
handled by the Reach Router.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-14 18:46:39 +01:00
Boyko 12d347e4db unit test fixes (#6314)
Signed-off-by: Boyko Lalov <boyskila@gmail.com>
2019-11-13 14:58:45 +01:00
Julius Volz e110402d44
React UI: Fix build (#6312)
This fixes two TypeScript errors. Not sure why we didn't catch the
breakage in the PR CI tests... also, updating TypeScript just for good
measure.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-13 13:36:43 +01:00
Boyko 8a9509b0a8 Replace fetching hooks with class render prop component (#6267)
* replace fetching hooks with class render prop component

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* rename Fetcher

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* status page markup separated from fetcher component

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* fetch api reusability

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* extract Config and Flags pages as 'dumb' components

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* more components splitting

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* implement fetchWithstatus HOC

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* refactor changed files tests

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* switching back to hooks.

Signed-off-by: blalov <boyko.lalov@tick42.com>
Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* fetch response bug fix

Signed-off-by: Boyko Lalov <boyskila@gmail.com>

* make wrapped by withstatusIndicator components names consistent

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
2019-11-12 14:35:47 +01:00
Sharad Gaur a85e7aac0e Adding TSDB Stats Page in React UI (#6281)
Signed-off-by: Sharad Gaur <sgaur@splunk.com>
2019-11-12 11:15:20 +01:00
Boyko fc309a35bb update panels on back button pressed (#6300)
Signed-off-by: Boyko Lalov <boyskila@gmail.com>
2019-11-12 10:21:23 +01:00
Dustin Hooten ca60bf298c React UI: Implement /targets page (#6276)
* Add LastScrapeDuration to targets endpoint

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

* Add Scrape job name to targets endpoint

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

* Implement the /targets page in react

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

* Add state query param to targets endpoint

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

* Use state filter in api call

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

* api feedback

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

* pr feedback frontend

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

* Implement and use localstorage hook

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

* PR feedback

Signed-off-by: Dustin Hooten <dhooten@splunk.com>
2019-11-11 22:42:24 +01:00
Julien Pivotto d2257cb7d8 React UI: Display small numbers correctly (#6274)
Closes #6272

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2019-11-06 12:37:17 +01:00
David Leadbeater 129dbdaf74 Ensure warnings are escaped (#6279)
Signed-off-by: David Leadbeater <dgl@dgl.cx>
2019-11-06 07:55:28 +00:00
Julius Volz 431844f0a7
React UI: Mark not-yet-done pages as under construction (#6277)
This is a quick change because the release is about to be cut in a few
hours and it would be good to clarify to users what the empty pages in
the new UI are about.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-05 20:09:37 +01:00
Julius Volz 3836cc1997 React UI: Fix left/right icons in the time picker (#6275)
https://github.com/prometheus/prometheus/pull/6193 removed these icons
from the font library, but the non-React timepicker library requires
these.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-05 08:15:18 -07:00
Sharad Gaur e94503ff5c Head Cardinality Status Page (#6125)
* Adding TSDB Head Stats like cardinality to Status Page

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Moving mutx to Head

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Renaming variabls

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Renaming variabls and html

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Removing unwanted whitespaces

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Adding Tests, Banchmarks and Max Heap for Postings Stats

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Adding more tests for postingstats and web handler

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Adding more tests for postingstats and web handler

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Remove generated asset file that is no longer used

Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>

* Changing comment and variable name for more readability

Signed-off-by: Sharad Gaur <sgaur@splunk.com>

* Using time.Duration in postings status function and removing refresh button from web page

Signed-off-by: Sharad Gaur <sgaur@splunk.com>
2019-11-04 19:06:13 -07:00
Boyko 7293c859ab pass the value to the input instead to downshift (#6235)
* pass the value to the input instead to downshift

Signed-off-by: blalov <boyko.lalov@tick42.com>

* adjust expression input tests

Signed-off-by: blalov <boyko.lalov@tick42.com>

* improve ExpressionInput test coverage

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-11-04 13:15:25 +01:00
Julius Volz 95554074d8
React UI: Support custom path prefixes (#6264)
* React UI: Support custom path prefixes

The challenge was that the path prefix can be set dynamically as a flag
on Prometheus, but the React app bundle is statically compiled in to
expect a given path prefix. By adding a placeholder value to the React
app's index.html and replacing it in Prometheus with the right path
prefix during serving, this injects Prometheus's path prefix into the
React app via a global const.

Threading the path prefix into the different React components could have
been done with React's Contexts (https://reactjs.org/docs/context.html),
but I found the consumer side of context values to be a bit cumbersome
(wrapping entire components in context consumers), so I ended up
preferring direct threading of the path prefix values to components that
needed them. Also, using contexts in tests is more verbose than just
passing in path prefix values directly.

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

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

* Review feedback

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-04 09:17:50 +01:00
Julius Volz 5bc935337a
React UI: Simpler and relative-only query URL building (#6263)
I prefer just keeping it dumb (and it helps with a current Netlify
deploy hack I have).

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-03 13:21:35 +01:00
Julius Volz 8c0b76d1da
React UI: Improve styling of autocomplete sections (#6228)
* React UI: Improve styling of autocomplete sections

I removed the Card-related components and went back to normal <ul>/<li>,
since the style that Cards added just got in the way (like adding extra
borders and rounding, etc.), and from the examples at
https://getbootstrap.com/docs/4.3/components/card/, it doesn't seem like
multiple Cards are meant to be used as part of a larger list
(style-wise).

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

* Address review feedback

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-03 12:47:47 +01:00
Julius Volz fffb5ca1e9
React UI: More conversions to Function Components (#6259)
* React UI: More conversions to Function Components

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

* Address chat feedback over Riot

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-11-02 21:45:22 +01:00
Boyko cb7cbad5f9 WIP: status page - API and UI (#6243)
* status page initial commit

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>

* refactor useFetch

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>

* refactoring

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>

* adding tests

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>

* snapshot testing

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>

* fix wrong go files formatting

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>

* change the snapshot library

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>

* update api paths

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>

* move test folder outside src

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>

* useFetches tests

Signed-off-by: blalov <boyko.lalov@tick42.com>

* sticky navbar

Signed-off-by: Boyko Lalov <boyskila@gmail.com>
Signed-off-by: blalov <boyko.lalov@tick42.com>

* handle runtimeInfo error on Gather() and add json tags to RuntimeInfo struct

Signed-off-by: blalov <boyko.lalov@tick42.com>

* refactor alert managers section

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-11-02 16:53:32 +01:00
Chris Marchbanks f17a0e17aa Implement the /flags page in react (#6248)
* Implement the /flags page in react

Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>

* Use custom react hook for calling api

Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
2019-11-02 10:27:36 +01:00
Michał 040425b0eb filtering alerts by state and display count of alerts in each state (#5758)
* local storage selectedTab on targets tab was renamed

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>

* added filters when displaying alerts

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>

* function was simplified

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>

* fixed rebase

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>

* minor rename

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>

* Active -> Pending

Signed-off-by: Michał Szczygieł <1153719+mszczygiel@users.noreply.github.com>
2019-10-29 11:09:52 +01:00
Dustin Hooten e0443e6fa3 Add unit tests for react-app (#6234)
* Add MetricFormat unit tests

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

* Add App unit tests; Add debug script

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

* Add Checkbox unit tests

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

* Add SeriesName unit tests

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

* Add QueryStatsView unit test

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

* Add Legend unit tests

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

* Remove unused utils/func

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

* Add utils/urlParams unit test

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

* Add utils/timeFormat unit test

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

* Add ExpressionInput unit tests

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

* Add GraphControls unit test

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

* Add TimeInput unit test

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

* Add DataTable unit test

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

* Add SanitizeHTML unit test

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

* Add Graph unit test

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

* Extract utils/html

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

* Add PanelList unit test

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

* Add Panel unit test

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

* Add react-ui test coverage report to CI

Signed-off-by: Dustin Hooten <dhooten@splunk.com>
2019-10-28 18:09:48 +01:00
CSTDev 3b39f6ae45 WIP: React UI Linting rules (#6206)
* Initial react-ui linting rules

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Add react linting to build process

Move eslint config to its own file to keep package.json clearer.

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Linting changes from master

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Move CI linting to makefile and travis

Also add trailing comma to multiline imports.

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Add lint fix target to makefile

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Lint latest master

Signed-off-by: cstdev <pietomb00@hotmail.com>
2019-10-28 15:02:42 +01:00
Julius Volz e8027ba515
React UI: Serve React UI under /new (#6229)
This makes React UI URLs look nicer than the previous
/static/graph-new/app.html, but internally still serves all React UI
files from the compiled-in static assets directory.

Also, to allow future usage of the React / Reach router, we need to
serve the main React app's index.html on certain sub-paths that
correspond to current Prometheus's UI pages, instead of trying to serve
actual files that match the provided path name.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-28 10:45:53 +01:00
Ben Kochie 3f3986ed53 Adjust React query stats font (#6238)
* Use root relative font size rather than px to avoid hidpi issues.
* Darken to 50% saturation of base font color.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-10-28 10:22:36 +01:00
Julius Volz c83094b443
React UI: Implement /config page (#6236)
* React UI: Implement /config page

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

* Address review comments

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-28 10:00:00 +01:00
Boyko 8afa8452fd reach router integration initial commit (#6232)
Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-10-27 22:03:39 +01:00
Julius Volz db76da7603
React UI: Fix initial setting of past queries (#6226)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-26 22:20:52 +02:00
Julius Volz 9698262b63
React UI: Simplify query history setting code (#6225)
The metric names only get loaded once initially, so there is no reason
to mix them up with the handling of ongoing query history.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-26 21:17:24 +02:00
Boyko dab87ca281 split autocomplete dropdown in to groups (#6211)
* split autocomplete dropdown in to groups

Signed-off-by: blalov <boyko.lalov@tick42.com>

* fix autocomplete flickering

Signed-off-by: blalov <boyko.lalov@tick42.com>

* fix expression input issue.

Signed-off-by: blalov <boyko.lalov@tick42.com>

* select autocomplete item issue fix

Signed-off-by: blalov <boyko.lalov@tick42.com>

* remove metric group abstraction

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-10-26 19:50:22 +02:00
Julius Volz 8cf054849f
Update more web/ui/README.md bits for new UI (#6197)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-25 10:19:21 +02:00
Boyko e235af9c47 migrate query history (#6193)
* migrate query history

Signed-off-by: blalov <boyko.lalov@tick42.com>

* update lock file

Signed-off-by: blalov <boyko.lalov@tick42.com>

* set expression input height when item is selected

Signed-off-by: blalov <boyko.lalov@tick42.com>

* pr review changes

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-10-23 22:18:41 +02:00
CSTDev 4262ad92ce React ui add query stats (#6190)
* Adds the query stats to UI

Adds the query load time, resolution and total number of time series,
as the current UI has

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Implement unit test for QueryStats

Signed-off-by: cstdev <pietomb00@hotmail.com>

* Tidy Query Stats component

Rename it and expose a interface for the values it displays
Make it a functional component as it has no state or lifecycle
Better null/undefined checks
Only render if needed, decided by the panel
Remove old stats if the next errors

Signed-off-by: cstdev <pietomb00@hotmail.com>
2019-10-23 12:47:37 +02:00
Julius Volz 1c238ac086
Add links between classic and new UIs (#6191)
The links preserve the graph settings between the two UIs.

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

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-21 20:18:47 +02:00
Boyko b5a16a8f86 make expression input controlled (#6174)
* make expression input controlled

Signed-off-by: blalov <boyko.lalov@tick42.com>

* close menu explicitly  when autosuggestion dropdown is hidden

Signed-off-by: blalov <boyko.lalov@tick42.com>
2019-10-20 22:52:29 +02:00
Ritesh Shrivastav 0f91ff4540 React UI: Sanitize HTML string to allow only supported elements (#6165)
* Add component to sanitize html

Signed-off-by: Ritesh Shrivastav <ritesh.conf@gmail.com>

* Use SanitizeHTML component to allow only supported elements

Signed-off-by: Ritesh Shrivastav <ritesh.conf@gmail.com>

* Add allowedTags props in SanitizeHTML component

Signed-off-by: Ritesh Shrivastav <ritesh.conf@gmail.com>
2019-10-17 20:52:24 +02:00
Julius Volz ccac71ca5a
Update all React app node modules (#6153)
* Update all React app node modules

I ran "yarn upgrade --latest" and then fixed items that caused errors
with new linter settings in the React UI source.

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

* Fix more React UI lint errors that fail CI

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-17 16:34:02 +02:00
Julius Volz 63899f5529
Remove obsolete console.log() statements (#6159)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-17 16:24:07 +02:00
Julius Volz bca6e90ea6
Integrate beginning of React UI (#5694)
* Initial commit from Create React App

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

* Initial Prometheus expression browser code

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

* Grpahing, try out echarts

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

* Switch to flot

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

* Add metrics fetching and stuff

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

* Autosuggest and graph improvements

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

* Start implementing graph controls, add loading spinner

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

* So many new features and fixes

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

* Fixed and built more features

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

* Make datetimepicker clear work

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

* Don't abort when executing empty expression

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

* Remove TabPaneAlert

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

* Split components into separate files

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

* Add table time input

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

* Move first files to TypeScript!

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

* More TypeScript conversions

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

* More TS conversions

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

* More TS conversions

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

* More TS conversions

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

* More TS conversions

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

* More TS fixes

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

* Convert Graph to TS

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

* Changes

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

* Resize detector, start building legend, axis font colors

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

* Make graph legend work

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

* Add URL params support and much more

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

* Put panel state into panel list, write URL options

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

* Change order of Graph and Table tabs

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

* Generalize time input naming more

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

* Work on history functionality

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

* npm updates

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

* Move loading indicator into "Execute" button

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

* Fix typo

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

* Revert "Move loading indicator into "Execute" button"

This reverts commit ce7daee1f1af35da6c0d8b5517272839285ccfec.

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

* Improve error message when failing to fetch server time

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

* Move all code to Prometheus repo target dir

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

* Add react-app Makefile step and check in generated assets

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

* Add preliminary npm packages notice to NOTICE file

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

* Update React app's favicon and metadata

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

* Remove RP server refs, cleanups

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

* Use CircleCI image that includes NodeJS

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

* Add some missing React output assets

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

* Preserve CRLF in generated React files

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

* Switch from npm to yarn for React UI

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

* Save npm licenses and include them in release tarball

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

* Install npm on Travis

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

* Remove npm license tarball from source

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

* Remove React graph bundle from source

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

* Don't check in any compiled web assets

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

* Update README.md with node/yarn/React UI info

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

* Fix asset build step on CircleCI promu crossbuild

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

* Try to fix multi-arch go generate

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

* Remove check_assets from Travis CI build

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

* Prevent rebuilding of unchanged React app parts

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

* Fix npm license tarball path for promu

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

* Simplify Makefile

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

* Clarify build instructions in README.md

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

* Make minimal JS test pass

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

* Integrate React app tests into Makefile

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

* Separate react-app-tests target, but run it from CI

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

* Fix working directory for React app tests

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

* Remove local modifications to Makefile.common

This means that CircleCI will not run the React app tests, but at least
Travis still will...

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

* Depend on node_modules path for npm_licenses target

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

* Simplify tarball/docker/build Makefile targets

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

* Include React tests in "test" target

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

* Remove reference to removed "check_assets" target

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

* Do initial resize of expression input field

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

* Add React app proxying to local Prometheus in dev mode

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-17 14:38:09 +02:00
Krasi Georgiev 81d284f806
Merge the 2.13 release branch to master (#6117) 2019-10-09 17:41:46 +02: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 <giedriuswork@gmail.com>

* ui: update static assets data

Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
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 <spasquie@redhat.com>

* Fix missing semi-colon

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-09-12 09:42:19 +02:00
Max cb5213e914 Change the global variable 'name' to a local variable so that it can not populate the global space. (#5970)
* Change the global variable 'name' to a  local variable so that it can not populate the global space.

Signed-off-by: 朱正浩,Zhu Zhenghao <zhenghao.zhu@daocloud.io>

* run make assets

Signed-off-by: 朱正浩,Zhu Zhenghao <zhenghao.zhu@daocloud.io>
2019-08-31 08:33:31 -06: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 <root.vagner@gmail.com>
2019-08-28 14:25:28 +01:00
Harkishen Singh f0bb8129c3 Fixes service-discovery view when accessed from unhealthy targets (#5915)
* fix service-discovery view

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

* updated localStorage logic

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

* sign off

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

* committed vfs unicodes

Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>
2019-08-21 13:57:08 +02: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 <vkulakov@swiftserve.com>

* Fix context for the showWarning function

Fixed assets

CC @juliusv

Signed-off-by: Vyacheslav Kulakov <vkulakov@swiftserve.com>
2019-08-05 20:03:12 +02:00
Sylvain Rabot 7cd5cf0b69 Sanitize HTML output (#5665)
* Compact html output
* Fix html style block location

Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>
2019-06-25 13:39:34 +01:00
Tariq Ibrahim c4b57ac4e2
fix minor issue in the <a> tag of rules.html
Signed-off-by: Tariq Ibrahim <tariq181290@gmail.com>
2019-05-16 13:00:35 -07:00
pbhudiaBAE 43953b105b Sorting alerts by group name in /alerts (#5448)
* Working group name

Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>

* Working categorised by group name

Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>

* Changed group sorting in web

Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>

* Fixed group sorting and comments

Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>

* Fixed group sorting and comments with gofmt

Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>

* Added file and group name

Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>

* reverted back to full path to yml file

Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>
2019-05-14 23:14:27 +02:00
Simon Pasquier 03b90b4645
web/ui: update to Bootstrap 4.3.1 (#5506)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-04-30 10:16:36 +02:00
Ganesh Vernekar 0afd172224
Merge pull request #5416 from prometheus/release-2.8
Merge 2.8.1 into master
2019-03-29 15:20:49 +05:30
Simon Pasquier 7328cb6cc2 web/ui: display the job label in /targets
PR #4806 was removed accidentally by #5192 (Bootstrap upgrade).

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-26 16:52:48 +01:00
Matthias Loibl b7e978d255 web/ui: Fix padding in navbar container (#5371)
Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
2019-03-18 23:17:49 +01:00
Julien Pivotto 6c72cdb1e1 Add GODEBUG to the runtime page (#5324)
This is useful, e.g. with go 1.12 to see if TLS1.3 has been enabled.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2019-03-18 11:10:13 +00:00
Krasi Georgiev 9d96ada510 Display correct values for the retention in the flags web gui. (#5322)
* Display correct values for the retention in the flags web gui.

Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>

* adding a log entry

Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>

* added the retention info to the runtime status page

Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>

* simplify the retention display

Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
2019-03-11 22:48:57 +05:30
Julien Pivotto 6152df44c2 ui: Expand expression_select to 220px
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2019-03-11 17:24:25 +01:00
Ganesh Vernekar 46e0587cb3
Merge pull request #5318 from roidelapluie/sdtag
ui: remove extra table tag in service discovery
2019-03-11 20:13:13 +05:30
Julien Pivotto 5a162dc1ab
ui: remove extra table tag in service discovery
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2019-03-09 11:02:14 +01:00
Julien Pivotto 981f9208fb
ui: Remove time picker borders
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2019-03-08 22:58:31 +01: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 <david.kaltschmidt@gmail.com>
2019-03-06 16:16:55 +01:00
Julius Volz fdbaef86df Re-add typeahead license header to minified file
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-02-17 22:50:20 +00:00
Julius Volz 661f0127bc Rebuild web assets
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-02-17 22:50:16 +00:00
Julius Volz ed635190ba Re-add popper.js to fix target label tooltips
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-02-17 19:40:57 +00:00
Julius Volz 7b724cea3a Whitespace and other cleanups
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-02-17 19:40:52 +00:00
Julius Volz 7244ef3783 Add more top/bottom spacing for All/Unhealthy buttons
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-02-17 19:40:48 +00:00
Julius Volz 028e99e3d6 Remove spacing between All/Unhealthy buttons
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-02-17 19:40:44 +00:00
Julius Volz 45b91e8e80 Fix copy&paste button on /config, move pre style to CSS
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-02-17 19:40:30 +00:00
Julius Volz cd569b51d9 Merge branch 'master' into bootstrap4 2019-02-17 17:22:41 +00: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 <nemtinovamasha@gmail.com>
2019-02-12 00:22:05 +01:00
jritchieBAE b8f0a41745 Update to Bootstrap 4.1.3 (#5192)
* web: updated bootstrap3-typeahead file to work with bootstrap 4.0.0

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: Replaced bootstrap-3.3.1 with bootstrap 4.0.0

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: Added bootstrap4-glyphicons as 4.0.0 doesnt include bootstrap3 glyphicons

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: updated js jquery to 3.3.1

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: updated _base.html to import new bootstrap 4.0.0, jquery3.3.1 and bootstrap class tags to be 4.0 compatible

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: _base.html missed word out in title tag (Server).

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: updated alerts.html class names and tags to be bootstrap 4 compatible.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: updated config.html class names and tags to be bootstrap 4 compatible.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: updated flags.html class names and tags to be bootstrap 4 compatible.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: updated service-discovery.html class names and tags to be bootstrap 4 compatible.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: updated status.html class names and tags to be bootstrap 4 compatible.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: updated targets.html class names and tags to be bootstrap 4 compatible.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: updated graph_template.handlebar class names and tags to be bootstrap 4 compatible.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: alerts.css fix for button color inheritance on alerts page.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: graph.css fix for color inheritance.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: prometheus.css updated to fix nav bar.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* web: previous merge conflict not fixed correctly on _base.html

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* menu.lib and prom.lib imports updated

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* bootstrap 4.1.3 imported

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Bootstrap 4.1.3 imported into _base.html

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* bootstrap 4.1.3 imported into prom.lib

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* menu.lib style adjusted to view sidebar

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Alert colour uplifted to bootstrap 4.1.3

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Alerts display code reformatted similarly to config

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Consoles pages adjusted to account for new navbar

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* LHS Menu fixed in console pages

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Minor changes to prom_console to adjust lhs nav

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Prom.lib and some css updated to fix console graph controls

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Bootstrap 4.0.0 files removed

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Consoles configured so that the graph fits with the new side bar, css files also adjusted

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Import popper.min.js for dropdowns

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Popper.min.js imported locally

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Re-added #4764 and fixed css

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Removed .DS_Store

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Rebuilt assets

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* Spaces between buttons and inputs on graph page removed

Signed-off-by: ksherryBAE <kieran.sherry@baesystems.com>

* fixed spacing in buttons on /targets

Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>

* Updated vfsdata.go

Signed-off-by: Pritam Bhudia <pritam.bhudia@baesystems.com>

* fixed typeahead issue

Signed-off-by: James Ritchie <james.g.ritchie@baesystems.com>

* added css for dropdown

Signed-off-by: James Ritchie <james.g.ritchie@baesystems.com>

* changed order of css imports

Signed-off-by: James Ritchie <james.g.ritchie@baesystems.com>

* tinkered with CSS changes to make keyboard select and mouseover match

Signed-off-by: James Ritchie <james.g.ritchie@baesystems.com>
2019-02-07 22:18:09 +01:00
Simon Pasquier a60431f3cd Merge v2.7.1 into master (#5170)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
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 <appukuttancr@gmail.com>
2019-01-31 17:03:50 +00:00
Stafford Williams 328d81999a /config: Added Copy to clipboard button for /config (#4410)
* added `Copy to clipboard` button

Signed-off-by: Stafford Williams <stafford.williams@gmail.com>

* generate vsfdata

Signed-off-by: Stafford Williams <stafford.williams@gmail.com>

* new lines

Signed-off-by: Stafford Williams <stafford.williams@gmail.com>

* single newline

Signed-off-by: Stafford Williams <stafford.williams@gmail.com>
2018-11-27 16:05:26 +08:00
David Coles 1591ebf985 ui: Fix hover when metric has null value. (#4906)
When a metric has a null value, number formatters like
`humanizeNoSmallPrefix` will throw "Uncaught TypeError: Cannot read
property 'toPrecision' of null".

This is fixed by explicitly checking for `null` and returning the string
"null".

Note: This is usually not seen as rickshaw doesn't show annotations for
null values, but still calls the formatter.

Signed-off-by: David Coles <coles.david@gmail.com>
2018-11-25 14:16:48 +08:00
achiuBAE a9050c45f6 Allow setting the Prometheus instance document title through a flag. (#4841)
* web: added ability to set page title through flag.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* Reformatted variable names and Flag description for readability.

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* assets_vfsdata.go

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* Flag name changed from web.ui-title to web.page-title

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>

* make assets

Signed-off-by: Andrew Chiu <andrew.chiu2@baesystems.com>
2018-11-21 12:45:06 +08:00
Simon Pasquier d89c01b065 web/ui: fix asset generation for Go modules installs
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-11-12 10:56:21 +01:00
Simon Pasquier bf9a1d3d15 *: fix assets generation
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-11-12 10:38:29 +01:00
Simon Pasquier 0a319b001a Update documentation
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-11-09 15:01:15 +01:00
Simon Pasquier 5230e2730a
*: check that assets are up-to-date (#4731)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-11-09 11:31:36 +01:00
Simon Pasquier 147f2061d5 web: display job label in targets page
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-10-30 16:20:43 +01: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 <me@imkira.com>
2018-10-26 14:16:40 +02:00
Ariya Hidayat a0ba9b7f3e Avoid browser's spell-checking the Expression field (#4728)
Signed-off-by: Ariya Hidayat <ariya.hidayat@gmail.com>
2018-10-17 10:54:16 +02:00
Simon Pasquier c4a6acfb1e
*: move to go 1.11 (#4626)
* *: move to go 1.11

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Reduce number of places where we specify the Go version

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-10-16 09:41:45 +02:00
Will Hegedus 193ebe7e34 Updates to /targets and /rules (scrape duration, last evaluation time) (#4722)
* Add evaluationTimestamp (Last Evaluation) column to display on /rules
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>

* Add lastScrapeDuration ("Scrape Duration") to display on /targets
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>

* Updates based on Julius' feedback

Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>

* Update to set timestamp to when eval started (after eval completes)

Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>

* Update /rules to display time since last evaluation

Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>

* Re-order Last Eval/Eval Time to be consistent with targets page

Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
2018-10-12 18:26:59 +02:00
Benji Visser eb4cc37e50 Update moment.js and moment-timezone.js (#4679)
* upgrading moment-timezome (0.5.13 -> 0.5.17)
* upgrading dependency moment (2.16.0 -> 2.22.2)

Signed-off-by: noqcks <benny@noqcks.io>
2018-10-10 09:48:06 +01:00
Julien Pivotto 17fea5478a Improve rule views by wrapping lines (#4702)
With the addition of the errors in the views list, it is now difficult
to have a view on all the rules in a screen witdh.

This commit adds wrapping to improve the overall display of the rules
page.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2018-10-07 15:31:16 +01:00
Goutham Veeramachaneni 9ee4b05d16
Better link for docs (#4593)
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
2018-09-13 15:26:41 +05:30
Simon Pasquier 3581377e5d Replace go-bindata with vfsgen (#4430)
Looking at https://tech.townsourced.com/post/embedding-static-files-in-go/ (which was mentioned in the issue), vfsgen has all the needed features.

In particular:

- Reproducible builds (no issue with timestamping).
- Well maintained and relatively popular.
- Integration with go generate.
- Self-contained (no external dependency).

* [WIP] Replace go-bindata by vfsgen

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Add license + remove doc.go

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Generate templates assets

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Use new templates assets

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* split static assets

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Idempotent make assets

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Update vendor/

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* vendor vfsgendev

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Update README.md

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Simplify assets generation

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Fix README.md

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Use generate helper program instead of vfsgen

This avoids installing vfsgendev in the target environment.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Remove unused vfsgen package

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Fix Makefile

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* vendoring shurcooL/vfsgen

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Fix go generate command

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Sync web/ui/assets_vfsdata.go

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-08-24 09:03:10 +02:00
Benji Visser 8bb6e0dd6e Show rule evaluation errors on rules page (#4457)
* adding information about the health and errors for Rules

adding Health() and LastError() to the Rule interface. This will allow
us to easily surface information about rules.

Signed-off-by: noqcks <benny@noqcks.io>

* updating rules.html with fields for Rule errors and health state

Signed-off-by: noqcks <benny@noqcks.io>

* fix code comment grammar & access Rule health/error info using a mutex

Signed-off-by: noqcks <benny@noqcks.io>

* s/Errors/Error/ in rules.html to remain consistent with targets.html

Signed-off-by: noqcks <benny@noqcks.io>

* adding periods to code comments in reporting/alerting

Signed-off-by: noqcks <benny@noqcks.io>

* putting health/error below mutex in struct field

Signed-off-by: noqcks <benny@noqcks.io>
2018-08-07 00:33:45 +02:00
Julius Volz 8763dedb9d
Update method name in rules template, fix rendering (#4416)
Fixes https://github.com/prometheus/prometheus/issues/4407

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2018-07-25 18:25:43 +02:00
Stafford Williams 286a8e0554 go-bindata debug clarification (#4411)
Signed-off-by: Stafford Williams <stafford.williams@gmail.com>
2018-07-24 14:01:56 +01:00
Adam Shannon 566c80b47c web: add named anchors for each rule group (#4130)
* web: add named anchors for each rule group

Signed-off-by: Adam Shannon <adamkshannon@gmail.com>
2018-07-18 16:34:41 +01:00
Martin Lee d0f11a3cc6 Forbid rule-abiding robots from indexing. (#4266)
* Resolves github issue #4257

Signed-off-by: Martin Lee <martin@billforward.net>
2018-07-18 05:01:57 +01:00
Fabian Reinartz 9c83e815d1 Merge branch 'release-2.2' into update 2018-06-05 05:29:11 -04:00