* annotations: add 25px space for events section
* annotations: restored create annotation action
* annotations: able to use fa icons as event markers
* annotations: initial emoji support from twemoji lib
* annotations: adjust fa icon position
* annotations: initial emoji picker
* annotation: include user info into annotation requests
* annotation: add icon info
* annotation: display user info in tooltip
* annotation: fix region saving
* annotation: initial region markers
* annotation: fix region clearing (add flot-temp-elem class)
* annotation: adjust styles a bit
* annotations: minor fixes
* annoations: removed userId look in loop, need a sql join or a user cache for this
* annotation: fix invisible events
* lib: changed twitter emoij lib to be npm dependency
* annotation: add icon picker to Add Annotation dialog
* annotation: save icon to annotation table
* annotation: able to set custom icon for annotation added by user
* annotations: fix emoji after library upgrade (switch to 72px)
* emoji: temporary remove bad code points
* annotations: improve icon picker
* annotations: icon show icon picker at the top
* annotations: use svg for emoji
* annotations: fix region drawing when add annotation editor opened
* annotations: use flot lib for drawing region fill
* annotations: move regions building into event_manager
* annotations: don't draw additional space if no events are got
* annotations: deduplicate events
* annotations: properly render cut regions
* annotations: fix cut region building
* annotations: refactor
* annotations: adjust event section size
* add-annotations: fix undefined default icon
* create-annotations: edit event (frontend part)
* fixed bug causes error when hover event marker
* create-annotations: update event (backend)
* ignore grafana-server debug binary in git (created VS Code)
* create-annotations: use PUT request for updating annotation.
* create-annotations: fixed time format when editing existing event
* create-annotations: support for region update
* create-annotations: fix bug with limit and event type
* create-annotations: delete annotation
* create-annotations: show only selected icon in edit mode
* create-annotations: show event editor only for users with at least Editor role
* create-annotations: handle double-sized emoji codepoints
* create-annotations: refactor
use CP_SEPARATOR from emojiDef
* create-annotations: update emoji list, add categories.
* create-annotations: copy SVG emoji into public/vendor/npm and use it as a base path
* create-annotations: initial tabs for emoji picker
* emoji-picker: adjust styles
* emoji-picker: minor refactor
* emoji-picker: refactor - rename and move into one directory
* emoji-picker: build emoji elements on app load, not on picker open
* emoji-picker: fix emoji searching
* emoji-picker: refactor
* emoji-picker: capitalize category name
* emoji-picker: refactor
move buildEmojiElem() into emoji_converter.ts for future reuse.
* jquery.flot.events: refactor
use buildEmojiElem() for making emojis, remove unused code for font awesome based icons.
* emoji_converter: handle converting error
* tech: updated
* merged with master
* shore: clean up some stuff
* annotation: wip tags
* annotation: filtering by tags
* tags: parse out spaces etc. from a tags string
* annotations: use tagsinput component for tag filtering
* annotation: wip work on how we query alert & panel annotations
* annotations: support for updating tags in an annotation
* linting
* annotations: work on unifying how alert history annotations and manual panel annotations are created
* tslint: fixes
* tags: create tag on blur as well
Currently, the tags directive only creates the tag when the
user presses enter. This change means the tag is created on
blur as well (when the user clicks outside the input field).
* annotations: fix update after refactoring
* annotations: progress on how alert annotations are fetched
* annotations: minor progress
* annotations: progress
* annotation: minor progress
* annotations: move tag parsing from tooltip to ds
Instead of parsing a tag string into an array in the annotation_tooltip
class, this moves the parsing to the datasources. InfluxDB ds already
does that parsing. Graphite now has it.
* annotations: more work on querying
* annotations: change from tags as string to array
when saving in the db and in the api.
* annotations: delete tag link if removed on edit
* annotation: more work on depricating annotation title
* annotations: delete tag links on delete
* annotations: fix for find
* annotation: added user to annotation tooltip and added alertName to annoation dto
* annotations: use id from route instead from cmd for updating
* annotations: http api docs
* create annotation: last edits
* annotations: minor fix for querying annotations before dashboard saved
* annotations: fix for popover placement when legend is on the side (and doubel render pass is causing original marker to be removed)
* annotations: changing how the built in query gets added
* annotation: added time to header in edit mode
* tests: fixed jshint built issue
* webpack poc, this is not going to work for plugins, dam
* tech: webpack and systemjs for plugins starting to work
* tech: webpack and systemjs combo starting to work
* tech: webpack + karma tests progress
* tech: webpack + karma progress
* tech: working on tests
* tech: webpack
* tech: webpack + karma, all tests pass
* tech: webpack + karma, all tests pass
* tech: webpack all tests pass
* webpack: getting closer
* tech: webpack progress
* webpack: further build refinements
* webpack: ng annotate fixes
* webpack: optimized build fix
* tech: minor fix for elasticsearch
* tech: webpack + ace editor
* tech: restored lodash move mixin compatability
* tech: added enzyme react test and upgraded to react v16
* tech: package version fix
* tech: added testdata to built in bundle
* webpack: sass progress
* tech: prod & dev build is working for the sass
* tech: clean up unused grunt stuff and moved to scripts folder
* tech: added vendor and manifest chunks, updated readme and docs
* tech: webpack finishing touches
* Added a timestamp option to single stat
* can now choose last time as value
* Finished last_time so it formats correctly, updated value stat
* fixed som issues, but still issue with testing
* Clean up after fake clock in test
* timezone-issue fix, fake time for from now test
* fix for timedifference
* Prometheus: Fix actual step computation logic when a min_step is specified and the range is longer than min_step * 11000.
* Fix kbn.round_interval for exact intervals.
* Remove redundant 1d return, fix a couple of comments.
* Be more cautious with values close to 1d not rounding up to 1d. They may, because of the way the calculation uses 2 potentially different current time values.
A simple version control system for dashboards. Closes#1504.
Goals
1. To create a new dashboard version every time a dashboard is saved.
2. To allow users to view all versions of a given dashboard.
3. To allow users to rollback to a previous version of a dashboard.
4. To allow users to compare two versions of a dashboard.
Usage
Navigate to a dashboard, and click the settings cog. From there, click
the "Changelog" button to be brought to the Changelog view. In this
view, a table containing each version of a dashboard can be seen. Each
entry in the table represents a dashboard version. A selectable
checkbox, the version number, date created, name of the user who created
that version, and commit message is shown in the table, along with a
button that allows a user to restore to a previous version of that
dashboard. If a user wants to restore to a previous version of their
dashboard, they can do so by clicking the previously mentioned button.
If a user wants to compare two different versions of a dashboard, they
can do so by clicking the checkbox of two different dashboard versions,
then clicking the "Compare versions" button located below the dashboard.
From there, the user is brought to a view showing a summary of the
dashboard differences. Each summarized change contains a link that can
be clicked to take the user a JSON diff highlighting the changes line by
line.
Overview of Changes
Backend Changes
- A `dashboard_version` table was created to store each dashboard
version, along with a dashboard version model and structs to represent
the queries and commands necessary for the dashboard version API
methods.
- API endpoints were created to support working with dashboard
versions.
- Methods were added to create, update, read, and destroy dashboard
versions in the database.
- Logic was added to compute the diff between two versions, and
display it to the user.
- The dashboard migration logic was updated to save a "Version
1" of each existing dashboard in the database.
Frontend Changes
- New views
- Methods to pull JSON and HTML from endpoints
New API Endpoints
Each endpoint requires the authorization header to be sent in
the format,
```
Authorization: Bearer <jwt>
```
where `<jwt>` is a JSON web token obtained from the Grafana
admin panel.
`GET "/api/dashboards/db/:dashboardId/versions?orderBy=<string>&limit=<int>&start=<int>"`
Get all dashboard versions for the given dashboard ID. Accepts
three URL parameters:
- `orderBy` String to order the results by. Possible values
are `version`, `created`, `created_by`, `message`. Default
is `versions`. Ordering is always in descending order.
- `limit` Maximum number of results to return
- `start` Position in results to start from
`GET "/api/dashboards/db/:dashboardId/versions/:id"`
Get an individual dashboard version by ID, for the given
dashboard ID.
`POST "/api/dashboards/db/:dashboardId/restore"`
Restore to the given dashboard version. Post body is of
content-type `application/json`, and must contain.
```json
{
"dashboardId": <int>,
"version": <int>
}
```
`GET "/api/dashboards/db/:dashboardId/compare/:versionA...:versionB"`
Compare two dashboard versions by ID for the given
dashboard ID, returning a JSON delta formatted
representation of the diff. The URL format follows
what GitHub does. For example, visiting
[/api/dashboards/db/18/compare/22...33](http://ec2-54-80-139-44.compute-1.amazonaws.com:3000/api/dashboards/db/18/compare/22...33)
will return the diff between versions 22 and 33 for
the dashboard ID 18.
Dependencies Added
- The Go package [gojsondiff](https://github.com/yudai/gojsondiff)
was added and vendored.
Sorts the list of metric sources that is used in dropdown for Panel
Data Source on the Metrics tab so that it is case insensitive and
so that the built data sources are last in the list.
* Prettify duration unit format
Format duration like "2 days, 19 hours, 48 minutes" and make Decimals useful e.g.
0 decimals: 2 days
2 decimals: 2 days, 19 hours, 48 minutes
3 decimals: 2 days, 19 hours, 48 minutes, 27 seconds
Previous code did some rounding that is now gone so numbers might be
different.
* Rewrite kbn.toDuration without moment.js
Because https://github.com/moment/moment/issues/3653
* Add tests for kbn.toDuration
* Fix parsing of intervals. defined in ms
Fix parsing of intervals. defined in ms.
Increase accuracy for sub-second inrevals.
Closes#5008
* Tests for sub-ms intervals
Unit test for 2034d4b971
The original panel should clear all the templating variables and
look like it did before repeat was selected. Fixes#3831. Also
cleans up after a row repeat is removed
When linkSrv appends parameters to a URL's query string, it would blindly
add a ? to the URL even if the URL already contained a ? or the string
to add was empty. This change fixes that behavior and some other edge cases.
Includes a unit test to verify expected behavior.