Commit Graph

346 Commits

Author SHA1 Message Date
Torkel Ödegaard
07e192ff47 change: more work on changing default group by time interval to min interval setting 2017-09-01 15:57:02 +02:00
Alexander Zobnin
b260a642e7 ace: fix broken karma tests (error loading ace.js ) 2017-08-10 12:33:53 +03:00
Jesse White
1940b33dc1 fix: handling of http errors without any data (#8777) 2017-07-04 22:55:13 +02:00
Torkel Ödegaard
9ff4ab1236 Merge branch 'master' into query_troubleshooting 2017-06-13 16:47:04 -04:00
Torkel Ödegaard
f3980504e2 Merge branch 'master' into walmartlabs-master 2017-06-05 13:43:00 +02:00
sanchitraizada
77c046aac6 Implement review feedback 2017-06-01 17:57:09 -04:00
Daniel Lee
3292a48381 graph: dashes with linewidth fix. Fixes #8469
Adds series override options for dash spaces and dash length.
2017-05-26 15:09:05 +02:00
Ben Tranter
b6e46c9eb8 History and Version Control for Dashboard Updates
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.
2017-05-24 19:14:39 -04:00
Torkel Ödegaard
5513d3c9d1 feat: moved json-formatter-js into core grafana to be able to make changes 2017-05-19 13:16:05 +02:00
Torkel Ödegaard
f65878c21d ux: working on query troubleshooting 2017-05-18 17:04:31 +02:00
Daniel Lee
540ee35393 timerange: new quick ranges, month and year so far
The new time ranges can also be used for time range overrides in the
override relative time field. E.g. now/M or now/y.
2017-05-17 13:52:39 +02:00
Daniel Lee
e61b392916 core: fix linting errors in specs files 2017-05-17 13:47:44 +02:00
Torkel Ödegaard
87f5222907 typescript: fixed issue with tslint in testsW 2017-05-17 13:43:17 +02:00
smalik
1a3bc60e69 feat(dashed lines): Implementing dashed lines
Adding support for dashed lines using jquery.flot.dashes.js
2017-04-26 13:19:24 +02:00
Torkel Ödegaard
f1276774a0 typescript: updated tslint and fixed new warnings 2017-04-20 11:16:37 +02:00
Torkel Ödegaard
8eb112d119 plugins: refactoring builtIn data source concept, now means data source plugins that you do not need to add via data sources page, that is automatically added as selectable data source, #8095 2017-04-12 08:23:44 +02:00
Alexander Zobnin
0a56db7745 Add unit tests for heatmap_ctrl. 2017-03-26 18:22:54 +03:00
Daniel Lee
77921c4dcd renderpng: fixes invalid image link (#7797)
Closes #7770
2017-03-13 09:31:59 +01:00
Torkel Ödegaard
d6eaaf3add refactor: minor refactoring 2017-02-23 15:57:36 +01:00
bergquist
d88286ab81 orgs: set orgId as query param on load
ref #1613
2017-02-23 11:03:39 +01:00
bergquist
73830a44fe sharemodal: fixes broken unittests 2017-02-22 14:29:49 +01:00
Daniel Lee
8aa5b62d6d fix(panel): case insensitive sort metric sources
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.
2017-02-08 00:01:42 +01:00
Torkel Ödegaard
9ba1ea0179 fix(): another unit test fix attempt 2017-01-31 08:52:48 +01:00
Torkel Ödegaard
436e35c845 fix(): fixed unit test broken in last PR merge 2017-01-31 07:59:14 +01:00
Torkel Ödegaard
0683742e83 tech(library upgrade): fixed unit test broken by angularjs upgrade, #7274 2017-01-16 22:27:35 +01:00
Torkel Ödegaard
49fe74228b fix(browser history): fixes and enhancements to browser history, it now works properly again AND it can restore previous time ranges in dashboards, closes #7259 2017-01-13 17:37:53 +01:00
Torkel Ödegaard
9dc42648cf fix(templating): fixed issue with experimental feature template variable value groups tags, fixes #6752 2017-01-02 13:32:20 +01:00
Torkel Ödegaard
af363ab478 fix(panel): build fixes 2016-12-16 13:43:43 +01:00
Axel
2adbe3e13e Prettify duration value format (#6875)
* 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
2016-12-09 15:55:25 +01:00
Dirk le Roux
49dda7e5c1 first, delta, range passing unit tests
Signed-off-by: Dirk le Roux <dirk.leroux@gmail.com>
2016-11-29 08:26:31 +02:00
Torkel Ödegaard
95e7ead89b ux(dashboard): varius dashboard ux fixes and keybinding improvements, press 'e' while hovering over panel will open dashboard in edit mode, pressing 'd' will remove panel, #6442 2016-11-02 15:16:48 +01:00
Torkel Ödegaard
18056e53cc ux(dashboard): Fixing broken unit test made by changes for dash edit mode, #6442 2016-11-01 14:35:35 +01:00
Mitsuhiro Tanda
a8dd44918b support future time range 2016-10-18 19:39:04 +09:00
Torkel Ödegaard
34f15d92d0 feat(testdata): worked on testdata app 2016-09-27 14:39:51 +02:00
Torkel Ödegaard
d8df421b43 fix(build): fixed issues with optimized build, fixes #6096 2016-09-22 10:22:16 +02:00
Torkel Ödegaard
a01836e86d feat(adhoc filters): basic implementation for ad hoc filters for elasticsearch, #6038 2016-09-21 08:48:49 +02:00
Torkel Ödegaard
6e429b8575 feat(adhoc filters): good progress on ad hoc filters and sync from to url, #6038 2016-09-20 11:57:43 +02:00
Torkel Ödegaard
5ded88fa4d feat(templating): progress on variable system refactoring, #6048 2016-09-19 11:34:08 +02:00
Torkel Ödegaard
524f505664 tech(templating): refactoring, updated dashboardSrv to typescript 2016-09-19 10:08:05 +02:00
Torkel Ödegaard
5ce3e40cc9 feat(templating): more work on new variable handling code, #6048 2016-09-17 15:27:53 +02:00
Torkel Ödegaard
46ebae7304 feat(templating): progress on template system rewrite #6048 2016-09-16 16:50:30 +02:00
Torkel Ödegaard
0f4a9f1ed1 feat(templating): began refactoring variables into rich behavioral classes 2016-09-15 14:53:36 +02:00
Torkel Ödegaard
94e5001c0e feat(templating): making progress on adhoc template variable, #6038 2016-09-15 09:18:28 +02:00
Torkel Ödegaard
0fa0066cd9 tech(lodash): began migration work 2016-09-13 22:10:44 +02:00
Torkel Ödegaard
6375418d8c Merge branch 'alerting' into grafana-annotations 2016-09-13 09:38:12 +02:00
bergquist
e348822190 Merge branch 'template_sort' of https://github.com/mtanda/grafana into mtanda-template_sort 2016-09-13 07:16:34 +02:00
Torkel Ödegaard
4a2f2fba73 feat(alerting): show panel specific alert annotations, #5694 2016-09-09 11:30:55 +02:00
bergquist
4d0982a21c Merge branch 'master' into alerting 2016-08-15 07:58:30 +02:00
Torkel Ödegaard
0ea3458f69 Merge branch 'v3.1.x'
Conflicts:
	public/app/features/dashboard/dynamic_dashboard_srv.ts
2016-08-14 14:47:14 +02:00
Torkel Ödegaard
58df60f670 fix(templating): another fix for repeating panels and having old panels/scoped vars stuck after switching repeat variable, fixes #5795 2016-08-14 14:45:49 +02:00