Commit Graph

284 Commits

Author SHA1 Message Date
bergquist
d6b8c6a2d2 add graphite bridge that support delta counters 2017-09-14 14:26:32 +02:00
Torkel Ödegaard
84d4958a3c plugin change: make interval, cache timeout & max data points options in plugin.json, remove query.options component feature, add help markdown feature and toggle for data sources 2017-08-31 14:05:52 +02:00
Torkel Ödegaard
4f9fbcc211 dataproxy: added caching of datasources when doing data proxy requests, #9078 2017-08-23 13:31:26 +02:00
Torkel Ödegaard
3dc9d76b38 fix: viewer role fix, fixes #8976 2017-08-02 17:33:06 +02:00
Torkel Ödegaard
be29357d22 fix: added missing url route for annotation state history delete, fixes #8660 2017-06-23 11:48:58 -04:00
Torkel Ödegaard
ef1dfed0d8 dasboard_history: big refactoring of how the compare api looked, now a POST with a model for new & base version, refactored a simplified UI code as well, this was done to lay foundation to make it possible to do diff against current in browser unsaved version 2017-06-07 11:50:09 +02:00
Torkel Ödegaard
689e366f59 refactoring: updated api url routes so they do not conflict with slug route 2017-06-06 09:51:14 +02:00
Torkel Ödegaard
c87418d060 refactoring: Dashboard history restore operation is now reusing existing
operations instead of duplicating a bunch of get & save logic.
2017-06-05 17:45:27 +02: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
Torkel Ödegaard
0d39852ef4 fix: fixed test data fake metric query, fixes #8474 2017-05-29 10:48:38 +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
0156a94a49 annotations: you can now read annoations via manually created annoation query 2017-04-12 15:46:41 +02:00
Alexander Zobnin
d553498a33 graph(add annotation): initial backend implementation #1286 2017-04-10 20:22:58 +03:00
Torkel Ödegaard
bd4f073425 mysql: minor update 2017-03-30 20:23:40 +02:00
Daniel Lee
193d468ed3 admin: adds paging to global user list
Currently there is a limit of 1000 users in the global
user list. This change introduces paging so that an
admin can see all users and not just the first 1000.

Adds a new route to the api - /api/users/search that
returns a list of users and a total count. It takes
two parameters perpage and page that enable paging.

Fixes #7469
2017-02-13 12:59:36 +01:00
huydx
143cbe921f (feat) support datasource delete by name api 2017-02-10 23:30:14 +09:00
Torkel Ödegaard
8a95c563bb Merge branch 'master' into websocket 2017-01-31 08:56:49 +01:00
Pavlos Daoglou
3e741315b4 [3743] Adds support for user search based on login or email (#7334)
* [3743] Adds support for user search based on login or email

* Use query parameter instead

* Use macaron Query() instead
2017-01-31 06:25:55 +01:00
Torkel Ödegaard
b8f559aecb feat(plugins): made notifiers more pluggable and easier to support many of them, new ones can now be added without modifying any existing file, #7162 2017-01-06 12:04:25 +01:00
Torkel Ödegaard
fad07f0d15 refactor(http): refactoring http server 2016-12-21 14:36:32 +01:00
bergquist
a2257ec3d0 tech(alerting): renames pause all method 2016-12-19 15:17:49 +01:00
bergquist
ecdf1888c4 feat(alerting): removes pause per datasource 2016-12-19 13:24:45 +01:00
bergquist
fb6aa0e026 feat(api): adds endpoint for mass pausing alerts
ref #6589
2016-12-16 15:00:58 +01:00
Torkel Ödegaard
22bf6420f1 Merge branch 'master' of github.com:grafana/grafana 2016-12-08 10:25:26 +01:00
bergquist
8ee85626f2 fix(api): return correct json info after updating datasource
closes #6869
2016-12-07 18:09:17 +01:00
Torkel Ödegaard
fd512457d8 Merge remote-tracking branch 'origin/master' into getting-started-panel-css2 2016-11-18 16:31:54 +01:00
Torkel Ödegaard
e3564d12a1 fix(404): fixed 404 page 2016-11-16 17:09:00 +01:00
Torkel Ödegaard
fb57bf77da ux(getting started): progress on getting started panel and persited help flag states, #6466 2016-11-09 10:41:39 +01:00
bergquist
b2d5b920f5 feat(alerting): allow editor to modify notifications
closes #6314
2016-10-19 08:01:31 +02:00
Torkel Ödegaard
4c26c55fea fix(api): minor change to how pause alert was done 2016-10-14 09:58:22 +02:00
Torkel Ödegaard
c9d7eb0a7a feat(alerting): added clear history button to alert state history view, #6244 2016-10-14 09:33:42 +02:00
bergquist
c6cf7647ff feat(alerting): pausing alerts requires alert id 2016-10-11 10:53:24 +02:00
bergquist
804797245d feat(alerting): make it possible to pause from alert tab 2016-10-11 08:40:38 +02:00
bergquist
264590a9c2 feat(alerting): add paused api endpoint 2016-10-10 14:26:09 +02:00
Torkel Ödegaard
7c339f0794 feat(alerting): show alertin state in panel header, closes #6136 2016-09-30 17:37:47 +02:00
Torkel Ödegaard
3ecd96e682 feat(testdata): lots of work on new test data data source and scenarios 2016-09-27 18:17:39 +02:00
Carl Bergquist
d6a0ec85c4 Merge pull request #6111 from grafana/pluginreadme
allow non-admin users to view plugin readme
2016-09-22 19:51:47 +02:00
Dan Cech
2c3dd84ebb allow non-admin users to view plugin readme 2016-09-22 13:46:11 -04:00
Torkel Ödegaard
936146768f fix(snapshots): fixed issue with viewing embedded/solo/png panel from snapshot without login, fixes #3769 2016-09-22 11:46:58 +02:00
Torkel Ödegaard
d60bd77658 feat(annotations): added support to show grafana stored annotations in graphs, #5982 2016-09-08 11:25:45 +02:00
bergquist
d11bc57c37 feat(notifications): make it possible to send test alert notifications
closes #5847
2016-09-05 14:45:15 +02:00
bergquist
11a4ff0f8a feat(alerting): add basic UI for history in alert tab
ref #5850
2016-08-30 13:22:59 +02:00
bergquist
650a87dc05 feat(alerting): add alert history api endpoint
ref #5850
2016-08-30 09:32:56 +02:00
chrismartin0077
0050707134 feat(api) HEAD response, fixes #3854 2016-08-29 06:07:44 -07:00
bergquist
0cbedb4473 chore(api): remove commented endpoints 2016-08-22 16:56:28 +02:00
Torkel Ödegaard
7eb2d2cf47 feat(alerting): working on state management 2016-07-22 13:14:09 +02:00
Torkel Ödegaard
9e91aacd34 feat(alerting): progress on testing alerts 2016-07-21 10:29:11 +02:00
Torkel Ödegaard
fb636344a6 feat(alerting): began work on testing alert rule from UI without having to save it 2016-07-20 16:13:36 +02:00
Torkel Ödegaard
f13b869aa4 feat(alerting): work on alerting 2016-07-14 13:32:16 +02:00