Commit Graph

73 Commits

Author SHA1 Message Date
Torkel Ödegaard
b8d9722b4f tech: removing unused variables from typescript files, and making tslint rules more strict 2017-09-21 16:40:18 +02:00
Torkel Ödegaard
64b5153e7d fix: change view json to use the grafana built json viewer, fixes #9002 2017-08-08 11:26:16 +02:00
Torkel Ödegaard
a49e82e447 ux: revert dashboard search nav change, this is a tempoary change until we redesign the sidenav 2017-06-16 09:47:21 -04:00
Torkel Ödegaard
fdfcd5cbf0 refactoring:: dashboard save modal and save as modal needed an update 2017-06-05 14:56:11 +02:00
Torkel Ödegaard
f3980504e2 Merge branch 'master' into walmartlabs-master 2017-06-05 13:43:00 +02:00
Torkel Ödegaard
e9d5e037e8 ux: merge branch navbarv2, new navbar with dashboard search available on all pages, closes #6475 2017-06-02 14:00:42 +02:00
sanchitraizada
77c046aac6 Implement review feedback 2017-06-01 17:57:09 -04: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
4d4e165be7 links: updated links from grafana.net to grafana.com 2017-03-20 10:20:32 +01:00
Denis Doria
0264fcc66c Remove unsaved dialog when removing a dashboard #7591 (#7733) 2017-03-06 07:49:28 +01:00
Torkel Ödegaard
890e5ce8ca feat(playlist): added support for kiosk mode & minor polish/fix, closes #6727 2016-12-05 11:43:51 +01:00
Torkel Ödegaard
8db40b25db ux(dashboard): final tweaks to view mode and kiosk mode, better animation for view mode, and kiosk mode can be entered via kiosk url parameter, #6476 2016-11-06 10:15:36 +01:00
Torkel Ödegaard
82592f0c13 ux(help): began work on new help modal 2016-11-03 20:32:36 +01:00
Torkel Ödegaard
3e712178cc ux(dashboard): began removing build mode and adding new slide out row menu 2016-11-03 15:50:11 +01:00
Torkel Ödegaard
f91e067235 ux(dashboard): keybinding changes / new, #6442 2016-11-03 15:14:44 +01:00
Torkel Ödegaard
3c1435253d feat(ux dashboard editmode): added shortcut to setting menu, #6442 2016-11-02 11:05:28 +01:00
Torkel Ödegaard
155cce959f more polish on edit mode 2016-10-28 14:38:48 +02:00
Torkel Ödegaard
7b0eb6d0bb feat(dashboard): progress on dash edit mode 2016-10-25 16:36:40 +02:00
Torkel Ödegaard
29e834e74b feat(UX): revived dash-edit-mode branch, #6099 2016-10-23 10:05:31 +02:00
Torkel Ödegaard
1bb8192a38 Merge branch 'master' into dash-edit-mode 2016-10-23 10:03:55 +02:00
Torkel Ödegaard
30645a6d3d refactor(alerting): initial step for seperating alerting and dash model, #6273 2016-10-14 13:06:29 +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
e2f5bf1666 feat(alerting): fixed confirm delete dashboard issue 2016-09-05 13:38:25 +02:00
Torkel Ödegaard
8878a55dc6 Merge branch 'master' into alerting 2016-08-11 10:31:15 +02:00
Alexander Zobnin
124961a9e3 Explicitly set charset to utf-8 in viewJson(), fixes #5719. (#5774) 2016-08-10 20:23:58 +02:00
Torkel Ödegaard
b0fe69822a Merge branch 'master' into alerting
Conflicts:
	public/app/core/services/alert_srv.ts
	public/app/partials/confirm_modal.html
2016-07-18 18:22:35 +02:00
Torkel Ödegaard
4bb4d7f7d3 Merge branch 'v3.1.x' 2016-07-12 15:54:31 +02:00
Torkel Ödegaard
b2acac3a41 feat(apps): more polish on app dashboard save warning, #5529 2016-07-12 08:41:56 +02:00
Torkel Ödegaard
d9096110f8 Merge branch 'master' into alerting
Conflicts:
	pkg/api/dashboard.go
	pkg/models/dashboards.go
	pkg/services/sqlstore/dashboard.go
2016-07-11 18:28:07 +02:00
Torkel Ödegaard
08202dcb83 Merge branch 'v3.1.x' 2016-07-11 09:39:17 +02:00
Torkel Ödegaard
68a8d9bc91 feat(apps): more work on plugin dashboard sync 2016-07-08 13:41:46 +02:00
Torkel Ödegaard
d44325affd feat(apps): progress on app dashboard imports 2016-07-08 09:35:06 +02:00
Mitsuhiro Tanda
630d0d0793 (snapshot) add open original dashboard button 2016-07-02 02:26:27 +09:00
Mitsuhiro Tanda
7aaa15ad95 (snapshot) save original url 2016-07-02 02:16:23 +09:00
bergquist
8ec311ade4 Merge branch 'master' into alerting 2016-06-16 16:29:41 +02:00
Matt Toback
8d988f9582 Export dashboard bulletfactory (#5160)
* create descriptions and styles for share dropdown

* Updating actual modal layout for Sharing

* Updated the modals to follow the new styles, fixed the wrapping issue on the main menu. Standardized buttons.
2016-05-25 12:30:27 +02:00
Torkel Ödegaard
673984a7db feat(export): more export stuff 2016-05-18 15:53:13 +02:00
Torkel Ödegaard
05d064ca8d export(): moved to share modal 2016-05-17 21:18:47 +02:00
Torkel Ödegaard
df50fa2332 feat(export): export dashboard modal 2016-05-17 11:17:11 +02:00
Torkel Ödegaard
ad7a1e15b4 feat(export): began working on export modal 2016-05-17 10:29:57 +02:00
bergquist
80f7fe8646 feat(alerting): add confirm text dialog when deleting dashboards with alerts 2016-05-16 11:54:28 +02:00
yershalom
1b262d33f3 Added json to file name when exporting dashboard (#4869) 2016-05-01 15:31:01 +02:00
Torkel Ödegaard
f8b4fcdc42 Merge branch 'master' into export-dashboard
Conflicts:
	packaging/publish/publish.sh
2016-04-29 15:01:47 +02:00
Matt Toback
a7e8e64d78 The beginnings of the build mode and rows 2016-04-15 19:52:18 -04:00
Matt Toback
38bda92bdc Update dashnav.html 2016-04-15 13:26:27 -04:00
Torkel Ödegaard
0f71838fdf feat(dash export): dashboard export can now replace datasource names with variable and add inputs section 2016-04-14 21:13:01 -04:00
Torkel Ödegaard
4d0b14fbb4 feat(exporter): stared work on dashboard exporter that cleans up repeated panels etc 2016-04-14 17:31:34 -04:00
utkarshcmu
58b76bac0d Removed unused option 2016-04-06 07:12:38 -07:00
Torkel Ödegaard
6e6ebc5947 trying to fix karma issue 2016-04-03 09:43:33 -04:00
utkarshcmu
9dd6aefcec Minor corrections 2016-03-16 23:35:06 -07:00